cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1325032 - in /cxf/branches/2.5.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/
Date Wed, 11 Apr 2012 21:58:31 GMT
Author: sergeyb
Date: Wed Apr 11 21:58:29 2012
New Revision: 1325032

URL: http://svn.apache.org/viewvc?rev=1325032&view=rev
Log:
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.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client1.xml
      - copied unchanged from r1325027, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client1.xml
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client2.xml
      - copied unchanged from r1325027, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client2.xml
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client3.xml
      - copied unchanged from r1325027, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-client3.xml
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-server.xml
      - copied unchanged from r1325027, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-server.xml
Removed:
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https-url.xml
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/jaxrs-https.xml
Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1325027

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

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=1325032&r1=1325031&r2=1325032&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Wed Apr 11 21:58:29 2012
@@ -87,7 +87,7 @@ public class AbstractJAXRSFactoryBean ex
      */
     public Bus getBus() {
         Bus b = super.getBus();
-        checkBindingFactory(bus);
+        checkBindingFactory(b);
         return b;
     }
 

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java?rev=1325032&r1=1325031&r2=1325032&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
Wed Apr 11 21:58:29 2012
@@ -48,7 +48,7 @@ public class JAXRSClientFactoryBeanDefin
     
     @Override
     protected Class getFactoryClass() {
-        return JAXRSClientFactoryBean.class;
+        return JAXRSSpringClientFactoryBean.class;
     }
 
     @Override

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java?rev=1325032&r1=1325031&r2=1325032&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/BookHttpsServer.java
Wed Apr 11 21:58:29 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.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java?rev=1325032&r1=1325031&r2=1325032&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
Wed Apr 11 21:58:29 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,7 +52,7 @@ public class JAXRSHttpsBookTest extends 
     
     @Test
     public void testGetBook123Proxy() throws Exception {
-        doTestGetBook123Proxy(CLIENT_CONFIG_FILE);
+        doTestGetBook123Proxy(CLIENT_CONFIG_FILE1);
     }
     
     @Test
@@ -63,13 +69,30 @@ public class JAXRSHttpsBookTest extends 
         assertEquals(b.getId(), 123);
         b = bs.getSecureBook("123");
         assertEquals(b.getId(), 123);
-    }  
+    }
+    
+    @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));
@@ -82,7 +105,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());
@@ -98,7 +121,7 @@ public class JAXRSHttpsBookTest extends 
     
     @Test
     public void testGetBook123WebClient() throws Exception {
-        doTestGetBook123WebClient(CLIENT_CONFIG_FILE);
+        doTestGetBook123WebClient(CLIENT_CONFIG_FILE1);
     }
     
     @Test



Mime
View raw message