cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r663131 - in /cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java systests/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java systests/src/test/resources/extrajaxbclass.xml
Date Wed, 04 Jun 2008 14:44:58 GMT
Author: dkulp
Date: Wed Jun  4 07:44:57 2008
New Revision: 663131

URL: http://svn.apache.org/viewvc?rev=663131&view=rev
Log:
[CXF-1629] Make sure endpoint properties are copied into the factory

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java
    cxf/trunk/systests/src/test/resources/extrajaxbclass.xml

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?rev=663131&r1=663130&r2=663131&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Wed Jun
 4 07:44:57 2008
@@ -291,6 +291,11 @@
             serverFactory.setFeatures(getFeatures());
             serverFactory.setInvoker(invoker);
             serverFactory.setSchemaLocations(schemaLocations);
+            if (serverFactory.getProperties() != null) {
+                serverFactory.getProperties().putAll(properties);
+            } else {
+                serverFactory.setProperties(properties);
+            }
             
             // Be careful not to override any serverfactory settings as a user might
             // have supplied their own.

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java?rev=663131&r1=663130&r2=663131&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java Wed
Jun  4 07:44:57 2008
@@ -22,6 +22,7 @@
 import java.net.URL;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
 
 import org.w3c.dom.Document;
 
@@ -54,6 +55,19 @@
 
         assertEquals(expected, widgetFromService);
     }
+
+    @Test
+    public void testExtraSubClassWithJaxbFromEndpoint() throws Throwable {
+        Widget expected = new ExtendedWidget(42, "blah", "blah", true, true);
+        
+        ((BindingProvider)testClient).getRequestContext()
+            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
+                 "http://localhost:7081/service/TestEndpoint");
+        Widget widgetFromService = testClient.getWidgetById((long)42);
+
+        assertEquals(expected, widgetFromService);
+    }
+
     
     @Test
     public void testSchema() throws Exception {

Modified: cxf/trunk/systests/src/test/resources/extrajaxbclass.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/extrajaxbclass.xml?rev=663131&r1=663130&r2=663131&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/extrajaxbclass.xml (original)
+++ cxf/trunk/systests/src/test/resources/extrajaxbclass.xml Wed Jun  4 07:44:57 2008
@@ -55,6 +55,24 @@
 		
 	</jaxws:server>
 	
+	<!-- Endpoint -->
+	<jaxws:endpoint id="testEndpoint" 
+		implementor="org.apache.cxf.systest.jaxb.service.TestServiceImpl" 
+		address="http://localhost:7081/service/TestEndpoint">
+	
+		<jaxws:properties>
+			<entry key="jaxb.additionalContextClasses">
+				<bean class="org.apache.cxf.systest.jaxb.util.ClassArrayFactoryBean">
+					<property name="classNames">
+						<list>
+							<value>org.apache.cxf.systest.jaxb.model.ExtendedWidget</value>
+						</list>
+					</property>
+				</bean>
+			</entry>
+		</jaxws:properties>
+	</jaxws:endpoint>
+	
 	
 	<!-- Client Proxy -->
 	<jaxws:client id="testClient" address="http://localhost:7081/service/TestService" serviceClass="org.apache.cxf.systest.jaxb.service.TestService">



Mime
View raw message