cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1468055 - in /cxf/branches/2.6.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
Date Mon, 15 Apr 2013 13:36:14 GMT
Author: sergeyb
Date: Mon Apr 15 13:36:14 2013
New Revision: 1468055

URL: http://svn.apache.org/r1468055
Log:
Merged revisions 1468048 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1468048 | sergeyb | 2013-04-15 14:29:21 +0100 (Mon, 15 Apr 2013) | 9 lines
  
  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.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
    cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml

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

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

Modified: cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java?rev=1468055&r1=1468054&r2=1468055&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
(original)
+++ cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
Mon Apr 15 13:36:14 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.6.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.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml?rev=1468055&r1=1468054&r2=1468055&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml
(original)
+++ cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client4.xml
Mon Apr 15 13:36:14 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>



Mime
View raw message