Repository: cxf Updated Branches: refs/heads/master f18207332 -> a5babde44
Fix jaxws22 usage on server side Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a5babde4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a5babde4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a5babde4 Branch: refs/heads/master Commit: a5babde44f1427a796ac2fbd30fd1fc57995f156 Parents: f182073 Author: Christian Schneider <[email protected]> Authored: Mon Mar 3 18:30:00 2014 +0100 Committer: Christian Schneider <[email protected]> Committed: Mon Mar 3 18:30:00 2014 +0100 ---------------------------------------------------------------------- .../cxf/transport/jms/ConnectionFactoryFeature.java | 14 ++++++-------- .../cxf/systest/jms/JMSClientServerGzipTest.java | 8 +++++--- .../org/apache/cxf/systest/jms/JaxWsAPITest.java | 5 ++++- .../HelloWorldContinuationsClientServerTest.java | 8 +++++--- .../HelloWorldContinuationsThrottleTest.java | 5 ++++- .../JMSContinuationsClientServerTest.java | 5 ++++- .../continuations/ProviderJMSContinuationTest.java | 7 ++++--- .../MultiTransportClientServerTest.java | 9 +++++---- .../cxf/systest/mtom/ClientMtomXopWithJMSTest.java | 15 +++++++-------- 9 files changed, 44 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ConnectionFactoryFeature.java ---------------------------------------------------------------------- diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ConnectionFactoryFeature.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ConnectionFactoryFeature.java index 7ac1895..5d9a790 100644 --- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ConnectionFactoryFeature.java +++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ConnectionFactoryFeature.java @@ -49,22 +49,20 @@ public class ConnectionFactoryFeature extends AbstractFeature { @Override public void initialize(Client client, Bus bus) { Conduit conduit = client.getConduit(); - if (!(conduit instanceof JMSConduit)) { - throw new IllegalArgumentException("This feature only works for jms transport"); + if (conduit instanceof JMSConduit) { + JMSConduit jmsConduit = (JMSConduit)conduit; + jmsConduit.getJmsConfig().setConnectionFactory(connectionFactory); } - JMSConduit jmsConduit = (JMSConduit)conduit; - jmsConduit.getJmsConfig().setConnectionFactory(connectionFactory); super.initialize(client, bus); } @Override public void initialize(Server server, Bus bus) { Destination destination = server.getDestination(); - if (!(destination instanceof JMSDestination)) { - throw new IllegalArgumentException("This feature only works for jms transport"); + if (destination instanceof JMSDestination) { + JMSDestination jmsDestination = (JMSDestination)destination; + jmsDestination.getJmsConfig().setConnectionFactory(connectionFactory); } - JMSDestination jmsDestination = (JMSDestination)destination; - jmsDestination.getJmsConfig().setConnectionFactory(connectionFactory); super.initialize(server, bus); } http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java ---------------------------------------------------------------------- diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java index 9e83bc2..265f4f5 100644 --- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java +++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java @@ -26,6 +26,7 @@ import javax.xml.ws.Endpoint; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; import org.apache.cxf.testutil.common.AbstractBusTestServerBase; import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher; @@ -42,15 +43,16 @@ public class JMSClientServerGzipTest extends AbstractBusClientServerTestBase { public static class GzipServer extends AbstractBusTestServerBase { - Endpoint ep; + EndpointImpl ep; protected void run() { Object impleDoc = new GreeterImplDoc(); Bus bus = BusFactory.getDefaultBus(); bus.getFeatures().add(new GZIPFeature()); setBus(bus); broker.updateWsdl(bus, "testutils/hello_world_doc_lit.wsdl"); - ep = Endpoint.publish(null, impleDoc, - new GZIPFeature()); + ep = (EndpointImpl)Endpoint.create(null, impleDoc); + ep.getFeatures().add(new GZIPFeature()); + ep.publish(); } public void tearDown() { ep.stop(); http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JaxWsAPITest.java ---------------------------------------------------------------------- diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JaxWsAPITest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JaxWsAPITest.java index 280eec0..61762cd 100644 --- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JaxWsAPITest.java +++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JaxWsAPITest.java @@ -30,6 +30,7 @@ import org.apache.cxf.BusFactory; import org.apache.cxf.binding.soap.interceptor.TibcoSoapActionInterceptor; import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientProxy; +import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.transport.jms.ConnectionFactoryFeature; import org.apache.hello_world_doc_lit.Greeter; import org.apache.hello_world_doc_lit.SOAPService2; @@ -54,7 +55,9 @@ public class JaxWsAPITest { cff = new ConnectionFactoryFeature(cfp); Object impleDoc = new GreeterImplDoc(); - Endpoint.publish(null, impleDoc, cff); + EndpointImpl ep = (EndpointImpl)Endpoint.create(impleDoc); + ep.getFeatures().add(cff); + ep.publish(); } @AfterClass http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java ---------------------------------------------------------------------- diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java index cb43b89..bcc47d6 100644 --- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java +++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java @@ -31,6 +31,7 @@ import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.pool.PooledConnectionFactory; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.transport.jms.ConnectionFactoryFeature; import org.junit.AfterClass; import org.junit.Assert; @@ -51,12 +52,13 @@ public class HelloWorldContinuationsClientServerTest { PooledConnectionFactory cfp = new PooledConnectionFactory(cf); cff = new ConnectionFactoryFeature(cfp); Object implementor = new HelloWorldWithContinuationsJMS(); - Endpoint.publish(null, implementor, cff); + EndpointImpl ep = (EndpointImpl)Endpoint.create(null, implementor); + ep.getFeatures().add(cff); + ep.publish(); } @AfterClass - public static void clearProperty() { - + public static void stopServers() { bus.shutdown(false); } http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java ---------------------------------------------------------------------- diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java index cc38ca9..c1af7ce 100644 --- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java +++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java @@ -31,6 +31,7 @@ import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.pool.PooledConnectionFactory; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.transport.jms.ConnectionFactoryFeature; import org.junit.AfterClass; import org.junit.Assert; @@ -50,7 +51,9 @@ public class HelloWorldContinuationsThrottleTest { cff = new ConnectionFactoryFeature(cfp); Object implementor = new HelloWorldWithContinuationsJMS2(); String address = "jms:queue:test.jmstransport.text?replyToQueueName=test.jmstransport.text.reply"; - Endpoint.publish(address, implementor, cff); + EndpointImpl ep = (EndpointImpl)Endpoint.create(address, implementor); + ep.getFeatures().add(cff); + ep.publish(); } @AfterClass http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java ---------------------------------------------------------------------- diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java index 979de0d..3bec3df 100644 --- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java +++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java @@ -29,6 +29,7 @@ import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; import org.apache.cxf.hello_world_jms.HelloWorldPortType; import org.apache.cxf.hello_world_jms.HelloWorldService; +import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.transport.jms.ConnectionFactoryFeature; import org.junit.AfterClass; import org.junit.Assert; @@ -47,7 +48,9 @@ public class JMSContinuationsClientServerTest { cff = new ConnectionFactoryFeature(cfp); Object implementor = new GreeterImplWithContinuationsJMS(); String address = "jms:queue:test.jmstransport.text?replyToQueueName=test.jmstransport.text.reply"; - Endpoint.publish(address, implementor, cff); + EndpointImpl ep = (EndpointImpl)Endpoint.create(implementor); + ep.getFeatures().add(cff); + ep.publish(address); } @AfterClass http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java ---------------------------------------------------------------------- diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java index 15fcf45..95be743 100644 --- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java +++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java @@ -48,9 +48,10 @@ public class ProviderJMSContinuationTest { cff = new ConnectionFactoryFeature(cfp); Object implementor = new HWSoapMessageDocProvider(); String address = "jms:queue:test.jmstransport.text?replyToQueueName=test.jmstransport.text.reply"; - Endpoint endpoint = Endpoint.publish(address, implementor, cff); - ((EndpointImpl)endpoint).getInInterceptors().add(new IncomingMessageCounterInterceptor()); - + EndpointImpl ep = (EndpointImpl)Endpoint.create(address, implementor); + ep.getInInterceptors().add(new IncomingMessageCounterInterceptor()); + ep.getFeatures().add(cff); + ep.publish(); } @AfterClass public static void clearProperty() { http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/multitransport/MultiTransportClientServerTest.java ---------------------------------------------------------------------- diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/multitransport/MultiTransportClientServerTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/multitransport/MultiTransportClientServerTest.java index 4210411..d43228d 100644 --- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/multitransport/MultiTransportClientServerTest.java +++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/multitransport/MultiTransportClientServerTest.java @@ -28,6 +28,7 @@ import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.pool.PooledConnectionFactory; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.testutil.common.TestUtil; import org.apache.cxf.transport.jms.ConnectionFactoryFeature; import org.apache.hello_world_doc_lit.Greeter; @@ -57,11 +58,11 @@ public class MultiTransportClientServerTest { ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); PooledConnectionFactory cfp = new PooledConnectionFactory(cf); cff = new ConnectionFactoryFeature(cfp); - Object implementor = new HTTPGreeterImpl(); String address = "http://localhost:" + PORT + "/SOAPDocLitService/SoapPort"; - Endpoint.publish(address, implementor); - implementor = new JMSGreeterImpl(); - Endpoint.publish(null, implementor, cff); + Endpoint.publish(address, new HTTPGreeterImpl()); + EndpointImpl ep1 = (EndpointImpl)Endpoint.create(new JMSGreeterImpl()); + ep1.getFeatures().add(cff); + ep1.publish(); } @AfterClass http://git-wip-us.apache.org/repos/asf/cxf/blob/a5babde4/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java ---------------------------------------------------------------------- diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java index cc75a0c..fb89e20 100644 --- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java +++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java @@ -25,6 +25,7 @@ import javax.activation.DataHandler; import javax.mail.util.ByteArrayDataSource; import javax.xml.namespace.QName; import javax.xml.ws.BindingProvider; +import javax.xml.ws.Endpoint; import javax.xml.ws.Holder; import javax.xml.ws.soap.SOAPBinding; @@ -32,9 +33,6 @@ import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.pool.PooledConnectionFactory; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; -import org.apache.cxf.endpoint.Endpoint; -import org.apache.cxf.interceptor.LoggingInInterceptor; -import org.apache.cxf.interceptor.LoggingOutInterceptor; import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; import org.apache.cxf.mime.TestMtom; @@ -60,14 +58,15 @@ public class ClientMtomXopWithJMSTest { PooledConnectionFactory cfp = new PooledConnectionFactory(cf); cff = new ConnectionFactoryFeature(cfp); - EndpointImpl jaxep = (EndpointImpl)javax.xml.ws.Endpoint.publish(null, implementor, cff); - Endpoint ep = jaxep.getServer().getEndpoint(); + EndpointImpl ep = (EndpointImpl)Endpoint.create(implementor); + ep.getFeatures().add(cff); ep.getInInterceptors().add(new TestMultipartMessageInterceptor()); ep.getOutInterceptors().add(new TestAttachmentOutInterceptor()); - ep.getInInterceptors().add(new LoggingInInterceptor()); - ep.getOutInterceptors().add(new LoggingOutInterceptor()); - SOAPBinding jaxWsSoapBinding = (SOAPBinding)jaxep.getBinding(); + //ep.getInInterceptors().add(new LoggingInInterceptor()); + //ep.getOutInterceptors().add(new LoggingOutInterceptor()); + SOAPBinding jaxWsSoapBinding = (SOAPBinding)ep.getBinding(); jaxWsSoapBinding.setMTOMEnabled(true); + ep.publish(); } @AfterClass
