cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1533053 - in /cxf/branches/2.7.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
Date Thu, 17 Oct 2013 11:41:09 GMT
Author: sergeyb
Date: Thu Oct 17 11:41:09 2013
New Revision: 1533053

URL: http://svn.apache.org/r1533053
Log:
Merged revisions 1533052 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1533052 | sergeyb | 2013-10-17 12:32:21 +0100 (Thu, 17 Oct 2013) | 1 line
  
  Updating JAXRS20 test to check methods in client filters
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1533052

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java?rev=1533053&r1=1533052&r2=1533053&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
Thu Oct 17 11:41:09 2013
@@ -256,7 +256,7 @@ public class JAXRS20ClientServerBookTest
         WebClient wc = WebClient.create(endpointAddress,
                                         Collections.singletonList(new ReplaceBodyFilter()));
         WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000000L);
-        wc.accept("text/mistypedxml").type("text/xml");
+        wc.accept("text/mistypedxml").type("text/xml").header("THEMETHOD", "PUT");
         Book book = wc.put(new Book("book", 555L), Book.class);
         assertEquals(561L, book.getId());
     }
@@ -527,6 +527,19 @@ public class JAXRS20ClientServerBookTest
 
         @Override
         public void filter(ClientRequestContext rc) throws IOException {
+            String method = rc.getMethod();
+            String expectedMethod = null; 
+            if (rc.getAcceptableMediaTypes().contains(MediaType.valueOf("text/mistypedxml"))
+                && rc.getHeaders().getFirst("THEMETHOD") != null) {
+                expectedMethod = "PUT";
+            } else {
+                expectedMethod = "POST";
+            }
+            
+                
+            if (!expectedMethod.equals(method)) {
+                throw new RuntimeException();
+            }
             rc.setEntity(new Book("book", ((Book)rc.getEntity()).getId() + 5), null, null);
         }
 



Mime
View raw message