cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1135484 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/ test/java/org/apache/cxf/jaxrs/spring/
Date Tue, 14 Jun 2011 11:10:50 GMT
Author: sergeyb
Date: Tue Jun 14 11:10:49 2011
New Revision: 1135484

URL: http://svn.apache.org/viewvc?rev=1135484&view=rev
Log:
[CXF-3586] Making sure jaxrs clients do not ignore custom QNames

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=1135484&r1=1135483&r2=1135484&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Tue Jun 14 11:10:49 2011
@@ -30,6 +30,7 @@ import java.util.logging.Logger;
 
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Response;
+import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
@@ -90,6 +91,14 @@ public class AbstractJAXRSFactoryBean ex
         return b;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public void setServiceName(QName name) {
+        super.setServiceName(name);
+        serviceFactory.setServiceName(name);
+    }
+    
     private void checkBindingFactory(Bus bus) {
         BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
         try {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java?rev=1135484&r1=1135483&r2=1135484&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
Tue Jun 14 11:10:49 2011
@@ -141,7 +141,6 @@ public class JAXRSServerFactoryBean exte
             serviceFactory.setBus(bus);
             checkResources(true);
             if (serviceFactory.getService() == null) {
-                serviceFactory.setServiceName(getServiceName());
                 serviceFactory.create();
                 updateClassResourceProviders();
             }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java?rev=1135484&r1=1135483&r2=1135484&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
Tue Jun 14 11:10:49 2011
@@ -64,6 +64,10 @@ public class JAXRSServiceFactoryBean ext
         this.serviceName = name;
     }
     
+    public QName getServiceName() {
+        return serviceName;
+    }
+    
     public void setEnableStaticResolution(boolean staticResolution) {
         this.enableStatic = staticResolution;
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java?rev=1135484&r1=1135483&r2=1135484&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java
Tue Jun 14 11:10:49 2011
@@ -51,8 +51,9 @@ public class JAXRSClientFactoryBeanTest 
         assertEquals("Get a wrong map size", cfb.getHeaders().size(), 1);
         assertEquals("Get a wrong username", cfb.getUsername(), "username");
         assertEquals("Get a wrong password", cfb.getPassword(), "password");
-        assertEquals(new QName("http://books.com", "BookService"), 
-                     cfb.getServiceName());
+        QName serviceQName = new QName("http://books.com", "BookService");
+        assertEquals(serviceQName, cfb.getServiceName());
+        assertEquals(serviceQName, cfb.getServiceFactory().getServiceName());
         
         bean = ctx.getBean("ModelClient.proxyFactory");
         assertNotNull(bean);

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java?rev=1135484&r1=1135483&r2=1135484&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java
Tue Jun 14 11:10:49 2011
@@ -57,8 +57,9 @@ public class JAXRSServerFactoryBeanTest 
         assertEquals("Get a wrong address", "http://localhost:9090/rs", sfb.getAddress());
         assertNotNull("The resource classes should not be null", sfb.getResourceClasses());
         assertEquals("Get a wrong resource class", BookStore.class, sfb.getResourceClasses().get(0));
-        assertEquals(new QName("http://books.com", "BookService"), 
-                     sfb.getServiceName());
+        QName serviceQName = new QName("http://books.com", "BookService");
+        assertEquals(serviceQName, sfb.getServiceName());
+        assertEquals(serviceQName, sfb.getServiceFactory().getServiceName());
         
         sfb = (JAXRSServerFactoryBean)ctx.getBean("inlineServiceBeans");
         assertNotNull("The resource classes should not be null", sfb.getResourceClasses());



Mime
View raw message