cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5980] Adding a test
Date Mon, 01 Sep 2014 13:45:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/master d16fd1e70 -> 0983a2bb2


[CXF-5980] Adding a test


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

Branch: refs/heads/master
Commit: 0983a2bb2652d3d2f55e36230ccf5a6071b4e1f2
Parents: d16fd1e
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Mon Sep 1 14:45:17 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Mon Sep 1 14:45:17 2014 +0100

----------------------------------------------------------------------
 .../jaxrs/JAXRS20ClientServerBookTest.java      | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0983a2bb/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
index 4a593a2..01feee0 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
@@ -385,6 +385,35 @@ public class JAXRS20ClientServerBookTest extends AbstractBusClientServerTestBase
         assertEquals(200, wc.getResponse().getStatus());
     }
     
+    @Test
+    public void testPostGetCollectionGenericEntityAndType3() throws Exception {
+        
+        String endpointAddress =
+            "http://localhost:" + PORT + "/bookstore/collections"; 
+        WebClient wc = WebClient.create(endpointAddress);
+        wc.accept("application/xml").type("application/xml");
+        GenericEntity<List<Book>> collectionEntity = createGenericEntity();
+        GenericType<List<Book>> genericResponseType = new GenericType<List<Book>>()
{        
+        };
+            
+        Future<Response> future = wc.async().post(Entity.entity(collectionEntity, "application/xml"));
   
+            
+        Response r = future.get();
+        List<Book> books2 = r.readEntity(genericResponseType);
+        assertNotNull(books2);
+        
+        List<Book> books = collectionEntity.getEntity();
+        assertNotSame(books, books2);
+        assertEquals(2, books2.size());
+        Book b11 = books.get(0);
+        assertEquals(123L, b11.getId());
+        assertEquals("CXF in Action", b11.getName());
+        Book b22 = books.get(1);
+        assertEquals(124L, b22.getId());
+        assertEquals("CXF Rocks", b22.getName());
+        assertEquals(200, wc.getResponse().getStatus());
+    }
+    
     private GenericEntity<List<Book>> createGenericEntity() {
         Book b1 = new Book("CXF in Action", 123L);
         Book b2 = new Book("CXF Rocks", 124L);


Mime
View raw message