cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1532892 - in /cxf/trunk: rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java
Date Wed, 16 Oct 2013 20:28:49 GMT
Author: sergeyb
Date: Wed Oct 16 20:28:49 2013
New Revision: 1532892

URL: http://svn.apache.org/r1532892
Log:
Adding more local transport tests

Modified:
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSLocalTransportTest.java

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?rev=1532892&r1=1532891&r2=1532892&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
(original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
Wed Oct 16 20:28:49 2013
@@ -24,6 +24,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
+import java.util.HashMap;
+import java.util.List;
 import java.util.concurrent.Executor;
 import java.util.logging.Logger;
 
@@ -92,6 +94,7 @@ public class LocalConduit extends Abstra
                         if (m != null) {
                             try {
                                 m.put(Message.RESPONSE_CODE, 500);
+                                m.put(Message.PROTOCOL_HEADERS, new HashMap<String, List<String>>());
                                 m.getExchange().put(Message.RESPONSE_CODE, 500);
                                 m.getContent(OutputStream.class).close();
                             } catch (IOException e) {

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=1532892&r1=1532891&r2=1532892&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
Wed Oct 16 20:28:49 2013
@@ -40,7 +40,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 {
@@ -59,6 +58,10 @@ public class JAXRSLocalTransportTest ext
         outInts.add(new CustomOutInterceptor());
         sf.setOutInterceptors(outInts);
         
+        List<Interceptor<? extends Message>> inInts = new ArrayList<Interceptor<?
extends Message>>();
+        inInts.add(new CustomInFaultyInterceptor());
+        sf.setInInterceptors(inInts);
+        
         sf.setTransportId(LocalTransportFactory.TRANSPORT_ID);
         sf.setAddress("local://books");
         localServer = sf.create();
@@ -80,10 +83,16 @@ public class JAXRSLocalTransportTest ext
     }
     
     @Test
-    @Ignore
-    public void testProxyServerInFault() throws Exception {
+    public void testProxyServerInFaultMapped() throws Exception {
         BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
         Response r = localProxy.infault();
+        assertEquals(401, r.getStatus());
+    }
+    
+    @Test
+    public void testProxyServerInFaultEscaped() throws Exception {
+        BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
+        Response r = localProxy.infault2();
         assertEquals(500, r.getStatus());
     }
     
@@ -92,7 +101,7 @@ public class JAXRSLocalTransportTest ext
         BookStore localProxy = JAXRSClientFactory.create("local://books", BookStore.class);
         WebClient.getConfig(localProxy).getRequestContext().put(LocalConduit.DIRECT_DISPATCH,
"true");
         WebClient.getConfig(localProxy).getInFaultInterceptors().add(new TestFaultInInterceptor());
-        Response r = localProxy.infault();
+        Response r = localProxy.infault2();
         assertEquals(500, r.getStatus());
     }
     



Mime
View raw message