cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r967167 - in /cxf/branches/servlet3jetty7: rt/transports/http/src/main/java/org/apache/cxf/transport/http/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Fri, 23 Jul 2010 17:17:24 GMT
Author: dkulp
Date: Fri Jul 23 17:17:23 2010
New Revision: 967167

URL: http://svn.apache.org/viewvc?rev=967167&view=rev
Log:
Fix flushing of buffers and such to not always use chunking on
responses.  Fix jaxrs tests

Modified:
    cxf/branches/servlet3jetty7/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
    cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
    cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java

Modified: cxf/branches/servlet3jetty7/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=967167&r1=967166&r2=967167&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
(original)
+++ cxf/branches/servlet3jetty7/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
Fri Jul 23 17:17:23 2010
@@ -503,6 +503,9 @@ public abstract class AbstractHTTPDestin
     }
     
     protected OutputStream flushHeaders(Message outMessage) throws IOException {
+        return flushHeaders(outMessage, true);
+    }
+    protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException
{
         if (isResponseRedirected(outMessage)) {
             return null;
         }
@@ -540,6 +543,8 @@ public abstract class AbstractHTTPDestin
                 response.setContentLength(0);
                 response.flushBuffer();
                 response.getOutputStream().close();
+            } else if (!getStream) {
+                response.getOutputStream().close();
             } else {
                 responseStream = response.getOutputStream();                
             }
@@ -647,13 +652,12 @@ public abstract class AbstractHTTPDestin
          */
         public void close() throws IOException {
             if (wrappedStream == null) {
-                OutputStream responseStream = flushHeaders(outMessage);
+                OutputStream responseStream = flushHeaders(outMessage, false);
                 if (null != responseStream) {
                     wrappedStream = responseStream;
                 }
             }
             if (wrappedStream != null) {
-                wrappedStream.flush();
                 wrappedStream.close();
                 response.flushBuffer();
             }

Modified: cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=967167&r1=967166&r2=967167&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(original)
+++ cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Fri Jul 23 17:17:23 2010
@@ -538,7 +538,7 @@ public class BookStore {
     @Produces("application/xml")
     @Consumes("text/xml")
     public Book addBookCustomFailure(Book book, @Context HttpServletResponse response) {
-        response.setStatus(333);
+        response.setStatus(233);
         response.addHeader("CustomHeader", "CustomValue");
         book.setId(888);
         return book;

Modified: cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=967167&r1=967166&r2=967167&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Fri Jul 23 17:17:23 2010
@@ -57,7 +57,7 @@ public class JAXRSClientServerBookTest e
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                   launchServer(BookServer.class, true));
+                   launchServer(BookServer.class, false));
     }
     
     
@@ -741,7 +741,7 @@ public class JAXRSClientServerBookTest e
         assertEquals(888L, book.getId());
         Response r = client.getResponse();
         assertEquals("CustomValue", r.getMetadata().getFirst("CustomHeader"));
-        assertEquals(333, r.getStatus());
+        assertEquals(233, r.getStatus());
         assertEquals("application/xml", r.getMetadata().getFirst("Content-Type"));
     }
     

Modified: cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=967167&r1=967166&r2=967167&view=diff
==============================================================================
--- cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
(original)
+++ cxf/branches/servlet3jetty7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
Fri Jul 23 17:17:23 2010
@@ -74,7 +74,7 @@ public class JAXRSSoapBookTest extends A
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
-                   launchServer(BookServerRestSoap.class));
+                   launchServer(BookServerRestSoap.class, true));
     }
     
     @Test



Mime
View raw message