Author: dkulp
Date: Mon May 14 20:41:59 2012
New Revision: 1338391
URL: http://svn.apache.org/viewvc?rev=1338391&view=rev
Log:
jaxws now forkmode once
Modified:
cxf/trunk/systests/jaxws/pom.xml
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithMalformedResponseTest.java
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchXMLClientServerTest.java
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/Server.java
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AddNumbersServiceUnwrap.java
Modified: cxf/trunk/systests/jaxws/pom.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/pom.xml?rev=1338391&r1=1338390&r2=1338391&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/pom.xml (original)
+++ cxf/trunk/systests/jaxws/pom.xml Mon May 14 20:41:59 2012
@@ -212,8 +212,4 @@
<artifactId>xalan</artifactId>
</dependency>
</dependencies>
- <properties>
- <cxf.surefire.fork.mode>pertest</cxf.surefire.fork.mode>
- </properties>
-
</project>
Modified:
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=1338391&r1=1338390&r2=1338391&view=diff
==============================================================================
---
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
(original)
+++
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Mon May 14 20:41:59 2012
@@ -55,6 +55,7 @@ import org.w3c.dom.Node;
import org.xml.sax.InputSource;
+import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.binding.soap.saaj.SAAJUtils;
import org.apache.cxf.bus.spring.SpringBusFactory;
@@ -89,6 +90,7 @@ public class DispatchClientServerTest ex
Endpoint ep;
protected void run() {
+ setBus(BusFactory.getDefaultBus());
Object implementor = new GreeterImpl();
String address = "http://localhost:"
+ TestUtil.getPortNumber(DispatchClientServerTest.class)
@@ -103,6 +105,8 @@ public class DispatchClientServerTest ex
ep.setProperties(properties);
ep.publish(address);
+ BusFactory.setDefaultBus(null);
+ BusFactory.setThreadDefaultBus(null);
}
@Override
public void tearDown() {
@@ -124,8 +128,8 @@ public class DispatchClientServerTest ex
@BeforeClass
public static void startServers() throws Exception {
- createStaticBus();
assertTrue("server did not launch correctly",
launchServer(Server.class, true));
+ createStaticBus();
}
private void waitForFuture(Future<?> fd) throws Exception {
@@ -582,7 +586,7 @@ public class DispatchClientServerTest ex
public void testJAXBObjectPAYLOADWithFeature() throws Exception {
this.configFileName =
"org/apache/cxf/systest/dispatch/client-config.xml";
SpringBusFactory bf = (SpringBusFactory)SpringBusFactory.newInstance();
- bus = bf.createBus(configFileName, false);
+ Bus bus = bf.createBus(configFileName, false);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
Modified:
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java?rev=1338391&r1=1338390&r2=1338391&view=diff
==============================================================================
---
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
(original)
+++
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
Mon May 14 20:41:59 2012
@@ -35,8 +35,10 @@ import javax.xml.ws.Response;
import javax.xml.ws.Service;
+import org.apache.cxf.BusFactory;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.staxutils.StaxUtils;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
import org.apache.cxf.testutil.common.TestUtil;
@@ -66,7 +68,6 @@ public class DispatchClientServerWithHug
+
TestUtil.getPortNumber(DispatchClientServerWithHugeResponseTest.class)
+ "/SOAPDispatchService/SoapDispatchPort";
ep = Endpoint.publish(address, implementor);
-
}
@Override
public void tearDown() {
@@ -93,8 +94,8 @@ public class DispatchClientServerWithHug
@org.junit.Before
public void setUp() throws Exception {
-
System.setProperty("org.apache.cxf.staxutils.innerElementLevelThreshold", "12");
-
System.setProperty("org.apache.cxf.staxutils.innerElementCountThreshold", "12");
+ StaxUtils.setInnerElementCountThreshold(12);
+ StaxUtils.setInnerElementLevelThreshold(12);
createBus();
getBus().getOutInterceptors().add(new LoggingOutInterceptor());
getBus().getInInterceptors().add(new LoggingInInterceptor());
@@ -102,8 +103,8 @@ public class DispatchClientServerWithHug
@AfterClass
public static void cleanup() throws Exception {
-
System.clearProperty("org.apache.cxf.staxutils.innerElementLevelThreshold");
-
System.clearProperty("org.apache.cxf.staxutils.innerElementCountThreshold");
+ StaxUtils.setInnerElementCountThreshold(-1);
+ StaxUtils.setInnerElementLevelThreshold(-1);
}
@Test
@@ -181,7 +182,7 @@ public class DispatchClientServerWithHug
}
@Test
- public void testElementCountThresholdfForSOAPMessageWithHugeResponse()
throws Exception {
+ public void testElementCountThresholdfForSOAPMessageWithHugeResponse()
throws Throwable {
HugeResponseInterceptor hugeResponseInterceptor =
new
HugeResponseInterceptor(ResponseInterceptorType.ElementCountThreshold);
getBus().getInInterceptors().add(hugeResponseInterceptor);
@@ -211,6 +212,12 @@ public class DispatchClientServerWithHug
fail("We should not have encountered a timeout, "
+ "should get some exception tell me stackoverflow");
} catch (Throwable e) {
+ if (e.getCause() == null) {
+ throw e;
+ }
+ if (e.getCause().getMessage() == null) {
+ throw e;
+ }
assertTrue(e.getCause().getMessage().startsWith("reach the
innerElementCountThreshold"));
} finally {
getBus().getInInterceptors().remove(hugeResponseInterceptor);
Modified:
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithMalformedResponseTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithMalformedResponseTest.java?rev=1338391&r1=1338390&r2=1338391&view=diff
==============================================================================
---
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithMalformedResponseTest.java
(original)
+++
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithMalformedResponseTest.java
Mon May 14 20:41:59 2012
@@ -60,6 +60,7 @@ public class DispatchClientServerWithMal
public static class Server extends AbstractBusTestServerBase {
Endpoint ep;
protected void run() {
+ setBus(BusFactory.getDefaultBus());
Object implementor = new GreeterImpl();
String address = "http://localhost:"
+
TestUtil.getPortNumber(DispatchClientServerWithMalformedResponseTest.class)
@@ -86,14 +87,16 @@ public class DispatchClientServerWithMal
@BeforeClass
public static void startServers() throws Exception {
+ createStaticBus();
assertTrue("server did not launch correctly",
launchServer(Server.class, true));
}
@org.junit.Before
public void setUp() {
- BusFactory.getDefaultBus().getOutInterceptors().add(new
LoggingOutInterceptor());
- BusFactory.getDefaultBus().getInInterceptors().add(new
LoggingInInterceptor());
- BusFactory.getDefaultBus().getInInterceptors().add(new
MalformedResponseInterceptor());
+ BusFactory.setThreadDefaultBus(getStaticBus());
+ BusFactory.getThreadDefaultBus().getOutInterceptors().add(new
LoggingOutInterceptor());
+ BusFactory.getThreadDefaultBus().getInInterceptors().add(new
LoggingInInterceptor());
+ BusFactory.getThreadDefaultBus().getInInterceptors().add(new
MalformedResponseInterceptor());
}
private void waitForFuture(Future<?> fd) throws Exception {
Modified:
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchXMLClientServerTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchXMLClientServerTest.java?rev=1338391&r1=1338390&r2=1338391&view=diff
==============================================================================
---
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchXMLClientServerTest.java
(original)
+++
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchXMLClientServerTest.java
Mon May 14 20:41:59 2012
@@ -54,7 +54,7 @@ public class DispatchXMLClientServerTest
private static String port =
TestUtil.getPortNumber(DispatchXMLClientServerTest.class);
@BeforeClass
public static void startServers() throws Exception {
-
+ createStaticBus();
assertTrue("server did not launch correctly",
launchServer(Server.class, true));
}
Modified:
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/Server.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/Server.java?rev=1338391&r1=1338390&r2=1338391&view=diff
==============================================================================
---
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/Server.java
(original)
+++
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/Server.java
Mon May 14 20:41:59 2012
@@ -22,6 +22,7 @@ package org.apache.cxf.systest.dispatch;
import javax.xml.ws.Endpoint;
+import org.apache.cxf.BusFactory;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
import org.apache.cxf.testutil.common.TestUtil;
import org.apache.hello_world_xml_http.wrapped.GreeterImpl;
@@ -31,6 +32,7 @@ public class Server extends AbstractBusT
Endpoint ep;
protected void run() {
+ setBus(BusFactory.getDefaultBus());
Object implementor = new GreeterImpl();
String address = "http://localhost:"
+ TestUtil.getPortNumber(DispatchXMLClientServerTest.class)
Modified:
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AddNumbersServiceUnwrap.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AddNumbersServiceUnwrap.java?rev=1338391&r1=1338390&r2=1338391&view=diff
==============================================================================
---
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AddNumbersServiceUnwrap.java
(original)
+++
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AddNumbersServiceUnwrap.java
Mon May 14 20:41:59 2012
@@ -18,7 +18,6 @@
*/
package org.apache.cxf.systest.handlers;
-import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -31,22 +30,12 @@ import javax.xml.ws.WebServiceFeature;
targetNamespace = "http://apache.org/handlers")
public class AddNumbersServiceUnwrap extends Service {
- public static final URL WSDL_LOCATION;
+ public static final URL WSDL_LOCATION = null;
public static final QName SERVICE = new QName("http://apache.org/handlers",
"AddNumbersService");
public static final QName ADD_NUMBERS_PORT = new
QName("http://apache.org/handlers",
"AddNumbersPort");
- static {
- URL url = null;
- try {
- url = new URL("/wsdl/addNumbers.wsdl");
- } catch (MalformedURLException e) {
- System.err.println("Can not initialize the default wsdl "
- + "from
file:testutils/src/main/resources/wsdl/addNumbers.wsdl");
- // e.printStackTrace();
- }
- WSDL_LOCATION = url;
- }
+
public AddNumbersServiceUnwrap(URL wsdlLocation) {
super(wsdlLocation, SERVICE);