cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1352848 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Fri, 22 Jun 2012 11:27:37 GMT
Author: sergeyb
Date: Fri Jun 22 11:27:36 2012
New Revision: 1352848

URL: http://svn.apache.org/viewvc?rev=1352848&view=rev
Log:
[CXF-4390] Removing disabled GET piped test given that a pipe gets activated via a write,
making client headers case-sensitive for a GZIP test to pass

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/LocalClientState.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=1352848&r1=1352847&r2=1352848&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
Fri Jun 22 11:27:36 2012
@@ -233,7 +233,7 @@ public abstract class AbstractClient imp
      * {@inheritDoc}
      */
     public MultivaluedMap<String, String> getHeaders() {
-        MultivaluedMap<String, String> map = new MetadataMap<String, String>();
+        MultivaluedMap<String, String> map = new MetadataMap<String, String>(false,
true);
         map.putAll(state.getRequestHeaders());
         return map;
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/LocalClientState.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/LocalClientState.java?rev=1352848&r1=1352847&r2=1352848&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/LocalClientState.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/LocalClientState.java
Fri Jun 22 11:27:36 2012
@@ -34,7 +34,7 @@ import org.apache.cxf.jaxrs.impl.Metadat
 public class LocalClientState implements ClientState {
     private static final String HTTP_SCHEME = "http";
     
-    private MultivaluedMap<String, String> requestHeaders = new MetadataMap<String,
String>();
+    private MultivaluedMap<String, String> requestHeaders = new MetadataMap<String,
String>(false, true);
     private MultivaluedMap<String, String> templates;
     private ResponseBuilder responseBuilder;
     private URI baseURI;

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java?rev=1352848&r1=1352847&r2=1352848&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
Fri Jun 22 11:27:36 2012
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.systest.jaxrs;
 
+import javax.ws.rs.core.Response;
+
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
@@ -30,7 +32,6 @@ import org.apache.cxf.transport.local.Lo
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSLocalTransportTest extends AbstractBusClientServerTestBase {
@@ -69,6 +70,17 @@ public class JAXRSLocalTransportTest ext
     }
     
     @Test
+    public void testProxyDirectDispatchPostWithGzip() throws Exception {
+        BookStore localProxy = 
+            JAXRSClientFactory.create("local://books", BookStore.class);
+        
+        WebClient.getConfig(localProxy).getRequestContext().put(LocalConduit.DIRECT_DISPATCH,
Boolean.TRUE);
+        
+        Response response = localProxy.addBook(new Book("New", 124L));
+        assertEquals(200, response.getStatus());
+    }
+    
+    @Test
     public void testProxyDirectDispatchPost() throws Exception {
         BookStoreSpring localProxy = 
             JAXRSClientFactory.create("local://books", BookStoreSpring.class);
@@ -80,16 +92,6 @@ public class JAXRSLocalTransportTest ext
     }
     
     @Test
-    @Ignore
-    public void testProxyPipedDispatchGet() throws Exception {
-        BookStore localProxy = 
-            JAXRSClientFactory.create("local://books", BookStore.class);
-        
-        Book response = localProxy.getBook("123");
-        assertEquals(123L, response.getId());
-    }
-    
-    @Test
     public void testProxyPipedDispatchPost() throws Exception {
         BookStoreSpring localProxy = 
             JAXRSClientFactory.create("local://books", BookStoreSpring.class);
@@ -99,7 +101,7 @@ public class JAXRSLocalTransportTest ext
     }
     
     @Test
-    public void testWebClient() throws Exception {
+    public void testWebClientDirectDispatch() throws Exception {
         WebClient localClient = WebClient.create("local://books");
         
         WebClient.getConfig(localClient).getRequestContext().put(LocalConduit.DIRECT_DISPATCH,
Boolean.TRUE);
@@ -109,6 +111,14 @@ public class JAXRSLocalTransportTest ext
     }
     
     @Test
+    public void testWebClientPipedDispatch() throws Exception {
+        WebClient localClient = WebClient.create("local://books");
+        localClient.path("bookstore/books");
+        Book book = localClient.post(new Book("New", 124L), Book.class);
+        assertEquals(124L, book.getId());
+    }
+    
+    @Test
     public void testProxyWithQuery() throws Exception {
         BookStore localProxy = 
             JAXRSClientFactory.create("local://books", BookStore.class);



Mime
View raw message