cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6929] Adding more tests
Date Fri, 03 Jun 2016 14:56:43 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 1f692efcb -> c0ad4d310


[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/c0ad4d31
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c0ad4d31
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c0ad4d31

Branch: refs/heads/3.1.x-fixes
Commit: c0ad4d310af835fa5bd751979898068fd3258fc9
Parents: 1f692ef
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:56:19 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/c0ad4d31/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/c0ad4d31/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