You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2013/04/15 15:29:21 UTC

svn commit: r1468048 - in /cxf/branches/2.7.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml

Author: sergeyb
Date: Mon Apr 15 13:29:21 2013
New Revision: 1468048

URL: http://svn.apache.org/r1468048
Log:
Merged revisions 1468045 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1468045 | sergeyb | 2013-04-15 14:23:58 +0100 (Mon, 15 Apr 2013) | 1 line
  
  [CXF-4958] Updating one of system tests to have jaxrs:client depending on pre-configured  MBR to read the message
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1468045

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java?rev=1468048&r1=1468047&r2=1468048&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java (original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java Mon Apr 15 13:29:21 2013
@@ -20,6 +20,7 @@
 package org.apache.cxf.systest.jaxrs.security;
 
 import javax.ws.rs.core.MediaType;
+import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
@@ -78,7 +79,24 @@ public class JAXRSHttpsBookTest extends 
     }
     @Test
     public void testGetBook123ProxyFromSpringWildcard() throws Exception {
-        doTestGetBook123ProxyFromSpring(CLIENT_CONFIG_FILE4);
+        ClassPathXmlApplicationContext ctx =
+            new ClassPathXmlApplicationContext(new String[] {CLIENT_CONFIG_FILE4});
+        Object bean = ctx.getBean("bookService.proxyFactory");
+        assertNotNull(bean);
+        JAXRSClientFactoryBean cfb = (JAXRSClientFactoryBean) bean;
+        
+        BookStore bs = cfb.create(BookStore.class);
+        assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
+        
+        WebClient wc = WebClient.fromClient(WebClient.client(bs));
+        assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
+        wc.accept("application/xml");
+        wc.path("bookstore/securebooks/123");
+        TheBook b = wc.get(TheBook.class);
+        
+        assertEquals(b.getId(), 123);
+        b = wc.get(TheBook.class);
+        assertEquals(b.getId(), 123);
     }
     
     private void doTestGetBook123ProxyFromSpring(String cfgFile) throws Exception {
@@ -147,4 +165,21 @@ public class JAXRSHttpsBookTest extends 
         assertEquals(123, b.getId());
     }     
     
+    @XmlRootElement(name = "TheBook")
+    public static class TheBook {
+        private String name;
+        private long id;
+        public String getName() {
+            return name;
+        }
+        public void setName(String name) {
+            this.name = name;
+        }
+        public long getId() {
+            return id;
+        }
+        public void setId(long id) {
+            this.id = id;
+        }
+    }
 }

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml?rev=1468048&r1=1468047&r2=1468048&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml (original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml Mon Apr 15 13:29:21 2013
@@ -52,6 +52,16 @@ under the License.
 
     <jaxrs:client id="bookService" 
        address="https://localhost:${testutil.ports.jaxrs-https}"
-serviceClass="org.apache.cxf.systest.jaxrs.BookStore"/>
+serviceClass="org.apache.cxf.systest.jaxrs.BookStore">
+        <jaxrs:providers>
+            <bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
+                <property name="inTransformElements">
+                 <map>
+                   <entry key="Book" value="TheBook"/>
+                 </map>
+                </property>
+            </bean>
+        </jaxrs:providers>
+    </jaxrs:client>
 
 </beans>