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-685] - Knox tests cleanup after Jetty 9 upgrade. More debug logging 2.
Date Wed, 09 Mar 2016 17:17:31 GMT
Repository: knox
Updated Branches:
  refs/heads/master 5bd464f52 -> 611c52fba


[KNOX-685] - Knox tests cleanup after Jetty 9 upgrade. More debug logging 2.


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

Branch: refs/heads/master
Commit: 611c52fba429136a2c9ecc201dc94339e559ba7e
Parents: 5bd464f
Author: Kevin Minder <kminder@apache.org>
Authored: Wed Mar 9 11:58:24 2016 -0500
Committer: Kevin Minder <kminder@apache.org>
Committed: Wed Mar 9 11:58:24 2016 -0500

----------------------------------------------------------------------
 .../api/UrlRewriteServletFilterTest.java        |  2 --
 .../src/test/resources/log4j.properties         | 38 ++++++++++++++++++++
 .../apache/hadoop/test/mock/MockServlet.java    |  2 ++
 3 files changed, 40 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/611c52fb/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilterTest.java
----------------------------------------------------------------------
diff --git a/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilterTest.java
b/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilterTest.java
index 6c61e93..a592e4e 100644
--- a/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilterTest.java
+++ b/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilterTest.java
@@ -78,8 +78,6 @@ public class UrlRewriteServletFilterTest {
   public void setUp( Map<String,String> initParams ) throws Exception {
     String descriptorUrl = getTestResource( "rewrite.xml" ).toExternalForm();
 
-    Log.setLog( new NoOpLogger() );
-
     server = new ServletTester();
     server.setContextPath( "/" );
     server.getContext().addEventListener( new UrlRewriteServletContextListener() );

http://git-wip-us.apache.org/repos/asf/knox/blob/611c52fb/gateway-provider-rewrite/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/gateway-provider-rewrite/src/test/resources/log4j.properties b/gateway-provider-rewrite/src/test/resources/log4j.properties
new file mode 100644
index 0000000..04cf553
--- /dev/null
+++ b/gateway-provider-rewrite/src/test/resources/log4j.properties
@@ -0,0 +1,38 @@
+##########################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##########################################################################
+
+log4j.rootLogger=ERROR, stdout
+
+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.http=TRACE
+#log4j.logger.org.apache.hadoop.gateway.http.request.body=OFF
+#log4j.logger.org.apache.hadoop.gateway.http.response.body=OFF
+
+log4j.logger.org.apache.directory=ERROR
+
+log4j.logger.org.eclipse.jetty=DEBUG
+#log4j.logger.org.apache.shiro=DEBUG
+#log4j.logger.org.apache.http=DEBUG
+#log4j.logger.org.apache.http.headers=DEBUG
+#log4j.logger.org.apache.http.wire=DEBUG
+#log4j.logger.org.apache.http.client=DEBUG
+

http://git-wip-us.apache.org/repos/asf/knox/blob/611c52fb/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 9453abb..d200b78 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
@@ -38,6 +38,7 @@ public class MockServlet extends HttpServlet {
 
   @Override
   protected void service( HttpServletRequest request, HttpServletResponse response ) throws
ServletException, IOException {
+    System.out.println( "MOCK-SERLVET-REQUEST: " + request.getMethod() + " " + request.getRequestURL()
+ "?" + request.getQueryString() );
     try {
       if( interactions.isEmpty() ) {
         fail( "Mock servlet " + name + " received a request but the expected interaction
queue is empty." );
@@ -45,6 +46,7 @@ public class MockServlet extends HttpServlet {
       MockInteraction interaction = interactions.remove();
       interaction.expect().match( request );
       interaction.respond().apply( response );
+      System.out.println( "MOCK-SERVLET-RESPONSE: " + response.getStatus() );
     } catch( AssertionError e ) {
       e.printStackTrace(); // I18N not required.
       throw new ServletException( e );


Mime
View raw message