cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1526279 - /cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
Date Wed, 25 Sep 2013 20:03:54 GMT
Author: sergeyb
Date: Wed Sep 25 20:03:53 2013
New Revision: 1526279

URL: http://svn.apache.org/r1526279
Log:
Forgot to add an rs xml security test where Response.readEntity is used 

Modified:
    cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java

Modified: cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java?rev=1526279&r1=1526278&r2=1526279&view=diff
==============================================================================
--- cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
(original)
+++ cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
Wed Sep 25 20:03:53 2013
@@ -116,16 +116,22 @@ public class JAXRSXmlSecTest extends Abs
     @Test
     public void testPostBookWithEnvelopedSig() throws Exception {
         String address = "https://localhost:" + PORT + "/xmlsig/bookstore/books";
-        doTestSignature(address, false);
+        doTestSignature(address, false, false);
     }
     
     @Test
     public void testPostBookWithEnvelopingSig() throws Exception {
         String address = "https://localhost:" + PORT + "/xmlsig/bookstore/books";
-        doTestSignature(address, true);
+        doTestSignature(address, true, false);
     }
     
-    private void doTestSignature(String address, boolean enveloping) {
+    @Test
+    public void testPostBookWithEnvelopingSigFromResponse() throws Exception {
+        String address = "https://localhost:" + PORT + "/xmlsig/bookstore/books";
+        doTestSignature(address, true, true);
+    }
+    
+    private void doTestSignature(String address, boolean enveloping, boolean fromResponse)
{
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
         bean.setAddress(address);
         
@@ -150,7 +156,12 @@ public class JAXRSXmlSecTest extends Abs
         
         WebClient wc = bean.createWebClient();
         try {
-            Book book = wc.post(new Book("CXF", 126L), Book.class);
+            Book book;
+            if (!fromResponse) {
+                book = wc.post(new Book("CXF", 126L), Book.class);
+            } else {
+                book = wc.post(new Book("CXF", 126L)).readEntity(Book.class);
+            }
             assertEquals(126L, book.getId());
         } catch (WebApplicationException ex) {
             fail(ex.getMessage());



Mime
View raw message