cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [26/33] cxf git commit: [CXF-6929] Adding more tests
Date Sun, 05 Jun 2016 17:02:54 GMT
[CXF-6929] Adding more tests


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e0742cf0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e0742cf0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e0742cf0

Branch: refs/heads/master-jaxrs-2.1
Commit: e0742cf0839eb38cad2cc35555c9d2913087b8df
Parents: 514f3cc
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Jun 3 15:55:25 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Jun 3 15:55:25 2016 +0100

----------------------------------------------------------------------
 .../jaxrs/AbstractJAXRSContinuationsTest.java     | 18 ++++++++++++++++++
 .../cxf/systest/jaxrs/BookContinuationStore.java  | 14 ++++++++++++++
 2 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e0742cf0/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
index f2c152b..69ae0d7 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
@@ -98,6 +98,24 @@ public abstract class AbstractJAXRSContinuationsTest extends AbstractBusClientSe
     }
     
     @Test
+    public void testGetBookNotFoundUnmappedImmediate() throws Exception {
+        WebClient wc = 
+            WebClient.create("http://localhost:" + getPort() + getBaseAddress() + "/books/notfound/unmappedImmediate");
+        wc.accept("text/plain");
+        Response r = wc.get();
+        assertEquals(500, r.getStatus());
+    }
+    
+    @Test
+    public void testGetBookMappedImmediate() throws Exception {
+        WebClient wc = 
+            WebClient.create("http://localhost:" + getPort() + getBaseAddress() + "/books/mappedImmediate");
+        wc.accept("text/plain");
+        Response r = wc.get();
+        assertEquals(401, r.getStatus());
+    }
+    
+    @Test
     public void testTimeoutAndCancel() throws Exception {
         doTestTimeoutAndCancel(getBaseAddress());
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/e0742cf0/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
index 04c5c30..bdcdd1b 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
@@ -33,6 +33,7 @@ import javax.ws.rs.NotFoundException;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.container.AsyncResponse;
 import javax.ws.rs.container.CompletionCallback;
 import javax.ws.rs.container.ConnectionCallback;
@@ -137,6 +138,19 @@ public class BookContinuationStore {
     }
     
     @GET
+    @Path("books/notfound/unmappedImmediate")
+    @Produces("text/plain")
+    public void handleUnmappedImmediate(@Suspended AsyncResponse response) throws BookNotFoundFault
{
+        throw new BookNotFoundFault("");
+    }
+    @GET
+    @Path("books/mappedImmediate")
+    @Produces("text/plain")
+    public void handleMappedImmediate(@Suspended AsyncResponse response) throws BookNotFoundFault
{
+        throw new WebApplicationException(Response.status(401).build());
+    }
+    
+    @GET
     @Path("books/unmappedFromFilter")
     @Produces("text/plain")
     public void handleContinuationRequestUnmappedFromFilter(@Suspended AsyncResponse response)
{


Mime
View raw message