knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject knox git commit: Fix unit tests on machines without writeable root filesystems.
Date Wed, 11 Feb 2015 18:13:17 GMT
Repository: knox
Updated Branches:
  refs/heads/master ba4c2010a -> 5abdde8bc


Fix unit tests on machines without writeable root filesystems.


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/5abdde8b
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/5abdde8b
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/5abdde8b

Branch: refs/heads/master
Commit: 5abdde8bce31a82bcf9c13cb5a17ce9ca773a010
Parents: ba4c201
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Wed Feb 11 13:12:58 2015 -0500
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Wed Feb 11 13:12:58 2015 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java | 7 ++++---
 .../org/apache/hadoop/gateway/GatewayGlobalConfigTest.java    | 6 +++---
 .../test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java | 4 ++--
 .../src/test/resources/conf-demo/conf/gateway-default.xml     | 6 +++---
 .../src/test/resources/conf-demo/conf/gateway-site.xml        | 6 +++---
 5 files changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/5abdde8b/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
index 34483ab..dd379aa 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/util/KnoxCLI.java
@@ -93,11 +93,12 @@ public class KnoxCLI extends Configured implements Tool {
           initializeServices( command instanceof MasterCreateCommand );
           command.execute();
       } else {
-        exitCode = -1;
+        exitCode = -2;
       }
     } catch (Exception e) {
-      e.printStackTrace(err);
-      return -1;
+      e.printStackTrace( err );
+      err.flush();
+      return -3;
     }
     return exitCode;
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/5abdde8b/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayGlobalConfigTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayGlobalConfigTest.java
b/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayGlobalConfigTest.java
index 277703a..5f1db49 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayGlobalConfigTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayGlobalConfigTest.java
@@ -91,7 +91,7 @@ public class GatewayGlobalConfigTest {
     System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
     System.setProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR, homeDirName);
     GatewayConfig config = new GatewayConfigImpl();
-    assertTrue(("/test").equalsIgnoreCase(config.getGatewayDeploymentDir()));
+    assertTrue(("target/test").equalsIgnoreCase(config.getGatewayDeploymentDir()));
   }
 
   @Test
@@ -118,7 +118,7 @@ public class GatewayGlobalConfigTest {
     System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
     System.setProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR, homeDirName);
     GatewayConfig config = new GatewayConfigImpl();
-    assertTrue(("/test").equalsIgnoreCase(config.getGatewaySecurityDir()));
+    assertTrue(("target/test").equalsIgnoreCase(config.getGatewaySecurityDir()));
   }
 
   @Test
@@ -137,7 +137,7 @@ public class GatewayGlobalConfigTest {
     System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
     System.clearProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR);
     GatewayConfig config = new GatewayConfigImpl();
-    assertTrue(("/testDataDir").equalsIgnoreCase(config
+    assertTrue(("target/testDataDir").equalsIgnoreCase(config
         .getGatewayDataDir()));
   }
 

http://git-wip-us.apache.org/repos/asf/knox/blob/5abdde8b/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
b/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
index cfb29de..82fc9cc 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/util/KnoxCLITest.java
@@ -53,7 +53,7 @@ public class KnoxCLITest {
     System.setOut(new PrintStream(outContent));
     System.setErr(new PrintStream(errContent));
   }
-  
+
   @Test
   public void testSuccessfulAlaisLifecycle() throws Exception {
     outContent.reset();
@@ -333,7 +333,7 @@ public class KnoxCLITest {
 
     outContent.reset();
     rc = cli.run(args);
-    assertThat( rc, is( -1 ) );
+    assertThat( rc, not(is(0)) );
     assertThat( outContent.toString(), containsString( "Master secret is already present
on disk." ) );
 
     outContent.reset();

http://git-wip-us.apache.org/repos/asf/knox/blob/5abdde8b/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml b/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
index 747255f..a8f83bc 100644
--- a/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
+++ b/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
@@ -50,17 +50,17 @@ limitations under the License.
     </property>
     <property>
         <name>gateway.deployment.dir</name>
-        <value>/test</value>
+        <value>target/test</value>
         <description>The path that contains deployments.</description>
     </property>
     <property>
         <name>gateway.security.dir</name>
-        <value>/test</value>
+        <value>target/test</value>
         <description>The path that contains Security.</description>
     </property>
      <property>
         <name>gateway.data.dir</name>
-        <value>/testDataDir</value>
+        <value>target/testDataDir</value>
         <description>The path that contains Gateway Data (Security and deployments)</description>
     </property>
     

http://git-wip-us.apache.org/repos/asf/knox/blob/5abdde8b/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml b/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
index c9d9cc3..aaee777 100644
--- a/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
+++ b/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
@@ -56,17 +56,17 @@ limitations under the License.
     </property>
     <property>
         <name>gateway.deployment.dir</name>
-        <value>/test</value>
+        <value>target/test</value>
         <description>The path that contains deployments.</description>
     </property>
     <property>
         <name>gateway.security.dir</name>
-        <value>/test</value>
+        <value>target/test</value>
         <description>The path that contains Security.</description>
     </property>
      <property>
         <name>gateway.data.dir</name>
-        <value>/testDataDir</value>
+        <value>target/testDataDir</value>
         <description>The path that contains Gateway Data (Security and deployments)</description>
     </property>
     


Mime
View raw message