Author: cschneider
Date: Wed Feb 12 16:29:30 2014
New Revision: 1567674
URL: http://svn.apache.org/r1567674
Log:
CXF-5543 Fix continuationtests
Removed:
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/test2.wsdl
Modified:
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS2.java
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/test.wsdl
Modified:
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=1567674&r1=1567673&r2=1567674&view=diff
==============================================================================
---
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
(original)
+++
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
Wed Feb 12 16:29:30 2014
@@ -371,8 +371,9 @@ public class JMSConduit extends Abstract
}
}
public synchronized void close() {
- ResourceCloser.close(connection);
shutdownListeners();
+ ResourceCloser.close(connection);
+ connection = null;
LOG.log(Level.FINE, "JMSConduit closed ");
}
Modified:
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=1567674&r1=1567673&r2=1567674&view=diff
==============================================================================
---
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Wed Feb 12 16:29:30 2014
@@ -102,10 +102,10 @@ public class JMSConfiguration {
connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
}
if (connectionFactory == null) {
- throw new
IllegalArgumentException("JMSConfiguration.connectionFactory may not be null");
+ throw new IllegalArgumentException("connectionFactory may not be
null");
}
if (targetDestination == null) {
- throw new
IllegalArgumentException("JMSConfigruation.targetDestination may not be null");
+ throw new IllegalArgumentException("targetDestination may not be
null");
}
}
Modified:
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java?rev=1567674&r1=1567673&r2=1567674&view=diff
==============================================================================
---
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
(original)
+++
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
Wed Feb 12 16:29:30 2014
@@ -19,9 +19,9 @@
package org.apache.cxf.systest.jms.continuations;
import java.net.URL;
-import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.xml.namespace.QName;
@@ -33,17 +33,15 @@ import org.apache.cxf.bus.spring.SpringB
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
public class HelloWorldContinuationsClientServerTest extends
AbstractBusClientServerTestBase {
- static EmbeddedJMSBrokerLauncher broker;
-
- private static final String CONFIG_FILE =
- "org/apache/cxf/systest/jms/continuations/jms_test_config.xml";
+ private static final String WSDL_PATH =
"org/apache/cxf/systest/jms/continuations/test.wsdl";
+ private static final String CONFIG_FILE =
"org/apache/cxf/systest/jms/continuations/jms_test_config.xml";
+ private static EmbeddedJMSBrokerLauncher broker;
public static class Server extends AbstractBusTestServerBase {
EmbeddedJMSBrokerLauncher broker;
@@ -53,9 +51,10 @@ public class HelloWorldContinuationsClie
}
protected void run() {
- setBus(BusFactory.getDefaultBus());
- broker.updateWsdl(getBus(),
-
"org/apache/cxf/systest/jms/continuations/test.wsdl");
+ SpringBusFactory bf = new SpringBusFactory();
+ Bus bus = bf.createBus(CONFIG_FILE);
+ BusFactory.setDefaultBus(bus);
+ broker.updateWsdl(getBus(), WSDL_PATH);
Object implementor = new HelloWorldWithContinuationsJMS();
String address = "jms://";
ep = Endpoint.publish(address, implementor);
@@ -87,14 +86,13 @@ public class HelloWorldContinuationsClie
QName serviceName = new QName("http://cxf.apache.org/systest/jaxws",
"HelloContinuationService");
- URL wsdlURL =
getClass().getResource("/org/apache/cxf/systest/jms/continuations/test.wsdl");
+ URL wsdlURL = getClass().getClassLoader().getResource(WSDL_PATH);
HelloContinuationService service = new
HelloContinuationService(wsdlURL, serviceName);
assertNotNull(service);
final HelloContinuation helloPort = service.getHelloContinuationPort();
- ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 5, 0,
TimeUnit.SECONDS,
- new
ArrayBlockingQueue<Runnable>(10));
+ ExecutorService executor = Executors.newCachedThreadPool();
CountDownLatch startSignal = new CountDownLatch(1);
CountDownLatch helloDoneSignal = new CountDownLatch(5);
@@ -108,7 +106,7 @@ public class HelloWorldContinuationsClie
helloDoneSignal.await(60, TimeUnit.SECONDS);
executor.shutdownNow();
((java.io.Closeable)helloPort).close();
- assertEquals("Not all invocations have completed", 0,
helloDoneSignal.getCount());
+ assertEquals("Some invocations are still running", 0,
helloDoneSignal.getCount());
bus.shutdown(true);
}
Modified:
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java?rev=1567674&r1=1567673&r2=1567674&view=diff
==============================================================================
---
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
(original)
+++
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
Wed Feb 12 16:29:30 2014
@@ -33,16 +33,16 @@ import org.apache.cxf.bus.spring.SpringB
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
public class HelloWorldContinuationsThrottleTest extends
AbstractBusClientServerTestBase {
- static EmbeddedJMSBrokerLauncher broker;
+ private static final String WSDL_PATH =
"org/apache/cxf/systest/jms/continuations/test.wsdl";
+ private static final String CONFIG_FILE =
"org/apache/cxf/systest/jms/continuations/jms_test_config.xml";
+
+ private static EmbeddedJMSBrokerLauncher broker;
- private static final String CONFIG_FILE =
- "org/apache/cxf/systest/jms/continuations/jms_test_config.xml";
public static class Server extends AbstractBusTestServerBase {
public static final String PORT = allocatePort(Server.class);
@@ -51,7 +51,7 @@ public class HelloWorldContinuationsThro
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus(CONFIG_FILE);
BusFactory.setDefaultBus(bus);
- broker.updateWsdl(bus,
"org/apache/cxf/systest/jms/continuations/test2.wsdl");
+ broker.updateWsdl(bus, WSDL_PATH);
Object implementor = new HelloWorldWithContinuationsJMS2();
String address = "http://localhost:" + PORT +
"/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
@@ -70,14 +70,14 @@ public class HelloWorldContinuationsThro
}
@Test
- public void testHttpWrappedContinuatuions() throws Exception {
+ public void testHttpWrappedContinuations() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus(CONFIG_FILE);
BusFactory.setDefaultBus(bus);
QName serviceName = new QName("http://cxf.apache.org/systest/jaxws",
"HelloContinuationService");
- URL wsdlURL =
getClass().getResource("/org/apache/cxf/systest/jms/continuations/test2.wsdl");
+ URL wsdlURL = getClass().getClassLoader().getResource(WSDL_PATH);
String wsdlString = wsdlURL.toString().intern();
broker.updateWsdl(getBus(), wsdlString);
HelloContinuationService service = new
HelloContinuationService(wsdlURL, serviceName);
@@ -102,7 +102,7 @@ public class HelloWorldContinuationsThro
helloDoneSignal.await(60, TimeUnit.SECONDS);
executor.shutdownNow();
- assertEquals("Not all invocations have completed", 0,
helloDoneSignal.getCount());
+ assertEquals("Some invocations are still running", 0,
helloDoneSignal.getCount());
((java.io.Closeable)helloPort).close();
bus.shutdown(true);
Modified:
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS2.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS2.java?rev=1567674&r1=1567673&r2=1567674&view=diff
==============================================================================
---
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS2.java
(original)
+++
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS2.java
Wed Feb 12 16:29:30 2014
@@ -39,7 +39,7 @@ import org.apache.cxf.continuations.Cont
portName = "HelloContinuationPort",
targetNamespace = "http://cxf.apache.org/systest/jaxws",
endpointInterface =
"org.apache.cxf.systest.jms.continuations.HelloContinuation",
- wsdlLocation =
"org/apache/cxf/systest/jms/continuations/test2.wsdl")
+ wsdlLocation =
"org/apache/cxf/systest/jms/continuations/test.wsdl")
public class HelloWorldWithContinuationsJMS2 implements HelloContinuation {
private Map<String, Continuation> suspended =
Modified:
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml?rev=1567674&r1=1567673&r2=1567674&view=diff
==============================================================================
---
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
(original)
+++
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
Wed Feb 12 16:29:30 2014
@@ -20,31 +20,28 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ct="http://cxf.apache.org/configuration/types"
xmlns:jms="http://cxf.apache.org/transports/jms"
xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="
http://cxf.apache.org/transports/jms
http://cxf.apache.org/schemas/configuration/jms.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<jms:conduit
name="{http://cxf.apache.org/systest/jaxws}HelloContinuationPort.jms-conduit">
- <jms:clientConfig clientReceiveTimeout="10000"
messageTimeToLive="10000"/>
- <jms:address jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="dynamicQueues/test.jmstransport.text">
- <jms:JMSNamingProperty name="java.naming.factory.initial"
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
- <jms:JMSNamingProperty name="java.naming.provider.url"
value="${EmbeddedBrokerURL}"/>
- </jms:address>
<jms:jmsConfig-ref>jmsConf1</jms:jmsConfig-ref>
</jms:conduit>
<bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory"
p:brokerURL="${EmbeddedBrokerURL}"/>
<bean id="jmsConf1" class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
+ p:targetDestination="test.jmstransport.text"
+ p:replyDestination="test.jmstransport.text.reply"
p:concurrentConsumers="1"
- p:maxConcurrentConsumers="1"/>
+ p:maxConcurrentConsumers="1"
+ p:usingEndpointInfo="false"/>
<jms:destination
name="{http://cxf.apache.org/systest/jaxws}HelloContinuationPort.jms-destination">
- <jms:address jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="dynamicQueues/test.jmstransport.text">
- <jms:JMSNamingProperty name="java.naming.factory.initial"
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
- <jms:JMSNamingProperty name="java.naming.provider.url"
value="${EmbeddedBrokerURL}"/>
- </jms:address>
<jms:jmsConfig-ref>jmsConf2</jms:jmsConfig-ref>
</jms:destination>
<bean id="jmsConf2" class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
+ p:targetDestination="test.jmstransport.text"
+ p:replyDestination="test.jmstransport.text.reply"
p:timeToLive="10000"
p:concurrentConsumers="1"
p:maxConcurrentConsumers="1"
p:maxSuspendedContinuations="1"
- p:cacheLevel="2"/>
+ p:cacheLevel="2"
+ p:usingEndpointInfo="false"/>
</beans>
Modified:
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/test.wsdl
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/test.wsdl?rev=1567674&r1=1567673&r2=1567674&view=diff
==============================================================================
---
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/test.wsdl
(original)
+++
cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/test.wsdl
Wed Feb 12 16:29:30 2014
@@ -80,14 +80,6 @@
</operation>
</binding>
<service name="HelloContinuationService">
- <port binding="tns:HelloContinuationServiceSoapBinding"
name="HelloContinuationPort">
- <jms:clientConfig clientReceiveTimeout="500000"
messageTimeToLive="500000"/>
- <jms:serverConfig serverReceiveTimeout="500"
messageTimeToLive="500000"/>
- <jms:address jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="dynamicQueues/test.jmstransport.text">
- <jms:JMSNamingProperty name="java.naming.factory.initial"
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
- <jms:JMSNamingProperty name="java.naming.provider.url"
value="tcp://localhost:61500"/>
- </jms:address>
- <jms:server durableSubscriberName="CXF_subscriber"/>
- </port>
+ <port binding="tns:HelloContinuationServiceSoapBinding"
name="HelloContinuationPort"/>
</service>
</definitions>