ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject incubator-ranger git commit: Revert "(BUG-30064) Unit Test Execution of Ranger Windows failing"
Date Wed, 04 Feb 2015 04:33:50 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master fba0f8c4b -> 28c49b6df


Revert "(BUG-30064) Unit Test Execution of Ranger Windows failing"

This reverts commit fba0f8c4b89b301748533dac557846f2bc8b2c91.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/28c49b6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/28c49b6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/28c49b6d

Branch: refs/heads/master
Commit: 28c49b6dfc3f932aed4302092bdb81a7ba8cf644
Parents: fba0f8c
Author: sneethiraj <sneethir@apache.org>
Authored: Tue Feb 3 23:33:18 2015 -0500
Committer: sneethiraj <sneethir@apache.org>
Committed: Tue Feb 3 23:33:18 2015 -0500

----------------------------------------------------------------------
 .../hadoop/utils/RangerCredentialProviderTest.java  |  9 ++++-----
 .../ranger/credentialapi/TestCredentialReader.java  |  8 +++-----
 .../apache/ranger/credentialapi/Testbuildks.java    | 16 +++++++---------
 3 files changed, 14 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/28c49b6d/agents-cred/src/test/java/org/apache/ranger/authorization/hadoop/utils/RangerCredentialProviderTest.java
----------------------------------------------------------------------
diff --git a/agents-cred/src/test/java/org/apache/ranger/authorization/hadoop/utils/RangerCredentialProviderTest.java
b/agents-cred/src/test/java/org/apache/ranger/authorization/hadoop/utils/RangerCredentialProviderTest.java
index 0443eb2..a9dafba 100644
--- a/agents-cred/src/test/java/org/apache/ranger/authorization/hadoop/utils/RangerCredentialProviderTest.java
+++ b/agents-cred/src/test/java/org/apache/ranger/authorization/hadoop/utils/RangerCredentialProviderTest.java
@@ -18,7 +18,6 @@
 
 package org.apache.ranger.authorization.hadoop.utils;
 
-import java.io.File;
 import java.util.List;
 
 import org.junit.Before;
@@ -34,10 +33,10 @@ import org.apache.hadoop.security.alias.CredentialProvider;
 import org.apache.ranger.authorization.hadoop.utils.RangerCredentialProvider;
 
 public class RangerCredentialProviderTest {
-	private final String keystoreFile = new File(System.getProperty("user.home")+"/testkeystore.jceks").toURI().getPath();
-	private String[] argsCreate = {"create", "TestCredential001", "-value", "PassworD123", "-provider",
"jceks://file@/" + keystoreFile};
-	private String[] argsDelete = {"delete", "TestCredential001", "-provider", "jceks://file@/"
+ keystoreFile};
-	private String url = "jceks://file@/" + keystoreFile;
+	private final String keystoreFile = System.getProperty("user.home")+"/testkeystore.jceks";
 
+	private String[] argsCreate = {"create", "TestCredential001", "-value", "PassworD123", "-provider",
"jceks://file" + keystoreFile};
+	private String[] argsDelete = {"delete", "TestCredential001", "-provider", "jceks://file"
+ keystoreFile};
+	private String url = "jceks://file" + keystoreFile;
 	RangerCredentialProvider cp = null;
 	List<CredentialProvider> providers = null;
 	

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/28c49b6d/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/TestCredentialReader.java
----------------------------------------------------------------------
diff --git a/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/TestCredentialReader.java
b/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/TestCredentialReader.java
index fac8148..f3e1ca8 100644
--- a/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/TestCredentialReader.java
+++ b/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/TestCredentialReader.java
@@ -20,19 +20,17 @@ package org.apache.ranger.credentialapi;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.File;
-
 import org.apache.ranger.credentialapi.CredentialReader;
 import org.apache.ranger.credentialapi.buildks;
 import org.junit.Before;
 import org.junit.Test;
 
 public class TestCredentialReader {
-  private final String keystoreFile = new File(System.getProperty("user.home")+"/testkeystore.jceks").toURI().getPath();
+  private final String keystoreFile =System.getProperty("user.home")+"/testkeystore.jceks";
 
   @Before
   public void setup() throws Exception {   
 	buildks buildksOBJ=new buildks();	
-    String[] argsCreateCommand = {"create", "TestCredential2", "-value", "PassworD123", "-provider",
"jceks://file@/" + keystoreFile};
+    String[] argsCreateCommand = {"create", "TestCredential2", "-value", "PassworD123", "-provider",
"jceks://file" + keystoreFile};
     int rc2=buildksOBJ.createCredential(argsCreateCommand); 
     assertEquals( 0, rc2);
     assertTrue(rc2==0);  
@@ -44,7 +42,7 @@ public class TestCredentialReader {
     assertEquals( "PassworD123", password);
     assertTrue(password,"PassworD123".equals(password));
     //delete after use
-    String[] argsdeleteCommand = {"delete", "TestCredential2", "-provider", "jceks://file@/"
+ keystoreFile};
+    String[] argsdeleteCommand = {"delete", "TestCredential2", "-provider", "jceks://file"
+ keystoreFile};
 	buildks buildksOBJ=new buildks();
 	buildksOBJ.deleteCredential(argsdeleteCommand);
     

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/28c49b6d/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/Testbuildks.java
----------------------------------------------------------------------
diff --git a/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/Testbuildks.java
b/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/Testbuildks.java
index d01f842..fe94745 100644
--- a/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/Testbuildks.java
+++ b/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/Testbuildks.java
@@ -20,33 +20,31 @@ package org.apache.ranger.credentialapi;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.File;
-
 import org.apache.ranger.credentialapi.buildks;
 import org.junit.Test;
 
 public class Testbuildks {
-  private final String keystoreFile = new File(System.getProperty("user.home")+"/testkeystore.jceks").toURI().getPath();
+  private final String keystoreFile =System.getProperty("user.home")+"/testkeystore.jceks";
 
   @Test
   public void testBuildKSsuccess() throws Exception {   
 	buildks buildksOBJ=new buildks();
-    String[] argsCreateCommand = {"create", "TestCredential1", "-value", "PassworD123", "-provider",
"jceks://file@/" + keystoreFile};
+    String[] argsCreateCommand = {"create", "TestCredential1", "-value", "PassworD123", "-provider",
"jceks://file" + keystoreFile};
     int rc1=buildksOBJ.createCredential(argsCreateCommand); 
     assertEquals( 0, rc1);
     assertTrue(rc1==0);
    
-    String[] argsListCommand = {"list", "-provider","jceks://file@/" + keystoreFile};
+    String[] argsListCommand = {"list", "-provider","jceks://file" + keystoreFile};
     int rc2=buildksOBJ.listCredential(argsListCommand);
     assertEquals(0, rc2);
     assertTrue(rc2==0);
     
-    String[] argsGetCommand = {"get", "TestCredential1", "-provider", "jceks://file@/" +keystoreFile
};
+    String[] argsGetCommand = {"get", "TestCredential1", "-provider", "jceks://file" +keystoreFile
};
     String pw=buildksOBJ.getCredential(argsGetCommand);
     assertEquals("PassworD123", pw);
     assertTrue(pw.equals("PassworD123"));
     boolean getCredentialPassed = pw.equals("PassworD123");
     
-    String[] argsDeleteCommand = {"delete", "TestCredential1", "-provider", "jceks://file@/"
+keystoreFile };
+    String[] argsDeleteCommand = {"delete", "TestCredential1", "-provider", "jceks://file"
+keystoreFile };
     int rc3=buildksOBJ.deleteCredential(argsDeleteCommand);
     assertEquals(0, rc3);
     assertTrue(rc3==0);
@@ -59,7 +57,7 @@ public class Testbuildks {
   @Test
   public void testInvalidProvider() throws Exception {
 	buildks buildksOBJ=new buildks(); 
-	String[] argsCreateCommand = {"create", "TestCredential1", "-value", "PassworD123", "-provider",
"jksp://file@/"+keystoreFile};    
+	String[] argsCreateCommand = {"create", "TestCredential1", "-value", "PassworD123", "-provider",
"jksp://file"+keystoreFile};    
     int rc1=buildksOBJ.createCredential(argsCreateCommand);   
     assertEquals(-1, rc1);
     assertTrue(rc1==-1);
@@ -68,7 +66,7 @@ public class Testbuildks {
   @Test
   public void testInvalidCommand() throws Exception {
 	buildks buildksOBJ=new buildks(); 
-	String[] argsCreateCommand = {"creat", "TestCredential1", "-value", "PassworD123", "-provider",
"jksp://file@/"+keystoreFile};    
+	String[] argsCreateCommand = {"creat", "TestCredential1", "-value", "PassworD123", "-provider",
"jksp://file"+keystoreFile};    
     int rc1=buildksOBJ.createCredential(argsCreateCommand);   
     assertEquals(-1, rc1);
     assertTrue(rc1==-1);


Mime
View raw message