cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1438082 - /cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
Date Thu, 24 Jan 2013 17:19:46 GMT
Author: sergeyb
Date: Thu Jan 24 17:19:46 2013
New Revision: 1438082

URL: http://svn.apache.org/viewvc?rev=1438082&view=rev
Log:
Also updating the test

Modified:
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.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=1438082&r1=1438081&r2=1438082&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 Jan 24 17:19:46 2013
@@ -74,6 +74,7 @@ public class BookServer20 extends Abstra
         providers.add(new CustomReaderInterceptor());
         providers.add(new CustomWriterInterceptor());
         providers.add(new CustomDynamicFeature());
+        providers.add(new PostMatchContainerRequestFilter());
         sf.setProviders(providers);
         sf.setResourceProvider(BookStore.class,
                                new SingletonResourceProvider(new BookStore(), true));
@@ -128,11 +129,12 @@ public class BookServer20 extends Abstra
                 || !"true".equals(context.getProperty("DynamicPrematchingFilter"))) {
                 throw new RuntimeException();
             }
-            context.getHeaders().add("BOOK", "123");
+            context.getHeaders().add("BOOK", "12");
         }
         
     }
     
+        
     @PreMatching
     @BindingPriority(2)
     private static class PreMatchDynamicContainerRequestFilter implements ContainerRequestFilter
{
@@ -147,6 +149,19 @@ public class BookServer20 extends Abstra
         
     }
     
+    @CustomHeaderAdded
+    private static class PostMatchContainerRequestFilter implements ContainerRequestFilter
{
+
+        @Override
+        public void filter(ContainerRequestContext context) throws IOException {
+            String value = context.getHeaders().getFirst("Book");
+            if (value != null) {
+                context.getHeaders().addFirst("Book", value + "3");
+            }
+        }
+        
+    }
+    
     @BindingPriority(3)
     public static class PostMatchContainerResponseFilter implements ContainerResponseFilter
{
 



Mime
View raw message