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:26:49 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes bfcd25d9e -> da0ad35bb


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

Branch: refs/heads/2.7.x-fixes
Commit: da0ad35bb224f1bf71643cfd7650568824b24acc
Parents: bfcd25d
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:26:09 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/da0ad35b/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 15a11a5..cd201c2 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
@@ -141,6 +141,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/da0ad35b/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 d83c431..1153fb7 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
@@ -93,6 +93,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/da0ad35b/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 257241e..9cf49a5 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
@@ -445,6 +445,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