ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [8/9] incubator-ranger git commit: RANGER-234: Fixes to crypt filepath error on windows platform
Date Wed, 04 Feb 2015 17:04:57 GMT
RANGER-234: Fixes to crypt filepath error on windows platform


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

Branch: refs/heads/stack
Commit: 163a6d0a5346623226ea3e463d55c9d2e535d1f9
Parents: 28c49b6
Author: sneethiraj <sneethir@apache.org>
Authored: Tue Feb 3 23:37:14 2015 -0500
Committer: sneethiraj <sneethir@apache.org>
Committed: Tue Feb 3 23:37:14 2015 -0500

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


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/163a6d0a/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 a9dafba..0443eb2 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,6 +18,7 @@
 
 package org.apache.ranger.authorization.hadoop.utils;
 
+import java.io.File;
 import java.util.List;
 
 import org.junit.Before;
@@ -33,10 +34,10 @@ import org.apache.hadoop.security.alias.CredentialProvider;
 import org.apache.ranger.authorization.hadoop.utils.RangerCredentialProvider;
 
 public class RangerCredentialProviderTest {
-	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;
+	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;
 	RangerCredentialProvider cp = null;
 	List<CredentialProvider> providers = null;
 	

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/163a6d0a/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 f3e1ca8..fac8148 100644
--- a/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/TestCredentialReader.java
+++ b/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/TestCredentialReader.java
@@ -20,17 +20,19 @@ 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 =System.getProperty("user.home")+"/testkeystore.jceks";
 
+  private final String keystoreFile = new File(System.getProperty("user.home")+"/testkeystore.jceks").toURI().getPath();
   @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);  
@@ -42,7 +44,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/163a6d0a/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 fe94745..d01f842 100644
--- a/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/Testbuildks.java
+++ b/credentialbuilder/src/test/java/org/apache/ranger/credentialapi/Testbuildks.java
@@ -20,31 +20,33 @@ 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 =System.getProperty("user.home")+"/testkeystore.jceks";
 
+  private final String keystoreFile = new File(System.getProperty("user.home")+"/testkeystore.jceks").toURI().getPath();
   @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);
@@ -57,7 +59,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);
@@ -66,7 +68,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