cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: Adding a couple of JAX-RS tests
Date Mon, 24 Feb 2014 12:24:54 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 1bc073112 -> 880b8d9d1


Adding a couple of JAX-RS tests


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

Branch: refs/heads/master
Commit: 880b8d9d1d72aadaf98ce92f2c07bc0cab0a7c21
Parents: 1bc0731
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Mon Feb 24 12:24:19 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Mon Feb 24 12:24:19 2014 +0000

----------------------------------------------------------------------
 .../test/java/org/apache/cxf/systest/jaxrs/BookStore.java   | 6 ++++++
 .../apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java | 9 +++++++++
 .../cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java  | 8 ++++++++
 3 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/880b8d9d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
index f04c4f5..6988e58 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
@@ -142,6 +142,12 @@ public class BookStore {
     }
 
     @GET
+    @Path("/")
+    public Book getBookRoot() {
+        return new Book("root", 124L);
+    }
+    
+    @GET
     @Path("/bookarray")
     public String[] getBookStringArray() {
         return new String[]{"Good book"};

http://git-wip-us.apache.org/repos/asf/cxf/blob/880b8d9d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
index 4f510d6..8c9b9cb 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
@@ -95,6 +95,15 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase
{
     }
     
     @Test
+    public void testGetBookRoot() throws Exception {
+        String address = "http://localhost:" + PORT + "/bookstore/;JSESSIONID=xxx";
+        WebClient wc = WebClient.create(address);
+        Book book = wc.get(Book.class);
+        assertEquals(124L, book.getId());
+        assertEquals("root", book.getName());
+    }
+    
+    @Test
     public void testGetBookQueryDefault() throws Exception {
         String address = "http://localhost:" + PORT + "/bookstore/books/query/default";
         WebClient wc = WebClient.create(address);

http://git-wip-us.apache.org/repos/asf/cxf/blob/880b8d9d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
index dd2930d..63a9590 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
@@ -447,6 +447,14 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest
         getBook(endpointAddress, "resources/expected_get_book123json.txt"); 
     }
 
+    @Test
+    public void testGetDefaultBookJSessionID() throws Exception {
+        String endpointAddress =
+            "http://localhost:" + PORT + "/the/bookstore/;JSESSIONID=123"; 
+        getBook(endpointAddress, "resources/expected_get_book123json.txt"); 
+    }
+    
+    
     private void getBook(String endpointAddress, String resource) throws Exception {
         getBook(endpointAddress, resource, "application/json");
     }


Mime
View raw message