knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject git commit: Improve diagnosability of mock service test framework
Date Wed, 27 Nov 2013 19:22:09 GMT
Updated Branches:
  refs/heads/master 03853f968 -> 6fac4afab


Improve diagnosability of mock service test framework


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

Branch: refs/heads/master
Commit: 6fac4afab1bcd92cfea3bae2a077b49a5fcebfd7
Parents: 03853f9
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Wed Nov 27 14:22:03 2013 -0500
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Wed Nov 27 14:22:03 2013 -0500

----------------------------------------------------------------------
 gateway-release/pom.xml                         |  4 +++
 gateway-test-utils/pom.xml                      |  7 ++++
 .../hadoop/test/mock/MockRequestMatcher.java    | 31 +++++++++++------
 .../apache/hadoop/test/mock/MockServlet.java    |  7 ++--
 .../hadoop/gateway/GatewayBasicFuncTest.java    | 36 ++++++++++++--------
 .../hadoop/gateway/GatewayFuncTestDriver.java   | 36 ++++++++++----------
 6 files changed, 75 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/6fac4afa/gateway-release/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-release/pom.xml b/gateway-release/pom.xml
index 982be2b..f165c00 100644
--- a/gateway-release/pom.xml
+++ b/gateway-release/pom.xml
@@ -171,6 +171,10 @@
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
+            <artifactId>gateway-provider-security-webappsec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${gateway-group}</groupId>
             <artifactId>gateway-provider-identity-assertion-pseudo</artifactId>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/6fac4afa/gateway-test-utils/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-test-utils/pom.xml b/gateway-test-utils/pom.xml
index 6def425..785301a 100644
--- a/gateway-test-utils/pom.xml
+++ b/gateway-test-utils/pom.xml
@@ -110,8 +110,15 @@
         </dependency>
 
         <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
         </dependency>
 
     </dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/6fac4afa/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
----------------------------------------------------------------------
diff --git a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
index b50cc7f..3b16770 100644
--- a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
+++ b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
@@ -19,7 +19,6 @@ package org.apache.hadoop.test.mock;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.ArrayUtils;
-import org.xmlmatchers.transform.StringSource;
 
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
@@ -47,6 +46,7 @@ public class MockRequestMatcher {
 
   private static final Charset UTF8 = Charset.forName( "UTF-8" );
 
+  private String from;
   private MockResponseProvider response;
   private Set<String> methods = null;
   private String pathInfo = null;
@@ -69,6 +69,11 @@ public class MockRequestMatcher {
     return response;
   }
 
+  public MockRequestMatcher from( String from ) {
+    this.from = from;
+    return this;
+  }
+
   public MockRequestMatcher method( String... methods ) {
     if( this.methods == null ) {
       this.methods = new HashSet<String>();
@@ -182,26 +187,26 @@ public class MockRequestMatcher {
     if( methods != null ) {
       assertThat(
           "Request " + request.getMethod() + " " + request.getRequestURL() +
-              " is not using one of the required HTTP methods",
+              " is not using one of the expected HTTP methods",
           methods, hasItem( request.getMethod() ) );
     }
     if( pathInfo != null ) {
       assertThat(
           "Request " + request.getMethod() + " " + request.getRequestURL() +
-              " does not have the required pathInfo",
+              " does not have the expected pathInfo",
           request.getPathInfo(), is( pathInfo ) );
     }
     if( requestURL != null ) {
       assertThat( 
           "Request " + request.getMethod() + " " + request.getRequestURL() +
-              " does not have the required requestURL",
+              " does not have the expected requestURL",
           request.getRequestURL().toString(), is( requestURL ) );
     }
     if( headers != null ) {
       for( String name: headers.keySet() ) {
         assertThat(
             "Request " + request.getMethod() + " " + request.getRequestURL() +
-                " does not have the required value for header " + name,
+                " does not have the expected value for header " + name,
             request.getHeader( name ), is( headers.get( name ) ) );
       }
     }
@@ -210,7 +215,7 @@ public class MockRequestMatcher {
       for( Cookie cookie: cookies ) {
         assertThat(
             "Request " + request.getMethod() + " " + request.getRequestURL() +
-                " does not have the required cookie " + cookie,
+                " does not have the expected cookie " + cookie,
             requestCookies, hasItem( cookie ) );
       }
     }
@@ -218,19 +223,19 @@ public class MockRequestMatcher {
       String[] requestContentType = request.getContentType().split(";",2);
       assertThat(
           "Request " + request.getMethod() + " " + request.getRequestURL() +
-              " does not have the required content type",
+              " does not have the expected content type",
           requestContentType[ 0 ], is( contentType ) );
     }
     if( characterEncoding != null ) {
       assertThat(
           "Request " + request.getMethod() + " " + request.getRequestURL() +
-              " does not have the required character encoding",
+              " does not have the expected character encoding",
           request.getCharacterEncoding(), equalToIgnoringCase( characterEncoding ) );
     }
     if( contentLength != null ) {
       assertThat(
           "Request " + request.getMethod() + " " + request.getRequestURL() +
-              " does not have the required content length",
+              " does not have the expected content length",
           request.getContentLength(), is( contentLength ) );
     }
     if( attributes != null ) {
@@ -299,19 +304,23 @@ public class MockRequestMatcher {
         byte[] bytes = IOUtils.toByteArray( request.getInputStream() );
         assertThat(
             "Request " + request.getMethod() + " " + request.getRequestURL() +
-                " content does not match the required content",
+                " content does not match the expected content",
             bytes, is( entity ) );
       } else {
         String expect = new String( entity, characterEncoding );
         String actual = IOUtils.toString( request.getInputStream(), request.getCharacterEncoding()
);
         assertThat(
             "Request " + request.getMethod() + " " + request.getRequestURL() +
-                " content does not match the required content",
+                " content does not match the expected content",
             actual, is( expect ) );
       }
     }
   }
 
+  public String toString() {
+    return "from=" + from + ", pathInfo=" + pathInfo;
+  }
+
   // Separate method to minimally scope the depreciation suppression.
   @SuppressWarnings("deprecation")
   private static Map<String,String[]> parseQueryString( String queryString ) {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/6fac4afa/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockServlet.java
----------------------------------------------------------------------
diff --git a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockServlet.java
b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockServlet.java
index a069e77..9453abb 100644
--- a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockServlet.java
+++ b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockServlet.java
@@ -24,8 +24,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.Queue;
 
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.fail;
 
 public class MockServlet extends HttpServlet {
 
@@ -40,7 +39,9 @@ public class MockServlet extends HttpServlet {
   @Override
   protected void service( HttpServletRequest request, HttpServletResponse response ) throws
ServletException, IOException {
     try {
-      assertThat( "Mock servlet " + name + " has no available interactions.", interactions.isEmpty(),
is( false ) );
+      if( interactions.isEmpty() ) {
+        fail( "Mock servlet " + name + " received a request but the expected interaction
queue is empty." );
+      }
       MockInteraction interaction = interactions.remove();
       interaction.expect().match( request );
       interaction.respond().apply( response );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/6fac4afa/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 973e8ff..130e479 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
@@ -217,7 +217,7 @@ public class GatewayBasicFuncTest {
 
   @Test
   public void testBasicJsonUseCase() throws IOException {
-    String root = "/tmp/GatewayWebHdfsFuncTest/testBasicJsonUseCase";
+    String root = "/tmp/GatewayBasicFuncTest/testBasicJsonUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
     /* Create a directory.
@@ -256,7 +256,7 @@ public class GatewayBasicFuncTest {
 
   @Test
   public void testBasicOutboundHeaderUseCase() throws IOException {
-    String root = "/tmp/GatewayWebHdfsFuncTest/testBasicOutboundHeaderUseCase";
+    String root = "/tmp/GatewayBasicFuncTest/testBasicOutboundHeaderUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
     InetSocketAddress gatewayAddress = driver.gateway.getAddresses()[0];
@@ -293,7 +293,7 @@ public class GatewayBasicFuncTest {
 
   @Test
   public void testHdfsTildeUseCase() throws IOException {
-    String root = "/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase";
+    String root = "/tmp/GatewayBasicFuncTest/testHdfsTildeUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
     InetSocketAddress gatewayAddress = driver.gateway.getAddresses()[0];
@@ -304,6 +304,7 @@ public class GatewayBasicFuncTest {
     driver.getMock( "WEBHDFS" )
         .expect()
         .method( "DELETE" )
+        .from( "testHdfsTildeUseCase" )
         .pathInfo( "/v1/user/hdfs" + root )
         .queryParam( "op", "DELETE" )
         .queryParam( "user.name", username )
@@ -348,7 +349,7 @@ public class GatewayBasicFuncTest {
 
   @Test
   public void testBasicHdfsUseCase() throws IOException {
-    String root = "/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase";
+    String root = "/tmp/GatewayBasicFuncTest/testBasicHdfsUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
     InetSocketAddress gatewayAddress = driver.gateway.getAddresses()[0];
@@ -359,6 +360,7 @@ public class GatewayBasicFuncTest {
     driver.getMock( "WEBHDFS" )
         .expect()
         .method( "DELETE" )
+        .from( "testBasicHdfsUseCase-1" )
         .pathInfo( "/v1" + root )
         .queryParam( "op", "DELETE" )
         .queryParam( "user.name", username )
@@ -366,12 +368,13 @@ public class GatewayBasicFuncTest {
         .respond()
         .status( HttpStatus.SC_OK );
     given()
+        //.log().all()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
         .queryParam( "op", "DELETE" )
         .queryParam( "recursive", "true" )
         .expect()
-        //.log().all();
+        .log().all()
         .statusCode( HttpStatus.SC_OK )
         .when().delete( driver.getUrl( "WEBHDFS" ) + "/v1" + root + ( driver.isUseGateway()
? "" : "?user.name=" + username ) );
     driver.assertComplete();
@@ -601,6 +604,7 @@ public class GatewayBasicFuncTest {
     // Mock the interaction with the namenode.
     driver.getMock( "WEBHDFS" )
         .expect()
+        .from( "testBasicHdfsUseCase-1" )
         .method( "DELETE" )
         .pathInfo( "/v1" + root )
         .queryParam( "op", "DELETE" )
@@ -625,7 +629,7 @@ public class GatewayBasicFuncTest {
   // User hcat in group hcat
   @Test
   public void testPmHdfsM1UseCase() throws IOException {
-    String root = "/tmp/GatewayWebHdfsFuncTest/testPmHdfdM1UseCase";
+    String root = "/tmp/GatewayBasicFuncTest/testPmHdfdM1UseCase";
     String userA = "hdfs";
     String passA = "hdfs-password";
     String userB = "mapred";
@@ -734,7 +738,7 @@ public class GatewayBasicFuncTest {
 
   @Test
   public void testJavaMapReduceViaWebHCat() throws IOException {
-    String root = "/tmp/GatewayWebHdfsFuncTest/testJavaMapReduceViaWebHCat";
+    String root = "/tmp/GatewayBasicFuncTest/testJavaMapReduceViaWebHCat";
     String user = "mapred";
     String pass = "mapred-password";
     String group = "mapred";
@@ -831,7 +835,7 @@ public class GatewayBasicFuncTest {
     driver.createFile( user, pass, null, root + "/script.hive", "777", "text/plain", "script.hive",
307, 201, 200 );
 
     // Submit the job
-    driver.submitHive( user, pass, group, root+"/script.hive", root+"/output", 200 );
+    driver.submitHive( user, pass, group, root + "/script.hive", root + "/output", 200 );
 
     // Check job status (if possible)
     // Check output (if possible)
@@ -1435,7 +1439,7 @@ public class GatewayBasicFuncTest {
     .status( HttpStatus.SC_CREATED )
     .content( driver.getResourceBytes( resourceName + ".json" ) )
     .contentType( ContentType.JSON.toString() )
-    .header( "Location", driver.getRealUrl( "WEBHBASE" ) + path  );
+    .header( "Location", driver.getRealUrl( "WEBHBASE" ) + path );
     
     given()
     .auth().preemptive().basic( username, password )
@@ -1455,11 +1459,11 @@ public class GatewayBasicFuncTest {
     .status( HttpStatus.SC_CREATED )
     .content( driver.getResourceBytes( resourceName + ".protobuf" ) )
     .contentType( "application/x-protobuf" )
-    .header( "Location", driver.getRealUrl( "WEBHBASE" ) + path  );
+    .header( "Location", driver.getRealUrl( "WEBHBASE" ) + path );
 
     given()
     .auth().preemptive().basic( username, password )
-    .header("X-XSRF-Header", "jksdhfkhdsf")
+    .header( "X-XSRF-Header", "jksdhfkhdsf" )
     .expect()
     .statusCode( HttpStatus.SC_CREATED )
     .contentType( "application/x-protobuf" )
@@ -1698,6 +1702,7 @@ public class GatewayBasicFuncTest {
     
     driver.getMock( "WEBHBASE" )
     .expect()
+    .from( "testHBaseDeleteDataFromTable-1" )
     .method( "DELETE" )
     .pathInfo( "/" + tableId + "/" + rowId )
     .respond()
@@ -1705,7 +1710,7 @@ public class GatewayBasicFuncTest {
 
     given()
     .auth().preemptive().basic( username, password )
-    .header("X-XSRF-Header", "jksdhfkhdsf")
+    .header( "X-XSRF-Header", "jksdhfkhdsf" )
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .when().delete( driver.getUrl( "WEBHBASE" ) + "/" + tableId + "/" + rowId );
@@ -1713,6 +1718,7 @@ public class GatewayBasicFuncTest {
     
     driver.getMock( "WEBHBASE" )
     .expect()
+    .from( "testHBaseDeleteDataFromTable-2" )
     .method( "DELETE" )
     .pathInfo( "/" + tableId + "/" + rowId + "/" + familyId )
     .respond()
@@ -1720,7 +1726,7 @@ public class GatewayBasicFuncTest {
 
     given()
     .auth().preemptive().basic( username, password )
-    .header("X-XSRF-Header", "jksdhfkhdsf")
+    .header( "X-XSRF-Header", "jksdhfkhdsf" )
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .when().delete( driver.getUrl( "WEBHBASE" ) + "/" + tableId + "/" + rowId + "/" + familyId
);
@@ -1728,6 +1734,7 @@ public class GatewayBasicFuncTest {
 
     driver.getMock( "WEBHBASE" )
     .expect()
+    .from( "testHBaseDeleteDataFromTable-3" )
     .method( "DELETE" )
     .pathInfo( "/" + tableId + "/" + rowId + "/" + familyId + ":" + columnId )
     .respond()
@@ -1735,7 +1742,7 @@ public class GatewayBasicFuncTest {
 
     given()
     .auth().preemptive().basic( username, password )
-    .header("X-XSRF-Header", "jksdhfkhdsf")
+    .header( "X-XSRF-Header", "jksdhfkhdsf" )
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .when().delete( driver.getUrl( "WEBHBASE" ) + "/" + tableId + "/" + rowId + "/" + familyId
+ ":" + columnId );
@@ -1912,6 +1919,7 @@ public class GatewayBasicFuncTest {
     //Delete scanner
     driver.getMock( "WEBHBASE" )
     .expect()
+    .from( "testHBaseUseScanner" )
     .method( "DELETE" )
     .pathInfo( scannerPath + "/" + scannerId )
     .respond()

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/6fac4afa/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
index 5e6006f..019f392 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
@@ -43,7 +43,6 @@ import org.apache.http.impl.client.BasicAuthCache;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.util.EntityUtils;
-import org.hamcrest.CoreMatchers;
 import org.hamcrest.MatcherAssert;
 import org.hamcrest.Matchers;
 import org.slf4j.Logger;
@@ -262,8 +261,9 @@ public class GatewayFuncTestDriver {
     // Otherwise just clear the mock interaction queue.
     for( Service service : services.values() ) {
       if( service.mock ) {
-        assertThat( "Service " + service.role + " has expected interactions.",
-            service.server.isEmpty(), CoreMatchers.is( true ) );
+        assertThat(
+            "Service " + service.role + " has remaining expected interactions.",
+            service.server.getCount(), is( 0 ) );
       }
       service.server.reset();
     }
@@ -300,7 +300,7 @@ public class GatewayFuncTestDriver {
         //.log().headers()
         //.log().parameters()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "CREATE" )
         .queryParam( "permission", permsOctal )
         .expect()
@@ -340,7 +340,7 @@ public class GatewayFuncTestDriver {
     Response response = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .contentType( contentType )
         .content( getResourceBytes( resource ) )
         .expect()
@@ -401,7 +401,7 @@ public class GatewayFuncTestDriver {
     Response response = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "OPEN" )
         .expect()
         //.log().all()
@@ -429,7 +429,7 @@ public class GatewayFuncTestDriver {
     given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "SETOWNER" )
         .queryParam( "owner", owner )
         .queryParam( "group", group )
@@ -453,7 +453,7 @@ public class GatewayFuncTestDriver {
     given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "SETPERMISSION" )
         .queryParam( "permission", permsOctal )
         .expect()
@@ -498,7 +498,7 @@ public class GatewayFuncTestDriver {
     Response response = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "CREATE" )
         .queryParam( "overwrite", "true" )
         .content( getResourceBytes( resource ) )
@@ -539,7 +539,7 @@ public class GatewayFuncTestDriver {
     Response response = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "CREATE" )
         .queryParam( "overwrite", "true" )
         .contentType( contentType )
@@ -562,7 +562,7 @@ public class GatewayFuncTestDriver {
     given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "DELETE" )
         .queryParam( "recursive", recursive )
         .expect()
@@ -588,7 +588,7 @@ public class GatewayFuncTestDriver {
     Response response = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "MKDIRS" )
         .queryParam( "permission", permsOctal )
         .expect()
@@ -639,7 +639,7 @@ public class GatewayFuncTestDriver {
     String json = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .formParam( "user.name", user )
         .formParam( "jar", jar )    //"/user/hdfs/test/hadoop-examples.jar" )
         .formParam( "class", main ) //"org.apache.org.apache.hadoop.examples.WordCount" )
@@ -667,7 +667,7 @@ public class GatewayFuncTestDriver {
     String json = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
 //BUG: The identity asserter needs to check for this too.
         .formParam( "user.name", user )
         .formParam( "group", group )
@@ -701,7 +701,7 @@ public class GatewayFuncTestDriver {
     String json = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .formParam( "user.name", user )
         .formParam( "group", group )
         .formParam( "group", group )
@@ -734,7 +734,7 @@ public class GatewayFuncTestDriver {
     String status = given()
         //.log().all()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .pathParam( "job", job )
         .expect()
         //.log().all()
@@ -756,7 +756,7 @@ public class GatewayFuncTestDriver {
   public void oozieGetVersions( String user, String password ) throws IOException {
     given()
         .auth().preemptive().basic( user, password )
-        .header("X-XSRF-Header", "jksdhfkhdsf")
+        .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .expect()
         .statusCode( 200 )
         .body( "", hasItems( 0, 1 ) )
@@ -858,7 +858,7 @@ TODO
 //    post.getParams().setParameter( "action", "start" );
     StringEntity entity = new StringEntity( request, ContentType.create( "application/xml",
"UTF-8" ) );
     post.setEntity( entity );
-    post.setHeader("X-XSRF-Header", "ksdjfhdsjkfhds");
+    post.setHeader( "X-XSRF-Header", "ksdjfhdsjkfhds" );
     HttpResponse response = client.execute( targetHost, post, localContext );
     assertThat( response.getStatusLine().getStatusCode(), is( status ) );
     String json = EntityUtils.toString( response.getEntity() );


Mime
View raw message