knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject knox git commit: [KNOX-684] - Increase test timeouts for failing tests. Part 2.
Date Mon, 07 Mar 2016 20:41:24 GMT
Repository: knox
Updated Branches:
  refs/heads/master 8008d559c -> 62da197bf


[KNOX-684] - Increase test timeouts for failing tests. Part 2.


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

Branch: refs/heads/master
Commit: 62da197bfd98ab26b07a1d6f72c7e36dc0952978
Parents: 8008d55
Author: Kevin Minder <kminder@apache.org>
Authored: Mon Mar 7 15:41:18 2016 -0500
Committer: Kevin Minder <kminder@apache.org>
Committed: Mon Mar 7 15:41:18 2016 -0500

----------------------------------------------------------------------
 .../gateway/GatewayAdminTopologyFuncTest.java   | 23 +++++++++-----------
 .../hadoop/gateway/GatewayDeployFuncTest.java   |  6 ++---
 .../GatewayLdapDynamicGroupFuncTest.java        |  7 ++----
 .../gateway/GatewayLdapGroupFuncTest.java       |  7 ++----
 .../gateway/GatewayLdapPosixGroupFuncTest.java  |  7 ++----
 .../gateway/GatewayLocalServiceFuncTest.java    |  6 ++---
 .../hadoop/gateway/GatewaySampleFuncTest.java   |  7 ++----
 .../apache/hadoop/gateway/Knox242FuncTest.java  |  7 ++----
 .../gateway/KnoxCliLdapFuncTestNegative.java    |  6 ++---
 .../gateway/KnoxCliLdapFuncTestPositive.java    |  6 ++---
 .../hadoop/gateway/KnoxCliSysBindTest.java      |  6 ++---
 .../gateway/OozieServiceDefinitionTest.java     |  9 +++-----
 .../hadoop/gateway/WebHdfsHaFuncTest.java       | 20 ++++++++---------
 13 files changed, 42 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
index 53b1c94..51064e0 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
@@ -45,6 +45,7 @@ import org.apache.hadoop.gateway.topology.Param;
 import org.apache.hadoop.gateway.topology.Provider;
 import org.apache.hadoop.gateway.topology.Service;
 import org.apache.hadoop.gateway.topology.Topology;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.http.HttpStatus;
 import org.apache.log4j.Appender;
 import org.hamcrest.MatcherAssert;
@@ -69,10 +70,6 @@ import static org.junit.Assert.fail;
 
 public class GatewayAdminTopologyFuncTest {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long MEDIUM_TIMEOUT = 5 * SHORT_TIMEOUT;
-  private static final long LONG_TIMEOUT = 5 * MEDIUM_TIMEOUT;
-
   private static Class RESOURCE_BASE_CLASS = GatewayAdminTopologyFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayAdminTopologyFuncTest.class
);
 
@@ -266,7 +263,7 @@ public class GatewayAdminTopologyFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testTopologyCollection() throws ClassNotFoundException {
     LOG_ENTER();
 
@@ -323,7 +320,7 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testTopologyObject() throws ClassNotFoundException {
     LOG_ENTER();
 
@@ -385,7 +382,7 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testPositiveAuthorization() throws ClassNotFoundException{
     LOG_ENTER();
 
@@ -413,7 +410,7 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testNegativeAuthorization() throws ClassNotFoundException{
     LOG_ENTER();
 
@@ -494,7 +491,7 @@ public class GatewayAdminTopologyFuncTest {
     return topology;
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testDeployTopology() throws Exception {
     LOG_ENTER();
 
@@ -548,7 +545,7 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testDeleteTopology() throws ClassNotFoundException {
     LOG_ENTER();
 
@@ -591,7 +588,7 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testPutTopology() throws ClassNotFoundException {
     LOG_ENTER() ;
 
@@ -658,7 +655,7 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testXForwardedHeaders() {
     LOG_ENTER();
 
@@ -774,7 +771,7 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testGatewayPathChange() throws Exception {
     LOG_ENTER();
     String username = "admin";

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
index 7d6ecce..1e8cf3a 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.gateway.config.GatewayConfig;
 import org.apache.hadoop.gateway.security.ldap.SimpleLdapDirectoryServer;
 import org.apache.hadoop.gateway.services.DefaultGatewayServices;
 import org.apache.hadoop.gateway.services.ServiceLifecycleException;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.hadoop.test.category.ReleaseTest;
 import org.apache.http.HttpStatus;
 import org.apache.log4j.Appender;
@@ -65,9 +66,6 @@ import static org.junit.Assert.assertThat;
 @Category(ReleaseTest.class)
 public class GatewayDeployFuncTest {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long LONG_TIMEOUT = 30 * 1000L;
-
   private static Class RESOURCE_BASE_CLASS = GatewayDeployFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayDeployFuncTest.class );
 
@@ -206,7 +204,7 @@ public class GatewayDeployFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = LONG_TIMEOUT )
+  @Test( timeout = TestUtils.LONG_TIMEOUT )
   public void testDeployRedeployUndeploy() throws InterruptedException, IOException {
     LOG_ENTER();
     long sleep = 200;

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
index 5c5a27f..a68bb14 100755
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
@@ -69,9 +69,6 @@ import com.mycila.xmltool.XMLTag;
  */
 public class GatewayLdapDynamicGroupFuncTest {
 
-  private static final long SHORT_TIMEOUT = 2000L;
-  private static final long MEDIUM_TIMEOUT = 5 * SHORT_TIMEOUT;
-
   private static Class RESOURCE_BASE_CLASS = GatewayLdapDynamicGroupFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayLdapDynamicGroupFuncTest.class
);
 
@@ -288,7 +285,7 @@ public class GatewayLdapDynamicGroupFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testGroupMember() throws ClassNotFoundException, Exception {
     LOG_ENTER();
     String username = "bob";
@@ -306,7 +303,7 @@ public class GatewayLdapDynamicGroupFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testNonGroupMember() throws ClassNotFoundException {
     LOG_ENTER();
     String username = "guest";

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
index 9780198..c67c992 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
@@ -69,9 +69,6 @@ import com.mycila.xmltool.XMLTag;
  */
 public class GatewayLdapGroupFuncTest {
 
-  private static final long SHORT_TIMEOUT = 2000L;
-  private static final long MEDIUM_TIMEOUT = 5 * 1000L;
-
   private static Class RESOURCE_BASE_CLASS = GatewayLdapGroupFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayLdapGroupFuncTest.class );
 
@@ -288,7 +285,7 @@ public class GatewayLdapGroupFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testGroupMember() throws ClassNotFoundException, Exception {
     LOG_ENTER();
     String username = "sam";
@@ -306,7 +303,7 @@ public class GatewayLdapGroupFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testNonGroupMember() throws ClassNotFoundException {
     LOG_ENTER();
     String username = "guest";

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
index 6278c53..80c3207 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
@@ -69,9 +69,6 @@ import static org.junit.Assert.fail;
 @Category(ReleaseTest.class)
 public class GatewayLdapPosixGroupFuncTest {
 
-  private static final long SHORT_TIMEOUT = 2000L;
-  private static final long MEDIUM_TIMEOUT = 5 * 1000L;
-
   private static Class RESOURCE_BASE_CLASS = GatewayLdapPosixGroupFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayLdapPosixGroupFuncTest.class
);
 
@@ -266,7 +263,7 @@ public class GatewayLdapPosixGroupFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testGroupMember() throws ClassNotFoundException, Exception {
     LOG_ENTER();
     String username = "sam";
@@ -283,7 +280,7 @@ public class GatewayLdapPosixGroupFuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testNonGroupMember() throws ClassNotFoundException {
     LOG_ENTER();
     String username = "guest";

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
index f9ca534..a8fa17e 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.gateway.config.GatewayConfig;
 import org.apache.hadoop.gateway.security.ldap.SimpleLdapDirectoryServer;
 import org.apache.hadoop.gateway.services.DefaultGatewayServices;
 import org.apache.hadoop.gateway.services.ServiceLifecycleException;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.hadoop.test.log.NoOpAppender;
 import org.apache.http.HttpStatus;
 import org.apache.log4j.Appender;
@@ -56,9 +57,6 @@ import static org.junit.Assert.assertThat;
 
 public class GatewayLocalServiceFuncTest {
 
-  private static final long SHORT_TIMEOUT = 2000L;
-  private static final long MEDIUM_TIMEOUT = 5 * SHORT_TIMEOUT;
-
   private static Class RESOURCE_BASE_CLASS = GatewayLocalServiceFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayFuncTestDriver.class );
 
@@ -173,7 +171,7 @@ public class GatewayLocalServiceFuncTest {
     return xml;
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testJerseyService() throws ClassNotFoundException {
     LOG_ENTER();
     assertThat( ClassLoader.getSystemClassLoader().loadClass( "org.glassfish.jersey.servlet.ServletContainer"
), notNullValue() );

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
index 4cad0cb..a740d96 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.gateway.config.GatewayConfig;
 import org.apache.hadoop.gateway.security.ldap.SimpleLdapDirectoryServer;
 import org.apache.hadoop.gateway.services.DefaultGatewayServices;
 import org.apache.hadoop.gateway.services.ServiceLifecycleException;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.http.HttpStatus;
 import org.apache.log4j.Appender;
 import org.hamcrest.MatcherAssert;
@@ -58,10 +59,6 @@ import static org.junit.Assert.assertThat;
 
 public class GatewaySampleFuncTest {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long MEDIUM_TIMEOUT = 20 * 1000L;
-  private static final long LONG_TIMEOUT = 60 * 1000L;
-
   private static Class RESOURCE_BASE_CLASS = GatewaySampleFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewaySampleFuncTest.class );
 
@@ -200,7 +197,7 @@ public class GatewaySampleFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testTestService() throws ClassNotFoundException {
     LOG_ENTER();
     String username = "guest";

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
index 88f02b9..a9baec1 100755
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
@@ -70,9 +70,6 @@ import com.mycila.xmltool.XMLTag;
  */
 public class Knox242FuncTest {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long MEDIUM_TIMEOUT = 10 * SHORT_TIMEOUT;
-
   private static Class RESOURCE_BASE_CLASS = Knox242FuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( Knox242FuncTest.class );
 
@@ -282,7 +279,7 @@ public class Knox242FuncTest {
     System.in.read();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testGroupMember() throws ClassNotFoundException, Exception {
     LOG_ENTER();
     String username = "joe";
@@ -300,7 +297,7 @@ public class Knox242FuncTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testNonGroupMember() throws ClassNotFoundException {
     LOG_ENTER();
     String username = "guest";

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
index ade2b5a..65f0aaa 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.gateway.security.ldap.SimpleLdapDirectoryServer;
 import org.apache.hadoop.gateway.services.DefaultGatewayServices;
 import org.apache.hadoop.gateway.services.ServiceLifecycleException;
 import org.apache.hadoop.gateway.util.KnoxCLI;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.hadoop.test.log.NoOpAppender;
 import org.apache.hadoop.test.log.NoOpLogger;
 import org.apache.log4j.Appender;
@@ -56,9 +57,6 @@ import static org.junit.Assert.assertThat;
 
 public class KnoxCliLdapFuncTestNegative {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long MEDIUM_TIMEOUT = 5 * SHORT_TIMEOUT;
-
   private static Class RESOURCE_BASE_CLASS = KnoxCliLdapFuncTestPositive.class;
   private static Logger LOG = LoggerFactory.getLogger( KnoxCliLdapFuncTestPositive.class
);
 
@@ -276,7 +274,7 @@ public class KnoxCliLdapFuncTestNegative {
     return xml;
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testBadTopology() throws Exception {
     LOG_ENTER();
 

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
index e49c5a3..d6aba41 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.gateway.security.ldap.SimpleLdapDirectoryServer;
 import org.apache.hadoop.gateway.services.DefaultGatewayServices;
 import org.apache.hadoop.gateway.services.ServiceLifecycleException;
 import org.apache.hadoop.gateway.util.KnoxCLI;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.hadoop.test.log.NoOpAppender;
 import org.apache.log4j.Appender;
 import org.hamcrest.Matchers;
@@ -54,9 +55,6 @@ import static org.junit.Assert.assertThat;
 
 public class KnoxCliLdapFuncTestPositive {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long MEDIUM_TIMEOUT = 5 * SHORT_TIMEOUT;
-
   private static Class RESOURCE_BASE_CLASS = KnoxCliLdapFuncTestPositive.class;
   private static Logger LOG = LoggerFactory.getLogger( KnoxCliLdapFuncTestPositive.class
);
 
@@ -264,7 +262,7 @@ public class KnoxCliLdapFuncTestPositive {
     return xml;
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testLDAPAuth() throws Exception {
     LOG_ENTER();
 

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
index afa309d..cc5874d 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.gateway.security.ldap.SimpleLdapDirectoryServer;
 import org.apache.hadoop.gateway.services.DefaultGatewayServices;
 import org.apache.hadoop.gateway.services.ServiceLifecycleException;
 import org.apache.hadoop.gateway.util.KnoxCLI;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.hadoop.test.log.NoOpAppender;
 import org.apache.log4j.Appender;
 import org.hamcrest.Matchers;
@@ -53,9 +54,6 @@ import static org.junit.Assert.assertThat;
 
 public class KnoxCliSysBindTest {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long MEDIUM_TIMEOUT = 5 * SHORT_TIMEOUT;
-
   private static Class RESOURCE_BASE_CLASS = KnoxCliSysBindTest.class;
   private static Logger LOG = LoggerFactory.getLogger( KnoxCliSysBindTest.class );
 
@@ -268,7 +266,7 @@ public class KnoxCliSysBindTest {
     return xml;
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testLDAPAuth() throws Exception {
     LOG_ENTER();
 

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/OozieServiceDefinitionTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/OozieServiceDefinitionTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/OozieServiceDefinitionTest.java
index b2f982b..9171e7c 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/OozieServiceDefinitionTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/OozieServiceDefinitionTest.java
@@ -47,10 +47,7 @@ import static org.hamcrest.xml.HasXPath.hasXPath;
 
 public class OozieServiceDefinitionTest {
 
-  private static final long SHORT_TIMEOUT = 1000L;
-  private static final long MEDIUM_TIMEOUT = 5 * SHORT_TIMEOUT;
-
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testOozieRewriteRulesForLiteralTemplateValuesBugKnox394() throws Exception
{
     LOG_ENTER();
 
@@ -103,7 +100,7 @@ public class OozieServiceDefinitionTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testOozieRewriteRulesForLiteralComplexTemplateValuesBugKnox394() throws Exception
{
     LOG_ENTER();
 
@@ -156,7 +153,7 @@ public class OozieServiceDefinitionTest {
     LOG_EXIT();
   }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testOozieRewriteRulesForValuesRelativeToServiceRegistry() throws Exception
{
     LOG_ENTER();
 

http://git-wip-us.apache.org/repos/asf/knox/blob/62da197b/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
index da6bbc4..bcfa7cf 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
@@ -19,6 +19,7 @@ package org.apache.hadoop.gateway;
 
 import com.mycila.xmltool.XMLDoc;
 import com.mycila.xmltool.XMLTag;
+import org.apache.hadoop.test.TestUtils;
 import org.apache.hadoop.test.category.ReleaseTest;
 import org.apache.hadoop.test.mock.MockServer;
 import org.apache.http.HttpStatus;
@@ -39,9 +40,6 @@ import static org.hamcrest.CoreMatchers.is;
 @Category(ReleaseTest.class)
 public class WebHdfsHaFuncTest {
 
-   private static final long SHORT_TIMEOUT = 1000L;
-   private static final long MEDIUM_TIMEOUT = 10 * SHORT_TIMEOUT;
-
    // Specifies if the test requests should go through the gateway or directly to the services.
    // This is frequently used to verify the behavior of the test both with and without the
gateway.
    private static final boolean USE_GATEWAY = true;
@@ -156,7 +154,7 @@ public class WebHdfsHaFuncTest {
       return xml;
    }
 
-  @Test( timeout = MEDIUM_TIMEOUT )
+  @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    public void testBasicListOperation() throws IOException {
       LOG_ENTER();
       String username = "hdfs";
@@ -183,7 +181,7 @@ public class WebHdfsHaFuncTest {
       LOG_EXIT();
    }
 
-   @Test( timeout = MEDIUM_TIMEOUT )
+   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    @Ignore( "KNOX-446" )
    public void testFailoverListOperation() throws Exception {
       LOG_ENTER();
@@ -214,7 +212,7 @@ public class WebHdfsHaFuncTest {
       LOG_EXIT();
    }
 
-   @Test( timeout = MEDIUM_TIMEOUT )
+   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    public void testFailoverLimit() throws Exception {
       LOG_ENTER();
       String username = "hdfs";
@@ -236,7 +234,7 @@ public class WebHdfsHaFuncTest {
    }
 
 
-   @Test( timeout = MEDIUM_TIMEOUT )
+   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    @Ignore( "KNOX-446" )
    public void testServerInStandby() throws IOException {
       LOG_ENTER();
@@ -276,7 +274,7 @@ public class WebHdfsHaFuncTest {
       LOG_EXIT();
    }
 
-   @Test( timeout = MEDIUM_TIMEOUT )
+   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    public void testServerInStandbyFailoverLimit() throws IOException {
       LOG_ENTER();
       String username = "hdfs";
@@ -331,7 +329,7 @@ public class WebHdfsHaFuncTest {
       LOG_EXIT();
    }
 
-   @Test( timeout = MEDIUM_TIMEOUT )
+   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    public void testServerInSafeMode() throws IOException {
       LOG_ENTER();
       String username = "hdfs";
@@ -371,7 +369,7 @@ public class WebHdfsHaFuncTest {
       LOG_EXIT();
    }
 
-   @Test( timeout = MEDIUM_TIMEOUT )
+   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    public void testServerInSafeModeRetriableException() throws IOException {
       LOG_ENTER();
       String username = "hdfs";
@@ -408,7 +406,7 @@ public class WebHdfsHaFuncTest {
       LOG_EXIT();
    }
 
-   @Test( timeout = MEDIUM_TIMEOUT )
+   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
    public void testServerInSafeModeRetryLimit() throws IOException {
       LOG_ENTER();
       String username = "hdfs";


Mime
View raw message