Author: sergeyb Date: Wed Apr 11 22:25:17 2012 New Revision: 1325046 URL: http://svn.apache.org/viewvc?rev=1325046&view=rev Log: Merged revisions 1325040 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes
................ r1325040 | sergeyb | 2012-04-11 23:08:10 +0100 (Wed, 11 Apr 2012) | 16 lines Merged revisions 1325032 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ................ r1325032 | sergeyb | 2012-04-11 22:58:29 +0100 (Wed, 11 Apr 2012) | 9 lines Merged revisions 1325027 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1325027 | sergeyb | 2012-04-11 22:51:55 +0100 (Wed, 11 Apr 2012) | 1 line [CXF-4238] Updating JAX-RS Spring parser to return a proper factory class name, thanks to Dan ........ ................ ................ Added: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client1.xml - copied unchanged from r1325040, cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client1.xml cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client2.xml - copied unchanged from r1325040, cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client2.xml cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client3.xml - copied unchanged from r1325040, cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client3.xml cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-server.xml - copied unchanged from r1325040, cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-server.xml Removed: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-url.xml cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml Modified: cxf/branches/2.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Wed Apr 11 22:25:17 2012 @@ -0,0 +1,3 @@ +/cxf/branches/2.4.x-fixes:1325040 +/cxf/branches/2.5.x-fixes:1325032 +/cxf/trunk:1325027 Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=1325046&r1=1325045&r2=1325046&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java (original) +++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java Wed Apr 11 22:25:17 2012 @@ -94,7 +94,7 @@ public class AbstractJAXRSFactoryBean ex */ public Bus getBus() { Bus b = super.getBus(); - checkBindingFactory(bus); + checkBindingFactory(b); return b; } Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java?rev=1325046&r1=1325045&r2=1325046&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java (original) +++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java Wed Apr 11 22:25:17 2012 @@ -50,7 +50,7 @@ public class JAXRSClientFactoryBeanDefin @Override protected Class getFactoryClass() { - return JAXRSClientFactoryBean.class; + return JAXRSSpringClientFactoryBean.class; } @Override Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java?rev=1325046&r1=1325045&r2=1325046&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java (original) +++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java Wed Apr 11 22:25:17 2012 @@ -32,7 +32,7 @@ public class BookHttpsServer extends Abs public static final String PORT = TestUtil.getPortNumber("jaxrs-https"); private static final String SERVER_CONFIG_FILE = - "org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml"; + "org/apache/cxf/systest/jaxrs/security/jaxrs-https-server.xml"; protected void run() { Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java?rev=1325046&r1=1325045&r2=1325046&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java (original) +++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java Wed Apr 11 22:25:17 2012 @@ -22,6 +22,7 @@ package org.apache.cxf.systest.jaxrs.sec import javax.ws.rs.core.MediaType; import org.apache.cxf.jaxrs.client.JAXRSClientFactory; +import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.systest.jaxrs.Book; import org.apache.cxf.systest.jaxrs.BookStore; @@ -30,13 +31,18 @@ import org.apache.cxf.testutil.common.Ab import org.junit.BeforeClass; import org.junit.Test; +import org.springframework.context.support.ClassPathXmlApplicationContext; + + public class JAXRSHttpsBookTest extends AbstractBusClientServerTestBase { public static final String PORT = BookHttpsServer.PORT; - private static final String CLIENT_CONFIG_FILE = - "org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml"; + private static final String CLIENT_CONFIG_FILE1 = + "org/apache/cxf/systest/jaxrs/security/jaxrs-https-client1.xml"; private static final String CLIENT_CONFIG_FILE2 = - "org/apache/cxf/systest/jaxrs/security/jaxrs-https-url.xml"; + "org/apache/cxf/systest/jaxrs/security/jaxrs-https-client2.xml"; + private static final String CLIENT_CONFIG_FILE3 = + "org/apache/cxf/systest/jaxrs/security/jaxrs-https-client3.xml"; @BeforeClass public static void startServers() throws Exception { @@ -46,9 +52,8 @@ public class JAXRSHttpsBookTest extends @Test public void testGetBook123Proxy() throws Exception { - BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class, - CLIENT_CONFIG_FILE); + CLIENT_CONFIG_FILE1); // just to verify the interface call goes through CGLIB proxy too assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString()); Book b = bs.getSecureBook("123"); @@ -72,10 +77,27 @@ public class JAXRSHttpsBookTest extends @Test + public void testGetBook123ProxyFromSpring() throws Exception { + + ClassPathXmlApplicationContext ctx = + new ClassPathXmlApplicationContext(new String[] {CLIENT_CONFIG_FILE3}); + 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()); + Book b = bs.getSecureBook("123"); + assertEquals(b.getId(), 123); + b = bs.getSecureBook("123"); + assertEquals(b.getId(), 123); + } + + @Test public void testGetBook123ProxyToWebClient() throws Exception { BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class, - CLIENT_CONFIG_FILE); + CLIENT_CONFIG_FILE1); Book b = bs.getSecureBook("123"); assertEquals(b.getId(), 123); WebClient wc = WebClient.fromClient(WebClient.client(bs)); @@ -88,7 +110,7 @@ public class JAXRSHttpsBookTest extends @Test public void testGetBook123WebClientToProxy() throws Exception { - WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE); + WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1); wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE); Book b = wc.get(Book.class); assertEquals(123, b.getId()); @@ -104,14 +126,12 @@ public class JAXRSHttpsBookTest extends @Test public void testGetBook123WebClient() throws Exception { - - WebClient client = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE); + WebClient client = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1); assertEquals("https://localhost:" + PORT, client.getBaseURI().toString()); client.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE); Book b = client.get(Book.class); assertEquals(123, b.getId()); - } @Test
