Author: alessio.soldano(a)jboss.com
Date: 2012-01-25 03:59:35 -0500 (Wed, 25 Jan 2012)
New Revision: 15515
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java
Log:
Fixing regression by improving the test
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java 2012-01-24
22:46:56 UTC (rev 15514)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java 2012-01-25
08:59:35 UTC (rev 15515)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -86,22 +86,21 @@
public static void testWebServiceRef(Endpoint port) throws BusTestException
{
Bus initialDefaultBus = BusFactory.getDefaultBus(false);
- performInvocation(port);
+ Bus threadBus = BusFactory.getThreadDefaultBus(false);
+ performInvocation(port); //does not change anything to the bus, as the port is
already created when injecting serviceref
checkDefaultBus(initialDefaultBus);
- Bus threadBus = BusFactory.getThreadDefaultBus(false);
+ checkThreadBus(threadBus);
try
{
BusFactory.setThreadDefaultBus(null);
- performInvocation(port);
- Bus newThreadBus = BusFactory.getThreadDefaultBus(false);
- if (newThreadBus == initialDefaultBus)
- {
- throw new BusTestException("Thread bus set to former default bus "
+ initialDefaultBus + " instead of a new bus!");
- }
- else if (newThreadBus == threadBus)
- {
- throw new BusTestException("Thread bus set to former thread bus " +
threadBus + " (which is also default) instead of a new bus!");
- }
+ performInvocation(port); //does not change anything to the bus, as the port is
already created when injecting serviceref
+ checkDefaultBus(initialDefaultBus);
+ checkThreadBus(null);
+ BusFactory factory = BusFactory.newInstance();
+ Bus bus = factory.createBus(); //internally sets the thread bus
+ performInvocation(port); //does not change anything to the bus, as the port is
already created when injecting serviceref
+ checkDefaultBus(initialDefaultBus);
+ checkThreadBus(bus);
}
finally
{
@@ -118,8 +117,9 @@
Bus threadBus = BusFactory.getThreadDefaultBus(false);
try
{
+ final String url = getEndpointURL(host);
BusFactory.setThreadDefaultBus(null);
- performInvocation(getEndpointURL(host));
+ performInvocation(url); //goes through ServiceDelegate which sets the thread bus
if it's null
Bus newThreadBus = BusFactory.getThreadDefaultBus(false);
if (newThreadBus == initialDefaultBus)
{
@@ -127,8 +127,11 @@
}
else if (newThreadBus == threadBus)
{
- throw new BusTestException("Thread bus set to former thread bus " +
threadBus + " (which is also default) instead of a new bus!");
+ throw new BusTestException("Thread bus set to former thread bus " +
threadBus + " instead of a new bus!");
}
+ performInvocation(url);
+ checkThreadBus(newThreadBus); //the thread bus is not changed as it's not
null
+ checkDefaultBus(initialDefaultBus);
}
finally
{
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java 2012-01-24
22:46:56 UTC (rev 15514)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java 2012-01-25
08:59:35 UTC (rev 15515)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Show replies by date