cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1514269 - in /cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs: BookServer20.java JAXRS20ClientServerBookTest.java
Date Thu, 15 Aug 2013 13:39:11 GMT
Author: sergeyb
Date: Thu Aug 15 13:39:11 2013
New Revision: 1514269

URL: http://svn.apache.org/r1514269
Log:
[CXF-5201] Updating test WriterInterceptor to add more headers

Modified:
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java?rev=1514269&r1=1514268&r2=1514269&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
Thu Aug 15 13:39:11 2013
@@ -36,6 +36,7 @@ import java.util.Map;
 
 import javax.annotation.Priority;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.NameBinding;
 import javax.ws.rs.WebApplicationException;
@@ -396,9 +397,13 @@ public class BookServer20 extends Abstra
     
     public static class CustomWriterInterceptor implements WriterInterceptor {
 
+        @Context
+        private HttpServletResponse response;
         @Override
         public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException
{
             context.getHeaders().add("ServerWriterInterceptor", "serverWrite");
+            context.getHeaders().putSingle("ServerWriterInterceptor2", "serverWrite2");
+            response.addHeader("ServerWriterInterceptorHttpResponse", "serverWriteHttpResponse");
             String ct = context.getHeaders().getFirst("Content-Type").toString();
             if (!ct.endsWith("ISO-8859-1")) {
                 ct += "us-ascii";

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java?rev=1514269&r1=1514268&r2=1514269&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
Thu Aug 15 13:39:11 2013
@@ -187,6 +187,9 @@ public class JAXRS20ClientServerBookTest
         assertNull(response.getHeaderString("DynamicResponse"));
         assertNull(response.getHeaderString("Custom"));
         assertEquals("serverWrite", response.getHeaderString("ServerWriterInterceptor"));
+        assertEquals("serverWrite2", response.getHeaderString("ServerWriterInterceptor2"));
+        assertEquals("serverWriteHttpResponse", 
+                     response.getHeaderString("ServerWriterInterceptorHttpResponse"));
         assertEquals("text/plain;charset=us-ascii", response.getMediaType().toString());
     }
     



Mime
View raw message