sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1777434 - in /sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors: TestDescriptionInterceptor.java package-info.java
Date Thu, 05 Jan 2017 08:28:33 GMT
Author: chetanm
Date: Thu Jan  5 08:28:33 2017
New Revision: 1777434

URL: http://svn.apache.org/viewvc?rev=1777434&view=rev
Log:
SLING-6405 - Make testing.clients.interceptors.TestDescriptionInterceptor in line with TestLogServlet
from junit core

Modified:
    sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/TestDescriptionInterceptor.java
    sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/package-info.java

Modified: sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/TestDescriptionInterceptor.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/TestDescriptionInterceptor.java?rev=1777434&r1=1777433&r2=1777434&view=diff
==============================================================================
--- sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/TestDescriptionInterceptor.java
(original)
+++ sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/TestDescriptionInterceptor.java
Thu Jan  5 08:28:33 2017
@@ -32,11 +32,18 @@ import java.io.IOException;
  * @see org.slf4j.MDC http://www.slf4j.org/manual.html
  */
 public class TestDescriptionInterceptor implements HttpRequestInterceptor{
-    public static final String TEST_NAME_HEADER = "sling.test.name";
-    public static final String TEST_CLASS_HEADER = "sling.test.class";
+    //Same headers are defined in TestLogServlet
+    public static final String TEST_CLASS_HEADER = "X-Sling-TestClass";
+    public static final String TEST_NAME_HEADER = "X-Sling-TestName";
 
     public void process(HttpRequest httpRequest, HttpContext httpContext) throws HttpException,
IOException {
-            httpRequest.addHeader(TEST_NAME_HEADER, TestDescriptionHolder.getMethodName());
-            httpRequest.addHeader(TEST_CLASS_HEADER, TestDescriptionHolder.getClassName());
+        addHeader(httpRequest, TEST_NAME_HEADER, TestDescriptionHolder.getMethodName());
+        addHeader(httpRequest, TEST_CLASS_HEADER, TestDescriptionHolder.getClassName());
+    }
+
+    private static void addHeader(HttpRequest httpRequest, String name, String value){
+        if (value != null){
+            httpRequest.addHeader(name, value);
+        }
     }
 }

Modified: sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/package-info.java?rev=1777434&r1=1777433&r2=1777434&view=diff
==============================================================================
--- sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/package-info.java
(original)
+++ sling/trunk/testing/http/clients/src/main/java/org/apache/sling/testing/clients/interceptors/package-info.java
Thu Jan  5 08:28:33 2017
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("1.0.0")
+@Version("1.0.1")
 package org.apache.sling.testing.clients.interceptors;
 
 import aQute.bnd.annotation.Version;



Mime
View raw message