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-620: Jenkins Knox-master-verify failing since #725 due to JDK version issues. Third attempt, added test timeouts and more debugging.
Date Sat, 07 Nov 2015 20:27:58 GMT
Repository: knox
Updated Branches:
  refs/heads/master e38562500 -> 37b41663f


KNOX-620: Jenkins Knox-master-verify failing since #725 due to JDK version issues. Third attempt, added test timeouts and more debugging.


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

Branch: refs/heads/master
Commit: 37b41663f91d930bb785e9a562bb60d0d63f0818
Parents: e385625
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Sat Nov 7 15:27:52 2015 -0500
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Sat Nov 7 15:27:52 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/hadoop/test/TestUtils.java  |  11 ++
 .../hadoop/gateway/GatewayAdminFuncTest.java    |  17 +-
 .../gateway/GatewayAdminTopologyFuncTest.java   |  46 +++--
 .../hadoop/gateway/GatewayBasicFuncTest.java    | 188 ++++++++++++++-----
 .../hadoop/gateway/GatewayDeployFuncTest.java   |  13 +-
 .../GatewayLdapDynamicGroupFuncTest.java        |  20 +-
 .../gateway/GatewayLdapGroupFuncTest.java       |  20 +-
 .../gateway/GatewayLocalServiceFuncTest.java    |  13 +-
 .../hadoop/gateway/GatewaySampleFuncTest.java   |  16 +-
 .../apache/hadoop/gateway/Knox242FuncTest.java  |  18 +-
 .../gateway/KnoxCliLdapFuncTestNegative.java    |  12 +-
 .../gateway/KnoxCliLdapFuncTestPositive.java    |  12 +-
 .../hadoop/gateway/KnoxCliSysBindTest.java      |  16 +-
 .../gateway/OozieServiceDefinitionTest.java     |  19 +-
 .../hadoop/gateway/WebHdfsHaFuncTest.java       |  41 +++-
 .../deploy/DeploymentFactoryFuncTest.java       |  29 ++-
 .../src/test/resources/log4j.properties         |   2 +-
 17 files changed, 374 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/gateway-test-utils/src/main/java/org/apache/hadoop/test/TestUtils.java
----------------------------------------------------------------------
diff --git a/gateway-test-utils/src/main/java/org/apache/hadoop/test/TestUtils.java b/gateway-test-utils/src/main/java/org/apache/hadoop/test/TestUtils.java
index 084d296..b52aeba 100644
--- a/gateway-test-utils/src/main/java/org/apache/hadoop/test/TestUtils.java
+++ b/gateway-test-utils/src/main/java/org/apache/hadoop/test/TestUtils.java
@@ -19,6 +19,7 @@ package org.apache.hadoop.test;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
+import org.junit.Test;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -114,4 +115,14 @@ public class TestUtils {
     System.out.println( xmlString );
   }
 
+  public static void LOG_ENTER() {
+    StackTraceElement caller = Thread.currentThread().getStackTrace()[2];
+    System.out.println( String.format( "Running %s#%s", caller.getClassName(), caller.getMethodName() ) );
+  }
+
+  public static void LOG_EXIT() {
+    StackTraceElement caller = Thread.currentThread().getStackTrace()[2];
+    System.out.println( String.format( "Exiting %s#%s", caller.getClassName(), caller.getMethodName() ) );
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
index cbf560c..91f2162 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
@@ -24,6 +24,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.hamcrest.MatcherAssert;
 import org.hamcrest.Matchers;
@@ -51,6 +52,10 @@ import static org.junit.Assert.assertThat;
 
 public class GatewayAdminFuncTest {
 
+  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 = GatewayAdminFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayAdminFuncTest.class );
 
@@ -64,17 +69,21 @@ public class GatewayAdminFuncTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    TestUtils.LOG_ENTER();
     //appenders = NoOpAppender.setUp();
     setupLdap();
     setupGateway();
+    TestUtils.LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    TestUtils.LOG_ENTER();
     gateway.stop();
     ldap.stop( true );
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    TestUtils.LOG_EXIT();
   }
 
   public static void setupLdap() throws Exception {
@@ -186,15 +195,15 @@ public class GatewayAdminFuncTest {
     return RESOURCE_BASE_CLASS.getName().replaceAll( "\\.", "/" ) + "/";
   }
 
-  @Ignore
-  @Test
+  //@Test
   public void waitForManualTesting() throws IOException {
     System.out.println( clusterUrl );
     System.in.read();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testAdminService() throws ClassNotFoundException {
+    TestUtils.LOG_ENTER();
 
     String username = "guest";
     String password = "guest-password";
@@ -208,6 +217,8 @@ public class GatewayAdminFuncTest {
         .statusCode(HttpStatus.SC_OK)
         //.body( is( "{\"hash\":\"unknown\",\"version\":\"unknown\"}" ) )
         .when().get( serviceUrl );
+
+    TestUtils.LOG_EXIT();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 98f66a9..54d2b9b 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
@@ -56,6 +56,7 @@ import java.util.Map;
 import java.util.UUID;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;
@@ -67,6 +68,9 @@ import static org.junit.Assert.fail;
 
 public class GatewayAdminTopologyFuncTest {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+  private static final long LONG_TIMEOUT = 30 * 1000L;
+
   private static Class RESOURCE_BASE_CLASS = GatewayAdminTopologyFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayAdminTopologyFuncTest.class );
 
@@ -270,9 +274,9 @@ public class GatewayAdminTopologyFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testTopologyCollection() throws ClassNotFoundException {
-    ENTER( "testTopologyCollection" );
+    LOG_ENTER();
 
     String username = "admin";
     String password = "admin-password";
@@ -329,9 +333,9 @@ public class GatewayAdminTopologyFuncTest {
 
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testTopologyObject() throws ClassNotFoundException {
-    ENTER( "testTopologyObject" );
+    LOG_ENTER();
 
     String username = "admin";
     String password = "admin-password";
@@ -390,9 +394,9 @@ public class GatewayAdminTopologyFuncTest {
 
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testPositiveAuthorization() throws ClassNotFoundException{
-    ENTER( "testPositiveAuthorization" );
+    LOG_ENTER();
 
     String adminUser = "admin";
     String adminPass = "admin-password";
@@ -417,9 +421,9 @@ public class GatewayAdminTopologyFuncTest {
 
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testNegativeAuthorization() throws ClassNotFoundException{
-    ENTER( "testNegativeAuthorization" );
+    LOG_ENTER();
 
     String guestUser = "guest";
     String guestPass = "guest-password";
@@ -499,9 +503,9 @@ public class GatewayAdminTopologyFuncTest {
     return topology;
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testDeployTopology() throws ClassNotFoundException {
-    ENTER( "testDeployTopology" );
+    LOG_ENTER();
 
     Topology testTopology = createTestTopology();
 
@@ -551,9 +555,9 @@ public class GatewayAdminTopologyFuncTest {
         .get(url);
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testDeleteTopology() throws ClassNotFoundException {
-    ENTER( "testDeleteTopology" );
+    LOG_ENTER();
 
     Topology test = createTestTopology();
 
@@ -592,9 +596,9 @@ public class GatewayAdminTopologyFuncTest {
         .get(url);
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testPutTopology() throws ClassNotFoundException {
-    ENTER( "testPutTopology" ) ;
+    LOG_ENTER() ;
 
     String username = "admin";
     String password = "admin-password";
@@ -658,9 +662,9 @@ public class GatewayAdminTopologyFuncTest {
 
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testXForwardedHeaders() {
-    ENTER( "testXForwardedHeaders" );
+    LOG_ENTER();
 
     String username = "admin";
     String password = "admin-password";
@@ -773,9 +777,9 @@ public class GatewayAdminTopologyFuncTest {
 
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testGatewayPathChange() throws Exception {
-    ENTER( "testGatewayPathChange" );
+    LOG_ENTER();
     String username = "admin";
     String password = "admin-password";
     String url =  clusterUrl + "/api/v1/topologies";
@@ -820,10 +824,4 @@ public class GatewayAdminTopologyFuncTest {
 
   private static final String CLASS = GatewayAdminTopologyFuncTest.class.getCanonicalName();
 
-  private static void ENTER( String method ) {
-    String message = String.format( "Running %s#%s ", CLASS, method );
-    System.out.println( message );
-    LOG.info( message );
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
index 2bcbc1a..ce9aa29 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
@@ -69,6 +69,8 @@ import java.util.Map;
 import java.util.Map.Entry;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.*;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsString;
@@ -81,6 +83,10 @@ import static uk.co.datumedge.hamcrest.json.SameJSONAs.sameJSONAs;
 @Category( { FunctionalTests.class, MediumTests.class } )
 public class GatewayBasicFuncTest {
 
+  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 final Charset UTF8 = Charset.forName("UTF-8");
 
   // Uncomment to cause the test to hang after the gateway instance is setup.
@@ -133,6 +139,7 @@ public class GatewayBasicFuncTest {
   @BeforeClass
   public static void setupSuite() throws Exception {
     Log.setLog( new NoOpLogger() );
+    LOG_ENTER();
     GatewayTestConfig config = new GatewayTestConfig();
     config.setGatewayPath( "gateway" );
     driver.setResourceBase(GatewayBasicFuncTest.class);
@@ -150,13 +157,16 @@ public class GatewayBasicFuncTest {
     driver.setupService( "STORM", "http://" + TEST_HOST + ":8477", "/cluster/storm", USE_MOCK_SERVICES );
     driver.setupService( "STORM-LOGVIEWER", "http://" + TEST_HOST + ":8477", "/cluster/storm", USE_MOCK_SERVICES );
     driver.setupGateway( config, "cluster", createTopology(), USE_GATEWAY );
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     if( CLEANUP_TEST ) {
       driver.cleanup();
     }
+    LOG_EXIT();
   }
 
   @After
@@ -254,8 +264,9 @@ public class GatewayBasicFuncTest {
     return xml;
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testBasicJsonUseCase() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayBasicFuncTest/testBasicJsonUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
@@ -296,10 +307,12 @@ public class GatewayBasicFuncTest {
     assertThat( cookie.getPath(), is( "/gateway/cluster" ) );
     assertThat( cookie.getValue().length(), greaterThan( 16 ) );
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testBasicOutboundHeaderUseCase() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayBasicFuncTest/testBasicOutboundHeaderUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
@@ -337,10 +350,12 @@ public class GatewayBasicFuncTest {
     }
     MatcherAssert.assertThat(location, not(containsString("host=")));
     MatcherAssert.assertThat(location, not(containsString("port=")));
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testHdfsTildeUseCase() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayBasicFuncTest/testHdfsTildeUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
@@ -392,11 +407,12 @@ public class GatewayBasicFuncTest {
         .content( "boolean", is( true ) )
         .when().put( driver.getUrl( "WEBHDFS" ) + "/v1/~/dir" );
     driver.assertComplete();
-
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testBasicHdfsUseCase() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayBasicFuncTest/testBasicHdfsUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
@@ -675,13 +691,15 @@ public class GatewayBasicFuncTest {
         .statusCode( HttpStatus.SC_OK )
         .when().delete( driver.getUrl( "WEBHDFS" ) + "/v1" + root );
     driver.assertComplete();
+    LOG_EXIT();
   }
 
   // User hdfs in groups hadoop, hdfs
   // User mapred in groups hadoop, mapred
   // User hcat in group hcat
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testPmHdfsM1UseCase() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayBasicFuncTest/testPmHdfdM1UseCase";
     String userA = "hdfs";
     String passA = "hdfs-password";
@@ -787,10 +805,12 @@ public class GatewayBasicFuncTest {
 
     // Cleanup anything that might have been leftover because the test failed previously.
     driver.deleteFile( userA, passA, root, "true", HttpStatus.SC_OK );
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testJavaMapReduceViaWebHCat() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayBasicFuncTest/testJavaMapReduceViaWebHCat";
     String user = "mapred";
     String pass = "mapred-password";
@@ -841,10 +861,12 @@ public class GatewayBasicFuncTest {
       // Cleanup anything that might have been leftover because the test failed previously.
       driver.deleteFile( user, pass, root, "true", HttpStatus.SC_OK );
     }
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testPigViaWebHCat() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayWebHCatFuncTest/testPigViaWebHCat";
     String user = "mapred";
     String pass = "mapred-password";
@@ -870,10 +892,12 @@ public class GatewayBasicFuncTest {
 
     // Cleanup
     driver.deleteFile( user, pass, root, "true", 200 );
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHiveViaWebHCat() throws IOException {
+    LOG_ENTER();
     String user = "hive";
     String pass = "hive-password";
     String group = "hive";
@@ -895,18 +919,12 @@ public class GatewayBasicFuncTest {
 
     // Cleanup
     driver.deleteFile( user, pass, root, "true", 200 );
+    LOG_EXIT();
   }
 
-  @Ignore( "WIP" )
-  @Test
-  public void testOozieGeneralOperations() {
-    String user = "oozie";
-    String pass = "oozie-password";
-//    driver.oozieVersions( user, pass );
-  }
-
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testOozieJobSubmission() throws Exception {
+    LOG_ENTER();
     String root = "/tmp/GatewayBasicFuncTest/testOozieJobSubmission";
     String user = "hdfs";
     String pass = "hdfs-password";
@@ -978,10 +996,12 @@ public class GatewayBasicFuncTest {
       // Cleanup anything that might have been leftover because the test failed previously.
       driver.deleteFile( user, pass, root, "true", HttpStatus.SC_OK );
     }
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testBasicHiveJDBCUseCase() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayHiveJDBCFuncTest/testBasicHiveUseCase";
     String username = "hive";
     String password = "hive-password";
@@ -1379,10 +1399,12 @@ public class GatewayBasicFuncTest {
         .when().post( driver.getUrl( "HIVE" ) );
     assertThat( response.body().asByteArray(), is( driver.getResourceBytes( "hive/close-session-result.bin" ) ) );
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHBaseGetTableList() throws IOException {
+    LOG_ENTER();
     String username = "hbase";
     String password = "hbase-password";
     String resourceName = "hbase/table-list";
@@ -1455,10 +1477,12 @@ public class GatewayBasicFuncTest {
     .content( is( driver.getResourceString( resourceName + ".protobuf", UTF8 ) ) )
     .when().get( driver.getUrl( "WEBHBASE" ) );
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHBaseCreateTableAndVerifySchema() throws IOException {
+    LOG_ENTER();
     String username = "hbase";
     String password = "hbase-password";
     String resourceName = "hbase/table-schema";
@@ -1524,10 +1548,12 @@ public class GatewayBasicFuncTest {
     .when().put(driver.getUrl("WEBHBASE") + path);
     driver.assertComplete();
 
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHBaseGetTableSchema() throws IOException {
+    LOG_ENTER();
     String username = "hbase";
     String password = "hbase-password";
     String resourceName = "hbase/table-metadata";
@@ -1603,10 +1629,12 @@ public class GatewayBasicFuncTest {
     // RestAssured seems to be screwing up the binary comparison so do it explicitly.
     assertThat( driver.getResourceBytes( resourceName + ".protobuf" ), is( response.body().asByteArray() ) );
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHBaseInsertDataIntoTable() throws IOException {
+    LOG_ENTER();
     String username = "hbase";
     String password = "hbase-password";
     
@@ -1741,10 +1769,12 @@ public class GatewayBasicFuncTest {
     .statusCode( HttpStatus.SC_OK )
     .when().post(driver.getUrl("WEBHBASE") + multipleRowPath);
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHBaseDeleteDataFromTable() {
+    LOG_ENTER();
     String username = "hbase";
     String password = "hbase-password";
     
@@ -1801,10 +1831,12 @@ public class GatewayBasicFuncTest {
     .when().delete(driver.getUrl("WEBHBASE") + "/" + tableId + "/" + rowId + "/" + familyId + ":" + columnId);
     driver.assertComplete();
 
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHBaseQueryTableData() throws IOException {
+    LOG_ENTER();
     String username = "hbase";
     String password = "hbase-password";
     
@@ -1910,10 +1942,12 @@ public class GatewayBasicFuncTest {
     MatcherAssert
     .assertThat( response.getBody().asString(), sameJSONAs( driver.getResourceString( resourceName + ".json", UTF8 ) ) );
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testHBaseUseScanner() throws IOException {
+    LOG_ENTER();
     String username = "hbase";
     String password = "hbase-password";
     
@@ -1985,10 +2019,12 @@ public class GatewayBasicFuncTest {
     .statusCode( HttpStatus.SC_OK )
     .when().delete(driver.getUrl("WEBHBASE") + scannerPath + "/" + scannerId);
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testCrossSiteRequestForgeryPreventionPUT() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayWebHdfsFuncTest/testCrossSiteRequestForgeryPrevention";
     String username = "hdfs";
     String password = "hdfs-password";
@@ -2005,8 +2041,9 @@ public class GatewayBasicFuncTest {
     driver.assertComplete();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testCrossSiteRequestForgeryPreventionGET() throws IOException {
+    LOG_ENTER();
     String root = "/tmp/GatewayWebHdfsFuncTest/testCrossSiteRequestForgeryPrevention";
     String username = "hdfs";
     String password = "hdfs-password";
@@ -2030,36 +2067,46 @@ public class GatewayBasicFuncTest {
         .when().get( driver.getUrl( "WEBHDFS" ) + "/v1" + root + "/dir" );
 //    driver.reset();
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testYarnRmGetClusterInfo() throws Exception {
+    LOG_ENTER();
     getYarnRmResource( "/v1/cluster/", ContentType.JSON, "yarn/cluster-info" );
     getYarnRmResource( "/v1/cluster/", ContentType.XML, "yarn/cluster-info" );
     getYarnRmResource( "/v1/cluster/info/", ContentType.JSON, "yarn/cluster-info" );
     getYarnRmResource("/v1/cluster/info/", ContentType.XML, "yarn/cluster-info");
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testYarnRmGetClusterMetrics() throws Exception {
+    LOG_ENTER();
     getYarnRmResource( "/v1/cluster/metrics/", ContentType.JSON, "yarn/cluster-metrics" );
     getYarnRmResource("/v1/cluster/metrics/", ContentType.XML, "yarn/cluster-metrics");
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testYarnRnGetScheduler() throws Exception {
+    LOG_ENTER();
     getYarnRmResource( "/v1/cluster/scheduler/", ContentType.JSON, "yarn/scheduler" );
     getYarnRmResource("/v1/cluster/scheduler/", ContentType.XML, "yarn/scheduler");
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void getYarnRmAppstatistics() throws Exception {
+    LOG_ENTER();
     getYarnRmResource( "/v1/cluster/appstatistics/", ContentType.JSON, "yarn/appstatistics" );
     getYarnRmResource("/v1/cluster/appstatistics/", ContentType.XML, "yarn/appstatistics");
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testYarnRmGetApplications() throws Exception {
+    LOG_ENTER();
     getYarnRmApps( ContentType.XML, null );
     getYarnRmApps( ContentType.JSON, null );
 
@@ -2078,9 +2125,11 @@ public class GatewayBasicFuncTest {
 
     getYarnRmApps( ContentType.XML, params );
     getYarnRmApps( ContentType.JSON, params );
+    LOG_EXIT();
   }
 
   private void getYarnRmApps( ContentType contentType, Map<String,String> params ) throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
     String path = "/v1/cluster/apps/";
@@ -2148,10 +2197,12 @@ public class GatewayBasicFuncTest {
         .get(gatewayPath + gatewayPathQuery);
 
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testYarnApplicationLifecycle() throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
     String path = "/v1/cluster/apps/new-application";
@@ -2216,17 +2267,21 @@ public class GatewayBasicFuncTest {
         .contentType("application/json")
         .when().put(driver.getUrl("RESOURCEMANAGER") + path + (driver.isUseGateway() ? "" : "?user.name=" + username));
     assertThat(response.getBody().asString(), Matchers.is("{\"state\":\"KILLING\"}"));
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testYarnRmApplication() throws Exception {
+    LOG_ENTER();
     getYarnRmApp( ContentType.JSON, true );
     getYarnRmApp( ContentType.XML, true );
     getYarnRmApp( ContentType.JSON, false );
     getYarnRmApp( ContentType.XML, false );
+    LOG_EXIT();
   }
 
   private void getYarnRmApp( ContentType contentType, boolean running ) throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
     String path = "/v1/cluster/apps/application_1399541193872_0033/";
@@ -2299,11 +2354,12 @@ public class GatewayBasicFuncTest {
         .get( gatewayPath );
 
     driver.assertComplete();
+    LOG_EXIT();
   }
 
   private void getYarnRmResource( String path, ContentType contentType, String resource )
       throws Exception {
-
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
 
@@ -2353,15 +2409,19 @@ public class GatewayBasicFuncTest {
       break;
     }
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testYarnRmAppattempts() throws Exception {
+    LOG_ENTER();
     getYarnRmAppattempts( ContentType.JSON );
     getYarnRmAppattempts(ContentType.XML);
+    LOG_EXIT();
   }
 
   private void getYarnRmAppattempts( ContentType contentType ) throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
     String path = "/v1/cluster/apps/application_1399541193872_0018/appattempts/";
@@ -2402,10 +2462,12 @@ public class GatewayBasicFuncTest {
         .get( gatewayPath );
 
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testYarnRmNodes() throws Exception {
+    LOG_ENTER();
     getYarnRmNodes( ContentType.JSON, null );
     getYarnRmNodes( ContentType.XML, null );
 
@@ -2415,9 +2477,11 @@ public class GatewayBasicFuncTest {
 
     getYarnRmNodes( ContentType.JSON, params );
     getYarnRmNodes(ContentType.XML, params);
+    LOG_EXIT();
   }
 
   private void getYarnRmNodes( ContentType contentType, Map<String, String> params ) throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
     String path = "/v1/cluster/nodes/";
@@ -2489,10 +2553,12 @@ public class GatewayBasicFuncTest {
         .get( gatewayPath + encryptedNodeId );
 
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testYarnRmProxy() throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
     String path = "/v1/cluster/apps/application_1399541193872_0033/";
@@ -2641,7 +2707,7 @@ public class GatewayBasicFuncTest {
     resource = "yarn/proxy-mapreduce-task-attempt-counters";
     getYarnRmProxyData( encryptedQuery, path, resource, ContentType.JSON );
     getYarnRmProxyData( encryptedQuery, path, resource, ContentType.XML );
-
+    LOG_EXIT();
   }
 
   private void getYarnRmProxyData( String encryptedQuery, String path, String resource, ContentType contentType ) throws Exception {
@@ -2769,8 +2835,9 @@ public class GatewayBasicFuncTest {
     return file.toURI().toString();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testFalconAdmin() throws Exception {
+    LOG_ENTER();
     String resourceName = "falcon/version";
     String path = "/api/admin/version";
     testGetFalconResource(resourceName, path, ContentType.XML);
@@ -2817,10 +2884,12 @@ public class GatewayBasicFuncTest {
 
     Assert.assertEquals(response.getBody().asString(), driver.getResourceString( resourceName, UTF8 ) );
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testFalconEntities() throws Exception {
+    LOG_ENTER();
     String resourceName = "falcon/entity-status-process";
     String path = "/api/entities/status/process/cleanseEmailProcess";
     testGetFalconResource(resourceName, path, ContentType.XML);
@@ -2870,11 +2939,12 @@ public class GatewayBasicFuncTest {
     responseResource = "falcon/entity-resume-feed.xml";
     path = "/api/entities/resume/feed/rawEmailFeed";
     testPostFalconResource(postResource, responseResource, path, ContentType.XML);
-
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testFalconFeedAndProcess() throws Exception {
+    LOG_ENTER();
     String resourceName = "falcon/instance-running-process";
     String path = "/api/instance/running/process/cleanseEmailProcess";
     testGetFalconResource(resourceName, path, ContentType.JSON);
@@ -2886,10 +2956,12 @@ public class GatewayBasicFuncTest {
     resourceName = "falcon/instance-status-process";
     path = "/api/instance/status/process/cleanseEmailProcess";
     testGetFalconResource(resourceName, path, ContentType.JSON);
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testFalconMetadataLineage() throws Exception {
+    LOG_ENTER();
     String resourceName = "falcon/metadata-lineage-vertices-all";
     String path = "/api/metadata/lineage/vertices/all";
     testGetFalconResource(resourceName, path, ContentType.JSON);
@@ -2938,10 +3010,12 @@ public class GatewayBasicFuncTest {
     MatcherAssert.assertThat(response.getBody().asString(),
         sameJSONAs(driver.getResourceString(resourceName, UTF8)));
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testFalconMetadataDiscovery() throws Exception {
+    LOG_ENTER();
     String resourceName = "falcon/metadata-disc-process-entity";
     String path = "/api/metadata/discovery/process_entity/list";
     testGetFalconResource(resourceName, path, ContentType.JSON);
@@ -2953,6 +3027,7 @@ public class GatewayBasicFuncTest {
     resourceName = "falcon/metadata-disc-cluster-relations";
     path = "/api/metadata/discovery/cluster_entity/primaryCluster/relations";
     testGetFalconResource(resourceName, path, ContentType.JSON);
+    LOG_EXIT();
   }
 
   private void testGetFalconResource(String resourceName, String path, ContentType contentType) throws IOException {
@@ -3074,8 +3149,9 @@ public class GatewayBasicFuncTest {
     driver.assertComplete();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testStormUiApi() throws Exception {
+    LOG_ENTER();
     String resourceName = "storm/cluster-configuration.json";
     String path = "/api/v1/cluster/configuration";
     testGetStormResource(resourceName, path);
@@ -3173,6 +3249,7 @@ public class GatewayBasicFuncTest {
     path = "/api/v1/topology/WordCount-1-1424792039/kill/20";
     testPostStormResource(path);
 
+    LOG_EXIT();
   }
 
   private void testGetStormResource(String resourceName, String path) throws IOException {
@@ -3233,8 +3310,9 @@ public class GatewayBasicFuncTest {
   }
 
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testXForwardHeadersPopulate() throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
 
@@ -3279,12 +3357,13 @@ public class GatewayBasicFuncTest {
         startsWith("http://" + gatewayAddrName + ":" + gatewayPort + "/")));
     MatcherAssert.assertThat( link, containsString("/storm/logviewer") );
     driver.assertComplete();
-
+    LOG_EXIT();
   }
 
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testXForwardHeadersRewrite() throws Exception {
+    LOG_ENTER();
     String username = "hdfs";
     String password = "hdfs-password";
     String host = "whatsinaname";
@@ -3419,10 +3498,12 @@ public class GatewayBasicFuncTest {
     }
     MatcherAssert.assertThat(location, not(containsString("host=")));
     MatcherAssert.assertThat(location, not(containsString("port=")));
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testServiceTestAPI() throws Exception {
+    LOG_ENTER();
 
     String user = "kminder";
     String password = "kminder-password";
@@ -3519,10 +3600,12 @@ public class GatewayBasicFuncTest {
         .get(testUrl + "?username=mapred&password=mapred-password");
 //        .prettyPrint();
     driver.assertComplete();
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testCLIServiceTest() throws Exception {
+    LOG_ENTER();
 
     setupResources();
     //    Now let's make sure we can run this same command from the CLI.
@@ -3582,6 +3665,7 @@ public class GatewayBasicFuncTest {
 
 //    Reset the out content
     System.setOut(out);
+    LOG_EXIT();
   }
 
 

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 7a907c7..c944796 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
@@ -52,6 +52,8 @@ import java.util.UUID;
 import java.util.regex.Pattern;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
@@ -60,6 +62,9 @@ import static org.junit.Assert.assertThat;
 
 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 );
 
@@ -74,15 +79,19 @@ public class GatewayDeployFuncTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     //appenders = NoOpAppender.setUp();
     setupLdap();
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     ldap.stop( true );
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static void setupLdap() throws Exception {
@@ -202,8 +211,9 @@ public class GatewayDeployFuncTest {
     System.in.read();
   }
 
-  @Test( timeout = 30*1000 )
+  @Test( timeout = LONG_TIMEOUT )
   public void testDeployRedeployUndeploy() throws InterruptedException, IOException {
+    LOG_ENTER();
     long sleep = 200;
     int numFilesInWar = 5;
     String username = "guest";
@@ -281,6 +291,7 @@ public class GatewayDeployFuncTest {
     // Make sure deployment directory is empty.
     assertThat( topoDir.listFiles().length, is( 0 ) );
     assertThat( deployDir.listFiles().length, is( 0 ) );
+    LOG_EXIT();
   }
 
   private void waitForElapsed( long from, long total, long sleep ) throws InterruptedException {

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 6d7302a..75d926c 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
@@ -18,6 +18,8 @@
 package org.apache.hadoop.gateway;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.junit.Assert.assertThat;
@@ -65,6 +67,9 @@ import com.mycila.xmltool.XMLTag;
  */
 public class GatewayLdapDynamicGroupFuncTest {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+  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 );
 
@@ -78,17 +83,21 @@ public class GatewayLdapDynamicGroupFuncTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     //appenders = NoOpAppender.setUp();
     int port = setupLdap();
     setupGateway(port);
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     gateway.stop();
     ldap.stop( true );
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static int setupLdap() throws Exception {
@@ -287,14 +296,14 @@ public class GatewayLdapDynamicGroupFuncTest {
     return RESOURCE_BASE_CLASS.getName().replaceAll( "\\.", "/" ) + "/";
   }
 
-  @Ignore
   // @Test
   public void waitForManualTesting() throws IOException {
     System.in.read();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testGroupMember() throws ClassNotFoundException, Exception {
+    LOG_ENTER();
     String username = "bob";
     String password = "bob-password";
     String serviceUrl =  clusterUrl + "/test-service-path/test-service-resource";
@@ -307,10 +316,12 @@ public class GatewayLdapDynamicGroupFuncTest {
         .contentType( "text/plain" )
         .body( is( "test-service-response" ) )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
-  
-  @Test
+
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testNonGroupMember() throws ClassNotFoundException {
+    LOG_ENTER();
     String username = "guest";
     String password = "guest-password";
     String serviceUrl =  clusterUrl + "/test-service-path/test-service-resource";
@@ -321,6 +332,7 @@ public class GatewayLdapDynamicGroupFuncTest {
         //.log().all()
         .statusCode( HttpStatus.SC_FORBIDDEN )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
   
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 4446635..633a340 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
@@ -18,6 +18,8 @@
 package org.apache.hadoop.gateway;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.junit.Assert.assertThat;
@@ -65,6 +67,9 @@ import com.mycila.xmltool.XMLTag;
  */
 public class GatewayLdapGroupFuncTest {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+  private static final long MEDIUM_TIMEOUT = 5 * 1000L;
+
   private static Class RESOURCE_BASE_CLASS = GatewayLdapGroupFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewayLdapGroupFuncTest.class );
 
@@ -78,17 +83,21 @@ public class GatewayLdapGroupFuncTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     //appenders = NoOpAppender.setUp();
     int port = setupLdap();
     setupGateway(port);
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     gateway.stop();
     ldap.stop( true );
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static int setupLdap() throws Exception {
@@ -293,8 +302,9 @@ public class GatewayLdapGroupFuncTest {
     System.in.read();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testGroupMember() throws ClassNotFoundException, Exception {
+    LOG_ENTER();
     String username = "sam";
     String password = "sam-password";
     String serviceUrl =  clusterUrl + "/test-service-path/test-service-resource";
@@ -307,11 +317,12 @@ public class GatewayLdapGroupFuncTest {
         .contentType( "text/plain" )
         .body( is( "test-service-response" ) )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
-  
-  @Test
-  public void testNonGroupMember() throws ClassNotFoundException {
 
+  @Test( timeout = MEDIUM_TIMEOUT )
+  public void testNonGroupMember() throws ClassNotFoundException {
+    LOG_ENTER();
     String username = "guest";
     String password = "guest-password";
     String serviceUrl =  clusterUrl + "/test-service-path/test-service-resource";
@@ -322,6 +333,7 @@ public class GatewayLdapGroupFuncTest {
         //.log().all()
         .statusCode( HttpStatus.SC_FORBIDDEN )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 1cabeda..fa24b5f 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
@@ -48,12 +48,17 @@ import java.util.Map;
 import java.util.UUID;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.junit.Assert.assertThat;
 
 public class GatewayLocalServiceFuncTest {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+  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 );
 
@@ -67,18 +72,22 @@ public class GatewayLocalServiceFuncTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     appenders = NoOpAppender.setUp();
     setupLdap();
     setupGateway();
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     gateway.stop();
     ldap.stop( true );
     FileUtils.deleteQuietly( new File( config.getGatewayConfDir() ) );
     FileUtils.deleteQuietly( new File( config.getGatewayDataDir() ) );
     NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static void setupLdap() throws Exception {
@@ -165,8 +174,9 @@ public class GatewayLocalServiceFuncTest {
     return xml;
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testJerseyService() throws ClassNotFoundException {
+    LOG_ENTER();
     assertThat( ClassLoader.getSystemClassLoader().loadClass( "org.glassfish.jersey.servlet.ServletContainer" ), notNullValue() );
     assertThat( ClassLoader.getSystemClassLoader().loadClass( "org.apache.hadoop.gateway.jersey.JerseyDispatchDeploymentContributor" ), notNullValue() );
     assertThat( ClassLoader.getSystemClassLoader().loadClass( "org.apache.hadoop.gateway.jersey.JerseyServiceDeploymentContributorBase" ), notNullValue() );
@@ -184,6 +194,7 @@ public class GatewayLocalServiceFuncTest {
         .contentType( "text/plain" )
         .body( is( "test-jersey-resource-response" ) )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
 
   private static int findFreePort() throws IOException {

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 a12ce20..1ebf7fe 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
@@ -47,12 +47,16 @@ import java.util.Map;
 import java.util.UUID;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.junit.Assert.assertThat;
 
 public class GatewaySampleFuncTest {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+
   private static Class RESOURCE_BASE_CLASS = GatewaySampleFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( GatewaySampleFuncTest.class );
 
@@ -66,17 +70,21 @@ public class GatewaySampleFuncTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     //appenders = NoOpAppender.setUp();
     setupLdap();
     setupGateway();
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     gateway.stop();
     ldap.stop( true );
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static void setupLdap() throws Exception {
@@ -188,15 +196,14 @@ public class GatewaySampleFuncTest {
     return RESOURCE_BASE_CLASS.getName().replaceAll( "\\.", "/" ) + "/";
   }
 
-  @Ignore
-  @Test
+  //@Test
   public void waitForManualTesting() throws IOException {
     System.in.read();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testTestService() throws ClassNotFoundException {
-
+    LOG_ENTER();
     String username = "guest";
     String password = "guest-password";
     String serviceUrl =  clusterUrl + "/test-service-path/test-service-resource";
@@ -209,6 +216,7 @@ public class GatewaySampleFuncTest {
         .contentType( "text/plain" )
         .body( is( "test-service-response" ) )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 c881687..7fc0865 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
@@ -18,6 +18,8 @@
 package org.apache.hadoop.gateway;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.junit.Assert.assertThat;
@@ -66,6 +68,8 @@ import com.mycila.xmltool.XMLTag;
  */
 public class Knox242FuncTest {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+
   private static Class RESOURCE_BASE_CLASS = Knox242FuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( Knox242FuncTest.class );
 
@@ -79,17 +83,21 @@ public class Knox242FuncTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     //appenders = NoOpAppender.setUp();
     int port = setupLdap();
     setupGateway(port);
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     gateway.stop();
     ldap.stop( true );
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static int setupLdap() throws Exception {
@@ -286,8 +294,9 @@ public class Knox242FuncTest {
     System.in.read();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testGroupMember() throws ClassNotFoundException, Exception {
+    LOG_ENTER();
     String username = "joe";
     String password = "joe-password";
     String serviceUrl =  clusterUrl + "/test-service-path/test-service-resource";
@@ -300,10 +309,12 @@ public class Knox242FuncTest {
         .contentType( "text/plain" )
         .body( is( "test-service-response" ) )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
-  
-  @Test
+
+  @Test( timeout = SHORT_TIMEOUT )
   public void testNonGroupMember() throws ClassNotFoundException {
+    LOG_ENTER();
     String username = "guest";
     String password = "guest-password";
     String serviceUrl =  clusterUrl + "/test-service-path/test-service-resource";
@@ -314,6 +325,7 @@ public class Knox242FuncTest {
         //.log().all()
         .statusCode( HttpStatus.SC_FORBIDDEN )
         .when().get( serviceUrl );
+    LOG_EXIT();
   }
   
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 709d3d3..a79e613 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
@@ -45,12 +45,16 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
 
 public class KnoxCliLdapFuncTestNegative {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+
   private static Class RESOURCE_BASE_CLASS = KnoxCliLdapFuncTestPositive.class;
   private static Logger LOG = LoggerFactory.getLogger( KnoxCliLdapFuncTestPositive.class );
 
@@ -68,18 +72,22 @@ public class KnoxCliLdapFuncTestNegative {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     System.setOut(new PrintStream(outContent));
     System.setErr(new PrintStream(errContent));
     setupLdap();
     setupGateway();
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     ldap.stop( true );
 
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static void setupLdap( ) throws Exception {
@@ -272,8 +280,9 @@ public class KnoxCliLdapFuncTestNegative {
     return xml;
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testBadTopology() throws Exception {
+    LOG_ENTER();
 
     //    Test 4: Authenticate a user with a bad topology configured with nothing required for group lookup in the topology
     outContent.reset();
@@ -321,6 +330,7 @@ public class KnoxCliLdapFuncTestNegative {
     assertFalse(outContent.toString().contains("analyst"));
     assertFalse(outContent.toString().contains("scientist"));
 
+    LOG_EXIT();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 6ca727c..fb08531 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
@@ -45,12 +45,16 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.CoreMatchers.not;
 import static org.junit.Assert.assertThat;
 
 public class KnoxCliLdapFuncTestPositive {
 
+  private static final long SHORT_TIMEOUT = 1000L;
+
   private static Class RESOURCE_BASE_CLASS = KnoxCliLdapFuncTestPositive.class;
   private static Logger LOG = LoggerFactory.getLogger( KnoxCliLdapFuncTestPositive.class );
 
@@ -68,18 +72,22 @@ public class KnoxCliLdapFuncTestPositive {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     System.setOut(new PrintStream(outContent));
     System.setErr(new PrintStream(errContent));
     setupLdap();
     setupGateway();
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     ldap.stop( true );
 
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static void setupLdap( ) throws Exception {
@@ -262,8 +270,9 @@ public class KnoxCliLdapFuncTestPositive {
     return xml;
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testLDAPAuth() throws Exception {
+    LOG_ENTER();
 
 //    Test 1: Make sure authenication is successful and return groups
     outContent.reset();
@@ -324,6 +333,7 @@ public class KnoxCliLdapFuncTestPositive {
     assertThat(outContent.toString(), containsString("LDAP authentication success"));
     assertThat(outContent.toString(), not(containsString("does not belong to any groups")));
 
+    LOG_EXIT();
   }
 
 

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 80ccd34..3676fdc 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
@@ -45,13 +45,16 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.containsString;
 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 );
 
@@ -69,18 +72,22 @@ public class KnoxCliSysBindTest {
 
   @BeforeClass
   public static void setupSuite() throws Exception {
+    LOG_ENTER();
     System.setOut(new PrintStream(outContent));
     System.setErr(new PrintStream(errContent));
     setupLdap();
     setupGateway();
+    LOG_EXIT();
   }
 
   @AfterClass
   public static void cleanupSuite() throws Exception {
+    LOG_ENTER();
     ldap.stop( true );
 
     //FileUtils.deleteQuietly( new File( config.getGatewayHomeDir() ) );
     //NoOpAppender.tearDown( appenders );
+    LOG_EXIT();
   }
 
   public static void setupLdap( ) throws Exception {
@@ -269,8 +276,9 @@ public class KnoxCliSysBindTest {
     return xml;
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testLDAPAuth() throws Exception {
+    LOG_ENTER();
 
 //    Test 1: Make sure authentication is successful
     outContent.reset();
@@ -316,7 +324,7 @@ public class KnoxCliSysBindTest {
     cli.run(args5);
     assertThat(outContent.toString(), containsString("Topology not-a-cluster does not exist"));
 
-
+    LOG_EXIT();
   }
 
 

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 6b09c2a..c59824a 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
@@ -39,14 +39,19 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.InputStream;
 import java.io.Reader;
 
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.xml.HasXPath.hasXPath;
 
 public class OozieServiceDefinitionTest {
 
-  @Test
+  private static final long SHORT_TIMEOUT = 1000L;
+
+  @Test( timeout = SHORT_TIMEOUT )
   public void testOozieRewriteRulesForLiteralTemplateValuesBugKnox394() throws Exception {
+    LOG_ENTER();
 
     // This is a unique part of this test.
     String testResource = "oozie-request-with-var.xml";
@@ -93,10 +98,13 @@ public class OozieServiceDefinitionTest {
     assertThat( document,
         hasXPath( "/configuration/property[name='oozie.wf.application.path']/value",
             equalTo( "${appPath}/workflow.xml" ) ) );
+
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testOozieRewriteRulesForLiteralComplexTemplateValuesBugKnox394() throws Exception {
+    LOG_ENTER();
 
     // This is a unique part of this test.
     String testResource = "oozie-request-with-complex-var.xml";
@@ -143,10 +151,13 @@ public class OozieServiceDefinitionTest {
     assertThat( document,
         hasXPath( "/configuration/property[name='oozie.wf.application.path']/value",
             equalTo( "${nameNode}/user/${user.name}/${examplesRoot}/apps/hive" ) ) );
+
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testOozieRewriteRulesForValuesRelativeToServiceRegistry() throws Exception {
+    LOG_ENTER();
 
     // This is a unique part of this test.
     String testResource = "oozie-request-relative.xml";
@@ -193,6 +204,8 @@ public class OozieServiceDefinitionTest {
     assertThat( document,
         hasXPath( "/configuration/property[name='oozie.wf.application.path']/value",
             equalTo( "test-scheme://test-host:42/workflow.xml" ) ) );
+
+    LOG_EXIT();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/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 6c36bb9..8dd9396 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
@@ -35,11 +35,16 @@ import java.io.IOException;
 import java.net.ServerSocket;
 
 import static com.jayway.restassured.RestAssured.given;
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 
 @Category({FunctionalTests.class, MediumTests.class})
 public class WebHdfsHaFuncTest {
 
+   private static final long SHORT_TIMEOUT = 1000L;
+   private static final long MEDIUM_TIMEOUT = 5 * 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;
@@ -74,6 +79,7 @@ public class WebHdfsHaFuncTest {
     */
    @Before
    public void setup() throws Exception {
+      LOG_ENTER();
       Log.setLog(new NoOpLogger());
       masterServer = new MockServer("master", true);
       standbyServer = new MockServer("standby", true);
@@ -83,14 +89,17 @@ public class WebHdfsHaFuncTest {
       driver.setupLdap(findFreePort());
       driver.setupService("WEBHDFS", "http://vm.local:50070/webhdfs", "/cluster/webhdfs", USE_MOCK_SERVICES);
       driver.setupGateway(config, "cluster", createTopology(), USE_GATEWAY);
+      LOG_EXIT();
    }
 
    @After
    public void cleanup() throws Exception {
+      LOG_ENTER();
       driver.cleanup();
       driver.reset();
       masterServer.reset();
       standbyServer.reset();
+      LOG_EXIT();
    }
 
    /**
@@ -157,8 +166,9 @@ public class WebHdfsHaFuncTest {
       return xml;
    }
 
-   @Test
+  @Test( timeout = SHORT_TIMEOUT )
    public void testBasicListOperation() throws IOException {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       masterServer.expect()
@@ -180,11 +190,13 @@ public class WebHdfsHaFuncTest {
             .content("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       masterServer.isEmpty();
+      LOG_EXIT();
    }
 
-   @Test
+   @Test( timeout = SHORT_TIMEOUT )
    @Ignore( "KNOX-446" )
    public void testFailoverListOperation() throws Exception {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       //Shutdown master and expect standby to serve the list response
@@ -209,10 +221,12 @@ public class WebHdfsHaFuncTest {
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       standbyServer.isEmpty();
       masterServer.start();
+      LOG_EXIT();
    }
 
-   @Test
+   @Test( timeout = SHORT_TIMEOUT )
    public void testFailoverLimit() throws Exception {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       //Shutdown master and expect standby to serve the list response
@@ -228,12 +242,14 @@ public class WebHdfsHaFuncTest {
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       standbyServer.start();
       masterServer.start();
+      LOG_EXIT();
    }
 
 
-   @Test
+   @Test( timeout = SHORT_TIMEOUT )
    @Ignore( "KNOX-446" )
    public void testServerInStandby() throws IOException {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       //make master the server that is in standby
@@ -267,10 +283,12 @@ public class WebHdfsHaFuncTest {
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       masterServer.isEmpty();
       standbyServer.isEmpty();
+      LOG_EXIT();
    }
 
-   @Test
+   @Test( timeout = SHORT_TIMEOUT )
    public void testServerInStandbyFailoverLimit() throws IOException {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       //make master the server that is in standby
@@ -320,10 +338,12 @@ public class WebHdfsHaFuncTest {
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       masterServer.isEmpty();
       standbyServer.isEmpty();
+      LOG_EXIT();
    }
 
-   @Test
+   @Test( timeout = SHORT_TIMEOUT )
    public void testServerInSafeMode() throws IOException {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       //master is in safe mode
@@ -358,10 +378,12 @@ public class WebHdfsHaFuncTest {
             .content("boolean", is(true))
             .when().post(driver.getUrl("WEBHDFS") + "/v1/user/hdfs/foo.txt");
       masterServer.isEmpty();
+      LOG_EXIT();
    }
 
-   @Test
+   @Test( timeout = SHORT_TIMEOUT )
    public void testServerInSafeModeRetriableException() throws IOException {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       //master is in safe mode
@@ -393,10 +415,12 @@ public class WebHdfsHaFuncTest {
             .content("boolean", is(true))
             .when().post(driver.getUrl("WEBHDFS") + "/v1/user/hdfs/new");
       masterServer.isEmpty();
+      LOG_EXIT();
    }
 
-   @Test
+   @Test( timeout = MEDIUM_TIMEOUT )
    public void testServerInSafeModeRetryLimit() throws IOException {
+      LOG_ENTER();
       String username = "hdfs";
       String password = "hdfs-password";
       //master is in safe mode
@@ -450,5 +474,6 @@ public class WebHdfsHaFuncTest {
             .statusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR)
             .when().post(driver.getUrl("WEBHDFS") + "/v1/user/hdfs/foo.txt");
       masterServer.isEmpty();
+      LOG_EXIT();
    }
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
index 2d60d03..b7d6dba 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
@@ -58,6 +58,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
 
+import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
+import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
@@ -68,8 +70,13 @@ import static org.junit.Assert.fail;
 
 public class DeploymentFactoryFuncTest {
 
-  @Test
+  private static final long SHORT_TIMEOUT = 1000L;
+  private static final long MEDIUM_TIMEOUT = 5 * 1000L;
+  private static final long LONG_TIMEOUT = 15 * 1000L;
+
+  @Test( timeout = SHORT_TIMEOUT )
   public void testGenericProviderDeploymentContributor() throws ParserConfigurationException, SAXException, IOException, TransformerException {
+    LOG_ENTER();
     GatewayConfig config = new GatewayTestConfig();
     File targetDir = new File( System.getProperty( "user.dir" ), "target" );
     File gatewayDir = new File( targetDir, "gateway-home-" + UUID.randomUUID() );
@@ -130,10 +137,12 @@ public class DeploymentFactoryFuncTest {
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/class", equalTo( "org.opensource.ExistingFilter" ) ) );
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/param[1]/name", equalTo( "test-param-name" ) ) );
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/param[1]/value", equalTo( "test-param-value" ) ) );
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = SHORT_TIMEOUT )
   public void testInvalidGenericProviderDeploymentContributor() throws ParserConfigurationException, SAXException, IOException, TransformerException {
+    LOG_ENTER();
     GatewayConfig config = new GatewayTestConfig();
     File targetDir = new File( System.getProperty( "user.dir" ), "target" );
     File gatewayDir = new File( targetDir, "gateway-home-" + UUID.randomUUID() );
@@ -185,10 +194,12 @@ public class DeploymentFactoryFuncTest {
     } finally {
       NoOpAppender.tearDown( appenders );
     }
+    LOG_EXIT();
   }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testSimpleTopology() throws IOException, SAXException, ParserConfigurationException, URISyntaxException {
+    LOG_ENTER();
     GatewayConfig config = new GatewayTestConfig();
     //Testing without x-forwarded headers filter
     ((GatewayTestConfig)config).setXForwardedEnabled(false);
@@ -302,11 +313,14 @@ public class DeploymentFactoryFuncTest {
     assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/role", equalTo( "dispatch" ) ) );
     assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/name", equalTo( "webhdfs" ) ) );
     assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/class", equalTo( "org.apache.hadoop.gateway.dispatch.GatewayDispatchFilter" ) ) );
+
+    LOG_EXIT();
   }
 
 
-   @Test
+   @Test( timeout = LONG_TIMEOUT )
    public void testWebXmlGeneration() throws IOException, SAXException, ParserConfigurationException, URISyntaxException {
+      LOG_ENTER();
       GatewayConfig config = new GatewayTestConfig();
       File targetDir = new File(System.getProperty("user.dir"), "target");
       File gatewayDir = new File(targetDir, "gateway-home-" + UUID.randomUUID());
@@ -360,9 +374,11 @@ public class DeploymentFactoryFuncTest {
       for (int i = 0; i < 100; i++) {
          createAndTestDeployment(config, topology);
       }
+      LOG_EXIT();
    }
 
    private void createAndTestDeployment(GatewayConfig config, Topology topology) throws IOException, SAXException, ParserConfigurationException {
+
       WebArchive war = DeploymentFactory.createDeployment(config, topology);
 //      File dir = new File( System.getProperty( "user.dir" ) );
 //      File file = war.as( ExplodedExporter.class ).exportExploded( dir, "test-cluster.war" );
@@ -379,8 +395,9 @@ public class DeploymentFactoryFuncTest {
       assertThat(web, hasXPath("/web-app/listener[4]/listener-class", equalTo("org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletContextListener")));
    }
 
-  @Test
+  @Test( timeout = MEDIUM_TIMEOUT )
   public void testDeploymentWithServiceParams() throws Exception {
+    LOG_ENTER();
     GatewayConfig config = new GatewayTestConfig();
     File targetDir = new File(System.getProperty("user.dir"), "target");
     File gatewayDir = new File(targetDir, "gateway-home-" + UUID.randomUUID());
@@ -465,6 +482,8 @@ public class DeploymentFactoryFuncTest {
     assertThat( value, is( "65" ) ) ;
 
     FileUtils.deleteQuietly( deployDir );
+
+    LOG_EXIT();
   }
 
   private Document parse( InputStream stream ) throws IOException, SAXException, ParserConfigurationException {

http://git-wip-us.apache.org/repos/asf/knox/blob/37b41663/gateway-test/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/resources/log4j.properties b/gateway-test/src/test/resources/log4j.properties
index 87501a9..37e9775 100644
--- a/gateway-test/src/test/resources/log4j.properties
+++ b/gateway-test/src/test/resources/log4j.properties
@@ -23,7 +23,7 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n
 
-#log4j.logger.org.apache.hadoop.gateway=DEBUG
+log4j.logger.org.apache.hadoop.gateway=INFO
 #log4j.logger.org.apache.directory=DEBUG
 
 #log4j.logger.org.eclipse.jetty=DEBUG


Mime
View raw message