Author: asoldano
Date: 2015-02-16 07:04:49 -0500 (Mon, 16 Feb 2015)
New Revision: 19462
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCaseForked.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpointReference/EndpointReferenceTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/holder/HolderTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1505/JBWS1505TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1798/JBWS1798TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1843/JBWS1843TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2009/JBWS2009TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2528/JBWS2528TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2529/JBWS2529TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2591/JBWS2591TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2593/JBWS2593TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3477/JaxWsSpiProviderTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBareTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumeScriptTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProvideScriptTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorTestCase.java
Log:
[JBWS-3668] Proper init and cleanup ports: use @Before/@AfterClass instead of manually
calling old-style setUp/tearDown JUnit methods
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCaseForked.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCaseForked.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -71,9 +71,7 @@
@RunAsClient
public void test() throws Exception
{
- setUp();
assertEquals("1", runTestInContainer("testSpringBus"));
- tearDown();
}
private String runTestInContainer(String test) throws Exception
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -57,6 +57,7 @@
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.littleshoot.proxy.ChainedProxy;
@@ -234,8 +235,8 @@
.start();
}
- @Override
- protected void tearDown() throws Exception
+ @After
+ public void teardown() throws Exception
{
clearProxySystemProperties();
if (proxyServer != null)
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -46,9 +46,6 @@
@RunWith(Arquillian.class)
public class AnonymousTestCase extends JBossWSTest
{
- private String targetNS = "http://anonymous.jaxws.ws.test.jboss.org/";
- private Anonymous proxy;
-
@ArquillianResource
private URL baseURL;
@@ -66,23 +63,16 @@
}
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- QName serviceName = new QName(targetNS, "AnonymousService");
- URL wsdlURL = new URL(baseURL + "AnonymousService?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- proxy = (Anonymous) service.getPort(Anonymous.class);
- }
-
@Test
@RunAsClient
public void testEcho() throws Exception
{
- setUp();
+ QName serviceName = new
QName("http://anonymous.jaxws.ws.test.jboss.org/",
"AnonymousService");
+ URL wsdlURL = new URL(baseURL + "AnonymousService?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Anonymous proxy = (Anonymous) service.getPort(Anonymous.class);
+
AnonymousRequest req = new AnonymousRequest();
req.message = "echo123";
assertEquals("echo123", proxy.echoAnonymous(req).message);
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpointReference/EndpointReferenceTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpointReference/EndpointReferenceTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpointReference/EndpointReferenceTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -43,6 +43,8 @@
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.ws.common.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.w3c.dom.Element;
@@ -58,11 +60,11 @@
@RunWith(Arquillian.class)
public class EndpointReferenceTestCase extends JBossWSTest
{
- private static final String WSDL_NS =
"http://org.jboss.ws/endpointReference";
- private static final QName SERVICE_QNAME = new QName(WSDL_NS,
"EndpointService");
- private static final QName PORT_QNAME = new QName(WSDL_NS, "EndpointPort");
+ private final String WSDL_NS = "http://org.jboss.ws/endpointReference";
+ private final QName SERVICE_QNAME = new QName(WSDL_NS, "EndpointService");
+ private final QName PORT_QNAME = new QName(WSDL_NS, "EndpointPort");
- private Service service;
+ private static Service service;
@ArquillianResource
private URL baseURL;
@@ -77,18 +79,25 @@
return archive;
}
- public void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- URL wsdlURL = new URL(baseURL + "/jaxws-endpointReference?wsdl");
- this.service = Service.create(wsdlURL, SERVICE_QNAME);
+ if (service == null) {
+ URL wsdlURL = new URL(baseURL + "/jaxws-endpointReference?wsdl");
+ service = Service.create(wsdlURL, SERVICE_QNAME);
+ }
}
+
+ @AfterClass
+ public static void cleanup() {
+ service = null;
+ }
@Test
@RunAsClient
public void testDispatch() throws Exception
{
- setUp();
- final Dispatch<Source> dispatch = this.service.createDispatch(PORT_QNAME,
Source.class, Mode.PAYLOAD);
+ final Dispatch<Source> dispatch = service.createDispatch(PORT_QNAME,
Source.class, Mode.PAYLOAD);
this.validateEndpointReferences(dispatch);
}
@@ -96,8 +105,7 @@
@RunAsClient
public void testDispatchWithFeatures() throws Exception
{
- setUp();
- final Dispatch<Source> dispatch = this.service.createDispatch(PORT_QNAME,
Source.class, Mode.PAYLOAD, new AddressingFeature(false, false));
+ final Dispatch<Source> dispatch = service.createDispatch(PORT_QNAME,
Source.class, Mode.PAYLOAD, new AddressingFeature(false, false));
this.validateEndpointReferences(dispatch);
}
@@ -105,8 +113,7 @@
@RunAsClient
public void testPort() throws Exception
{
- setUp();
- final Endpoint port = this.service.getPort(Endpoint.class);
+ final Endpoint port = service.getPort(Endpoint.class);
this.validateEndpointReferences((BindingProvider)port);
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/holder/HolderTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/holder/HolderTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/holder/HolderTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,7 +50,7 @@
@RunWith(Arquillian.class)
public class HolderTestCase extends JBossWSTest
{
- private org.jboss.test.ws.jaxws.holder.Holder port;
+ private static org.jboss.test.ws.jaxws.holder.Holder port;
@ArquillianResource
private URL baseURL;
@@ -63,22 +65,27 @@
return archive;
}
-
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
- URL wsdlURL =
getResourceURL("jaxws/holder/META-INF/wsdl/HolderService.wsdl");
- QName serviceName = new
QName("http://holder.jaxws.ws.test.jboss.org/",
"HolderService");
- Service service = Service.create(wsdlURL, serviceName);
- port =
(org.jboss.test.ws.jaxws.holder.Holder)service.getPort(org.jboss.test.ws.jaxws.holder.Holder.class);
-
((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
baseURL + "/HolderService");
+ if (port == null) {
+ URL wsdlURL =
getResourceURL("jaxws/holder/META-INF/wsdl/HolderService.wsdl");
+ QName serviceName = new
QName("http://holder.jaxws.ws.test.jboss.org/", "HolderService");
+ Service service = Service.create(wsdlURL, serviceName);
+ port =
(org.jboss.test.ws.jaxws.holder.Holder)service.getPort(org.jboss.test.ws.jaxws.holder.Holder.class);
+
((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
baseURL + "/HolderService");
+ }
}
+
+ @AfterClass
+ public static void cleanup() {
+ port = null;
+ }
@Test
@RunAsClient
public void testEchoOuts() throws Exception
{
- setUp();
Holder<Integer> out1 = new Holder<Integer>();
Holder<String> out2 = new Holder<String>();
assertEquals(new Long(50), port.echoOuts(10, "Hello", 50L, out1, out2));
@@ -90,7 +97,6 @@
@RunAsClient
public void testEchoInOuts() throws Exception
{
- setUp();
Holder<Integer> inout1 = new Holder<Integer>();
Holder<String> inout2 = new Holder<String>();
inout1.value = 50;
@@ -104,7 +110,6 @@
@RunAsClient
public void testEchoMixed() throws Exception
{
- setUp();
Holder<Integer> out1 = new Holder<Integer>();
Holder<String> out2 = new Holder<String>();
Holder<Integer> inout1 = new Holder<Integer>();
@@ -122,7 +127,6 @@
@RunAsClient
public void testEchoBareOut() throws Exception
{
- setUp();
Holder<String> out = new Holder<String>();
port.echoBareOut("hi", out);
assertEquals("hi", out.value);
@@ -132,7 +136,6 @@
@RunAsClient
public void testEchoBareInOut() throws Exception
{
- setUp();
Holder<String> inout = new Holder<String>();
inout.value = "hello world!";
port.echoBareInOut(inout);
@@ -143,7 +146,6 @@
@RunAsClient
public void testInOutAdd() throws Exception
{
- setUp();
Holder<Integer> sum = new Holder<Integer>();
sum.value = 0;
port.addInOut(sum, 5);
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -22,11 +22,9 @@
package org.jboss.test.ws.jaxws.jaxbcust;
import junit.framework.TestCase;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
-
import org.jboss.ws.api.binding.BindingCustomization;
import org.jboss.ws.api.binding.JAXBBindingCustomization;
import org.jboss.wsf.spi.SPIProvider;
@@ -34,6 +32,8 @@
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointState;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* @author Heiko.Braun(a)jboss.com
@@ -44,23 +44,14 @@
@RunWith(Arquillian.class)
public class BindingCustomizationTestCase extends TestCase {
- DeploymentModelFactory deploymentModelFactory;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- deploymentModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
- }
-
@Test
@RunAsClient
@SuppressWarnings("unchecked")
public void testCustomizationWriteAccess() throws Exception
{
- setUp();
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ DeploymentModelFactory deploymentModelFactory =
spiProvider.getSPI(DeploymentModelFactory.class);
+
Endpoint endpoint = deploymentModelFactory.newHttpEndpoint(null);
BindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put("com.sun.xml.bind.defaultNamespaceRemap",
"http://org.jboss.bindingCustomization");
@@ -86,7 +77,9 @@
@SuppressWarnings("unchecked")
public void testCustomizationReadAccess() throws Exception
{
- setUp();
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ DeploymentModelFactory deploymentModelFactory =
spiProvider.getSPI(DeploymentModelFactory.class);
+
Endpoint endpoint = deploymentModelFactory.newHttpEndpoint(null);
BindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put("com.sun.xml.bind.defaultNamespaceRemap",
"http://org.jboss.bindingCustomization");
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -75,21 +75,16 @@
return archive;
}
-
-
-
@Before
- public void setUp() throws Exception {
+ public void setup() throws Exception {
// Setting the WebServiceHost to an empty string, causes the request host to be
used.
// This must be done before deploy time.
webServiceHost = (String) getServer().getAttribute(objectName,
"WebServiceHost");
getServer().setAttribute(objectName, new Attribute("WebServiceHost",
""));
- super.setUp();
deployer.deploy(WAR_DEPLOYMENT);
}
@After
- public void tearDown() throws Exception {
- super.tearDown();
+ public void cleanup() throws Exception {
deployer.undeploy(WAR_DEPLOYMENT);
getServer().setAttribute(objectName, new Attribute("WebServiceHost",
webServiceHost));
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -54,9 +54,6 @@
@RunWith(Arquillian.class)
public class JBWS1283TestCase extends JBossWSTest
{
- private final String targetNS = "http://org.jboss.test.ws/jbws1283";
- private JBWS1283Endpoint port;
-
@ArquillianResource
private URL baseURL;
@@ -74,23 +71,16 @@
return archive;
}
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- QName serviceName = new QName(targetNS, "JBWS1283Service");
- URL wsdlURL = new URL(baseURL +
"/jaxws-jbws1283/JBWS1283Service/JBWS1283EndpointImpl?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(JBWS1283Endpoint.class);
- }
-
@Test
@RunAsClient
public void testAttachmentResponse() throws Exception
{
- setUp();
+ QName serviceName = new QName("http://org.jboss.test.ws/jbws1283",
"JBWS1283Service");
+ URL wsdlURL = new URL(baseURL +
"/jaxws-jbws1283/JBWS1283Service/JBWS1283EndpointImpl?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ JBWS1283Endpoint port = service.getPort(JBWS1283Endpoint.class);
+
// Add a client-side handler that verifes existence of the attachment
BindingProvider bindingProvider = (BindingProvider)port;
@SuppressWarnings("rawtypes")
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -48,9 +48,6 @@
@RunWith(Arquillian.class)
public class JBWS1357TestCase extends JBossWSTest
{
- private String targetNS = "http://jbws1357.jaxws.ws.test.jboss.org/";
- private JBWS1357 proxy;
-
@ArquillianResource
private URL baseURL;
@@ -66,23 +63,15 @@
return archive;
}
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- QName serviceName = new QName(targetNS, "JBWS1357Service");
- URL wsdlURL = new URL(baseURL + "/JBWS1357Service?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- proxy = (JBWS1357)service.getPort(JBWS1357.class);
- }
-
@Test
@RunAsClient
public void testEcho() throws Exception
{
- setUp();
+ QName serviceName = new
QName("http://jbws1357.jaxws.ws.test.jboss.org/",
"JBWS1357Service");
+ URL wsdlURL = new URL(baseURL + "/JBWS1357Service?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ JBWS1357 proxy = (JBWS1357)service.getPort(JBWS1357.class);
+
assertEquals("hi there", proxy.echo("hi there"));
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1505/JBWS1505TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1505/JBWS1505TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1505/JBWS1505TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -36,6 +36,8 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -45,9 +47,8 @@
@RunWith(Arquillian.class)
public class JBWS1505TestCase extends JBossWSTest
{
- private final String targetNS = "http://org.jboss.test.ws/jbws1505";
- private Interface2 port;
- private URL wsdlURL;
+ private static Interface2 port;
+ private static URL wsdlURL;
@ArquillianResource
private URL baseURL;
@@ -64,24 +65,23 @@
return archive;
}
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
- QName serviceName = new QName(targetNS, "JBWS1505Service");
- wsdlURL = new URL(baseURL +
"/jaxws-jbws1505/JBWS1505Service/JBWS1505EndpointImpl?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(Interface2.class);
+ if (port == null) {
+ QName serviceName = new QName("http://org.jboss.test.ws/jbws1505",
"JBWS1505Service");
+ wsdlURL = new URL(baseURL +
"/jaxws-jbws1505/JBWS1505Service/JBWS1505EndpointImpl?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(Interface2.class);
+ }
}
- @Override
- protected void tearDown() throws Exception
+ @AfterClass
+ public static void cleanup() throws Exception
{
wsdlURL = null;
port = null;
- super.tearDown();
}
/**
@@ -93,7 +93,6 @@
@RunAsClient
public void testWSDLGeneration() throws Exception
{
- setUp();
Definition wsdl =
WSDLFactory.newInstance().newWSDLReader().readWSDL(wsdlURL.toString());
Map<?, ?> services = wsdl.getAllServices();
assertTrue(services.size() == 1); // a simple port
@@ -113,7 +112,6 @@
@RunAsClient
public void testTypeInheritance() throws Exception
{
- setUp();
CustomType ct = port.getCustomType();
assertTrue(ct.getMember1() == 1);
assertTrue(ct.getMember2() == 2);
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -38,6 +38,8 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -66,32 +68,30 @@
return archive;
}
- private JBWS1529 proxy;
+ private static JBWS1529 proxy;
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
- QName serviceName = new
QName("http://jbws1529.jaxws.ws.test.jboss.org/",
"JBWS1529Service");
- URL wsdlURL = new URL(baseURL + "/TestService?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- proxy = (JBWS1529)service.getPort(JBWS1529.class);
+ if (proxy == null) {
+ QName serviceName = new
QName("http://jbws1529.jaxws.ws.test.jboss.org/", "JBWS1529Service");
+ URL wsdlURL = new URL(baseURL + "/TestService?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = (JBWS1529)service.getPort(JBWS1529.class);
+ }
}
- @Override
- protected void tearDown() throws Exception
+ @AfterClass
+ public static void cleanup() throws Exception
{
proxy = null;
- super.tearDown();
}
@Test
@RunAsClient
public void testWSDLReader() throws Exception
{
- setUp();
File wsdlFile =
getResourceFile("jaxws/jbws1529/META-INF/wsdl/JBWS1529Service.wsdl");
assertTrue(wsdlFile.exists());
@@ -105,7 +105,6 @@
@RunAsClient
public void testEcho() throws Exception
{
- setUp();
String retStr = proxy.echo("hi there");
assertEquals("hi there", retStr);
tearDown();
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -48,9 +48,6 @@
@RunWith(Arquillian.class)
public class JBWS1733TestCase extends JBossWSTest
{
- private String targetNS = "http://jbws1733.jaxws.ws.test.jboss.org/";
- private JBWS1733 proxy;
-
@ArquillianResource
private URL baseURL;
@@ -65,23 +62,16 @@
return archive;
}
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- QName serviceName = new QName(targetNS, "JBWS1733Service");
- URL wsdlURL = new URL(baseURL + "/JBWS1733Service?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- proxy = (JBWS1733)service.getPort(JBWS1733.class);
- }
-
@Test
@RunAsClient
public void testIssue() throws Exception
{
- setUp();
+ QName serviceName = new
QName("http://jbws1733.jaxws.ws.test.jboss.org/",
"JBWS1733Service");
+ URL wsdlURL = new URL(baseURL + "/JBWS1733Service?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ JBWS1733 proxy = (JBWS1733)service.getPort(JBWS1733.class);
+
((BindingProvider)proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,
true);
for (int i = 1; i <= 10; i++)
{
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1798/JBWS1798TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1798/JBWS1798TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1798/JBWS1798TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -52,9 +52,6 @@
@RunWith(Arquillian.class)
public class JBWS1798TestCase extends JBossWSTest
{
- private String targetNS = "http://jbws1798.jaxws.ws.test.jboss.org/";
- private ServiceType proxy;
-
@ArquillianResource
private URL baseURL;
@@ -72,47 +69,27 @@
return archive;
}
- @Override
- protected void setUp() throws Exception
+ @Test
+ @RunAsClient
+ public void testCountryCodesAndCurrencies() throws Exception
{
- super.setUp();
-
- QName serviceName = new QName(targetNS, "EndpointService");
+ QName serviceName = new
QName("http://jbws1798.jaxws.ws.test.jboss.org/",
"EndpointService");
URL wsdlURL = new URL(baseURL + "/Service?wsdl");
Service service = Service.create(wsdlURL, serviceName);
- proxy = service.getPort(ServiceType.class);
- }
-
- @Test
- @RunAsClient
- public void testCountryCodes() throws Exception
- {
- setUp();
+ ServiceType proxy = service.getPort(ServiceType.class);
+
Response response = proxy.getCountryCodes();
List<CountryCodeType> countryCodes = response.getCountry();
assertEquals(countryCodes.get(0), CountryCodeType.CZ);
assertEquals(countryCodes.get(1), CountryCodeType.DE);
- }
-
- @Test
- @RunAsClient
- public void testCurrencyCodes() throws Exception
- {
- setUp();
- org.jboss.test.ws.jaxws.jbws1798.generated.GetCurrencyCodesResponse.Response
response = proxy.getCurrencyCodes();
- List<CurrencyCodeType> currencyCodes = response.getCurrency();
+
+ org.jboss.test.ws.jaxws.jbws1798.generated.GetCurrencyCodesResponse.Response
response2 = proxy.getCurrencyCodes();
+ List<CurrencyCodeType> currencyCodes = response2.getCurrency();
assertEquals(currencyCodes.get(0), CurrencyCodeType.CZK);
assertEquals(currencyCodes.get(1), CurrencyCodeType.EUR);
- }
-
- @Test
- @RunAsClient
- public void test() throws Exception
- {
- setUp();
+
assertEquals(CurrencyCodeType.CZK, proxy.getCurrency(CountryCodeType.CZ));
assertEquals(CurrencyCodeType.EUR, proxy.getCurrency(CountryCodeType.DE));
}
-
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1843/JBWS1843TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1843/JBWS1843TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1843/JBWS1843TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -39,7 +39,9 @@
import org.jboss.test.ws.jaxws.jbws1843.generated.Service;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -54,12 +56,8 @@
@RunWith(Arquillian.class)
public class JBWS1843TestCase extends JBossWSTest
{
- @ArquillianResource
- private URL baseURL;
+ private static Service proxy;
- private String targetNS = "http://jbws1843.jaxws.ws.test.jboss.org/";
- private Service proxy;
-
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws1843.war");
@@ -74,17 +72,20 @@
return archive;
}
- @Before
- public void setUp() throws Exception
+ @BeforeClass
+ public static void setup() throws Exception
{
- super.setUp();
-
- QName serviceName = new QName(targetNS, "Service");
- URL wsdlURL = new URL(baseURL + "/Service?wsdl");
-
+ QName serviceName = new
QName("http://jbws1843.jaxws.ws.test.jboss.org/",
"Service");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":" +
getServerPort() + "/jaxws-jbws1843/Service?wsdl");
+
javax.xml.ws.Service service = javax.xml.ws.Service.create(wsdlURL, serviceName);
proxy = (Service)service.getPort(Service.class);
}
+
+ @AfterClass
+ public static void cleanup() {
+ proxy = null;
+ }
@Test
@RunAsClient
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -48,9 +48,6 @@
@RunWith(Arquillian.class)
public class JBWS2000TestCase extends JBossWSTest
{
-
- private FileTransferService port;
-
@ArquillianResource
private URL baseURL;
@@ -65,25 +62,18 @@
return archive;
}
- protected void setUp() throws Exception
- {
- if (port == null)
- {
- URL wsdlURL = new URL(baseURL + "/jaxws-jbws2000/FileTransfer?wsdl");
- QName serviceName = new
QName("http://service.mtom.test.net/",
"FileTransferServiceImplService");
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(FileTransferService.class);
-
- SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding();
- binding.setMTOMEnabled(true);
- }
- }
-
@Test
@RunAsClient
public void testFileTransfer() throws Exception
{
- setUp();
+ URL wsdlURL = new URL(baseURL + "/jaxws-jbws2000/FileTransfer?wsdl");
+ QName serviceName = new
QName("http://service.mtom.test.net/",
"FileTransferServiceImplService");
+ Service service = Service.create(wsdlURL, serviceName);
+ FileTransferService port = service.getPort(FileTransferService.class);
+
+ SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding();
+ binding.setMTOMEnabled(true);
+
GeneratorDataSource source = new GeneratorDataSource(1024 * 1204 * 8); //avoid
going beyond Undertow default max post size
DataHandler dh = new DataHandler(source);
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2009/JBWS2009TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2009/JBWS2009TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2009/JBWS2009TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -40,6 +40,8 @@
import org.jboss.test.ws.jaxws.jbws2009.generated.ServiceType;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,8 +54,7 @@
@RunWith(Arquillian.class)
public class JBWS2009TestCase extends JBossWSTest
{
- private String targetNS = "http://jbws2009.jaxws.ws.test.jboss.org/";
- private ServiceType proxy;
+ private static ServiceType proxy;
@ArquillianResource
private URL baseURL;
@@ -72,24 +73,27 @@
return archive;
}
-
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
+ if (proxy == null) {
+ QName serviceName = new
QName("http://jbws2009.jaxws.ws.test.jboss.org/", "EndpointService");
+ URL wsdlURL = new URL(baseURL + "/Service?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = service.getPort(ServiceType.class);
+ }
+ }
- QName serviceName = new QName(targetNS, "EndpointService");
- URL wsdlURL = new URL(baseURL + "/Service?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- proxy = service.getPort(ServiceType.class);
+ @AfterClass
+ public static void cleanup() {
+ proxy = null;
}
-
+
@Test
@RunAsClient
public void testCountryCodes() throws Exception
{
- setUp();
Response response = proxy.getCountryCodes();
List<CountryCodeType> countryCodes = response.getCountry();
assertEquals(countryCodes.get(0), CountryCodeType.CZ);
@@ -100,7 +104,6 @@
@RunAsClient
public void testCurrencyCodes() throws Exception
{
- setUp();
org.jboss.test.ws.jaxws.jbws2009.generated.GetCurrencyCodesResponse.Response
response = proxy.getCurrencyCodes();
List<CurrencyCodeType> currencyCodes = response.getCurrency();
assertEquals(currencyCodes.get(0), CurrencyCodeType.CZK);
@@ -111,7 +114,6 @@
@RunAsClient
public void test() throws Exception
{
- setUp();
assertEquals(CurrencyCodeType.CZK, proxy.getCurrency(CountryCodeType.CZ));
assertEquals(CurrencyCodeType.EUR, proxy.getCurrency(CountryCodeType.DE));
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -57,6 +57,7 @@
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -153,19 +154,17 @@
if (!containerController.isStarted(ADDRESS_REWRITE_SERVER)) {
containerController.start(ADDRESS_REWRITE_SERVER);
}
- }
-
- public void setUp() throws Exception {
+
modifySOAPAddress = (Boolean) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"ModifySOAPAddress");
webServiceHost = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServiceHost");
webServicePort = (Integer) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServicePort");
webServiceSecurePort = (Integer)
getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceSecurePort");
webServicePath = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServicePathRewriteRule");
webServiceUriScheme = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServiceUriScheme");
- super.setUp();
}
- public void tearDown() throws Exception
+ @After
+ public void cleanup() throws Exception
{
Attribute attr = new Attribute("ModifySOAPAddress", modifySOAPAddress);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
@@ -194,7 +193,6 @@
@RunAsClient
public void testRewrite() throws Exception
{
- setUp();
setModifySOAPAddress(true);
deployer.deploy(DEP);
try
@@ -256,7 +254,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -269,7 +266,6 @@
@RunAsClient
public void testRewriteLoadBalancer() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
@@ -325,7 +321,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -338,7 +333,6 @@
@RunAsClient
public void testAutoRewrite() throws Exception
{
- setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
deployer.deploy(DEP);
@@ -391,7 +385,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -404,7 +397,6 @@
@RunAsClient
public void testSecureRewrite() throws Exception
{
- setUp();
setModifySOAPAddress(true);
deployer.deploy(DEP_SEC);
try
@@ -457,7 +449,6 @@
finally
{
deployer.undeploy(DEP_SEC);
- tearDown();
}
}
@@ -470,7 +461,6 @@
@RunAsClient
public void testSecureRewriteLoadBalancer() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
@@ -525,7 +515,6 @@
finally
{
deployer.undeploy(DEP_SEC);
- tearDown();
}
}
@@ -538,7 +527,6 @@
@RunAsClient
public void testNoRewrite() throws Exception
{
- setUp();
setModifySOAPAddress(false);
deployer.deploy(DEP);
try
@@ -591,7 +579,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -604,7 +591,6 @@
@RunAsClient
public void testRewriteCodeFirst() throws Exception
{
- setUp();
setModifySOAPAddress(true);
deployer.deploy(DEP_CODEFIRST);
try
@@ -617,7 +603,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -630,7 +615,6 @@
@RunAsClient
public void testNoRewriteCodeFirst() throws Exception
{
- setUp();
setModifySOAPAddress(false);
deployer.deploy(DEP_CODEFIRST);
try
@@ -643,7 +627,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -656,7 +639,6 @@
@RunAsClient
public void testRewriteLoadBalancerCodeFirst() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
@@ -671,7 +653,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -684,7 +665,6 @@
@RunAsClient
public void testRewriteLoadBalancerCodeFirstForceHttps() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
@@ -700,7 +680,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -714,7 +693,6 @@
@RunAsClient
public void testNoRewriteLoadBalancerCodeFirst() throws Exception
{
- setUp();
setModifySOAPAddress(false);
final String testWebServiceHost = "myloadbalancer2.com";
setWebServiceHost(testWebServiceHost);
@@ -729,7 +707,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -742,7 +719,6 @@
@RunAsClient
public void testAutoRewriteCodeFirst() throws Exception
{
- setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
deployer.deploy(DEP_CODEFIRST);
@@ -756,7 +732,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -769,7 +744,6 @@
@RunAsClient
public void testRewriteWithPathRule() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
@@ -814,7 +788,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -827,7 +800,6 @@
@RunAsClient
public void testRewriteCodeFirstPathRule() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd =
"s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
@@ -846,7 +818,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -860,7 +831,6 @@
@RunAsClient
public void testAutoRewriteCodeFirstPathRule() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd =
"s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
@@ -885,7 +855,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
@@ -898,7 +867,6 @@
@RunAsClient
public void testAutoRewritePathRule() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
@@ -956,7 +924,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -969,7 +936,6 @@
@RunAsClient
public void testRewriteForceHttpsSchemeAndPorts() throws Exception
{
- setUp();
setModifySOAPAddress(true);
setWebServiceUriScheme("https");
setWebServiceSecurePort(8192);
@@ -1024,7 +990,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -1037,7 +1002,6 @@
@RunAsClient
public void testRewriteLoadBalancerForceHttps() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
@@ -1093,7 +1057,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -1106,7 +1069,6 @@
@RunAsClient
public void testAutoRewriteForceHttp() throws Exception
{
- setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
deployer.deploy(DEP);
@@ -1158,7 +1120,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -1171,7 +1132,6 @@
@RunAsClient
public void testSecureRewriteOverriddenByForcedHttp() throws Exception
{
- setUp();
setModifySOAPAddress(true);
setWebServiceUriScheme("http");
setWebServicePort(80);
@@ -1225,7 +1185,6 @@
finally
{
deployer.undeploy(DEP_SEC);
- tearDown();
}
}
@@ -1238,7 +1197,6 @@
@RunAsClient
public void testRewriteWithPathRuleAndForcedHttps() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
@@ -1284,7 +1242,6 @@
finally
{
deployer.undeploy(DEP);
- tearDown();
}
}
@@ -1298,7 +1255,6 @@
@RunAsClient
public void testAutoRewriteCodeFirstPathRuleAndForcedHttps() throws Exception
{
- setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd =
"s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
@@ -1325,7 +1281,6 @@
finally
{
deployer.undeploy(DEP_CODEFIRST);
- tearDown();
}
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -42,6 +42,8 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -55,8 +57,8 @@
@RunWith(Arquillian.class)
public class JBWS2278TestCase extends JBossWSTest
{
- private TestEndpoint port11;
- private TestEndpoint port12;
+ private static TestEndpoint port11;
+ private static TestEndpoint port12;
@ArquillianResource
private URL baseURL;
@@ -78,33 +80,40 @@
return archive;
}
- @Override
- public void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
- URL wsdlURL = new URL(baseURL + "/soap11?wsdl");
- QName serviceName = new QName("http://org.jboss.test.ws/jbws2278",
"TestService");
-
- Service service = Service.create(wsdlURL, serviceName);
- port11 = service.getPort(new QName("http://org.jboss.test.ws/jbws2278",
"TestEndpointSoap11Port"), TestEndpoint.class);
- port12 = service.getPort(new QName("http://org.jboss.test.ws/jbws2278",
"TestEndpointSoap12Port"), TestEndpoint.class);
-
- @SuppressWarnings("rawtypes")
- List<Handler> handlerChain11 = new ArrayList<Handler>();
- handlerChain11.add(new TestHandler(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE,
SOAPConstants.SOAP_1_1_CONTENT_TYPE));
- ((BindingProvider)port11).getBinding().setHandlerChain(handlerChain11);
-
- @SuppressWarnings("rawtypes")
- List<Handler> handlerChain12 = new ArrayList<Handler>();
- handlerChain12.add(new TestHandler(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE,
SOAPConstants.SOAP_1_2_CONTENT_TYPE));
- ((BindingProvider)port12).getBinding().setHandlerChain(handlerChain12);
+ if (port11 == null) {
+ URL wsdlURL = new URL(baseURL + "/soap11?wsdl");
+ QName serviceName = new QName("http://org.jboss.test.ws/jbws2278",
"TestService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port11 = service.getPort(new
QName("http://org.jboss.test.ws/jbws2278", "TestEndpointSoap11Port"),
TestEndpoint.class);
+ port12 = service.getPort(new
QName("http://org.jboss.test.ws/jbws2278", "TestEndpointSoap12Port"),
TestEndpoint.class);
+
+ @SuppressWarnings("rawtypes")
+ List<Handler> handlerChain11 = new ArrayList<Handler>();
+ handlerChain11.add(new TestHandler(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE,
SOAPConstants.SOAP_1_1_CONTENT_TYPE));
+ ((BindingProvider)port11).getBinding().setHandlerChain(handlerChain11);
+
+ @SuppressWarnings("rawtypes")
+ List<Handler> handlerChain12 = new ArrayList<Handler>();
+ handlerChain12.add(new TestHandler(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE,
SOAPConstants.SOAP_1_2_CONTENT_TYPE));
+ ((BindingProvider)port12).getBinding().setHandlerChain(handlerChain12);
+ }
}
+
+ @AfterClass
+ public static void cleanup()
+ {
+ port11 = null;
+ port12 = null;
+ }
@Test
@RunAsClient
public void testCallSoap11() throws Exception
{
- setUp();
final String message = "Hello!!";
String response = port11.echo(message);
assertEquals(message, response);
@@ -116,7 +125,6 @@
{
try
{
- setUp();
port11.echo(TestEndpointImpl.TEST_EXCEPTION);
fail("Expected TestException not thrown.");
}
@@ -132,7 +140,6 @@
{
try
{
- setUp();
port11.echo(TestEndpointImpl.RUNTIME_EXCEPTION);
fail("Expected Exception not thrown.");
}
@@ -146,7 +153,6 @@
@RunAsClient
public void testCallSoap12() throws Exception
{
- setUp();
final String message = "Hello!!";
String response = port12.echo(message);
assertEquals(message, response);
@@ -158,7 +164,6 @@
{
try
{
- setUp();
port12.echo(TestEndpointImpl.TEST_EXCEPTION);
fail("Expected TestException not thrown.");
}
@@ -174,7 +179,6 @@
{
try
{
- setUp();
port12.echo(TestEndpointImpl.RUNTIME_EXCEPTION);
fail("Expected Exception not thrown.");
}
@@ -183,5 +187,4 @@
assertTrue(e.getMessage().startsWith("Simulated failure"));
}
}
-
-}
+}
\ No newline at end of file
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2528/JBWS2528TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2528/JBWS2528TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2528/JBWS2528TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -35,6 +35,7 @@
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -59,11 +60,9 @@
private String CLASSES_DIR;
private String TEST_DIR;
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
JBOSS_HOME = System.getProperty("jboss.home");
CLASSES_DIR = System.getProperty("test.classes.directory");
ENDPOINT_CLASS = "org.jboss.test.ws.jaxws.jbws2528.JBWS2528Endpoint";
@@ -74,7 +73,6 @@
@RunAsClient
public void test() throws Exception
{
- setUp();
File destDir = new File(TEST_DIR, "wsprovide" + FS + "java");
String absOutput = destDir.getAbsolutePath();
String command = JBOSS_HOME + FS + "bin" + FS + "wsprovide" +
EXT + " -k -w -o " + absOutput + " --classpath " + CLASSES_DIR +
" " + ENDPOINT_CLASS;
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2529/JBWS2529TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2529/JBWS2529TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2529/JBWS2529TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -31,6 +31,7 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.ws.common.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.w3c.dom.Element;
@@ -45,10 +46,10 @@
@RunWith(Arquillian.class)
public class JBWS2529TestCase extends JBossWSTest
{
- private static final String FS = System.getProperty("file.separator"); //
'/' on unix, '\' on windows
- private static final String PS = System.getProperty("path.separator"); //
':' on unix, ';' on windows
- private static final String EXT = ":".equals( PS ) ? ".sh" :
".bat";
- private static final String XML_SCHEMA_NS =
"http://www.w3.org/2001/XMLSchema";
+ private final String FS = System.getProperty("file.separator"); //
'/' on unix, '\' on windows
+ private final String PS = System.getProperty("path.separator"); //
':' on unix, ';' on windows
+ private final String EXT = ":".equals( PS ) ? ".sh" :
".bat";
+ private final String XML_SCHEMA_NS = "http://www.w3.org/2001/XMLSchema";
private String ENDPOINT_CLASS;
@@ -56,10 +57,9 @@
private String CLASSES_DIR;
private String TEST_DIR;
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
JBOSS_HOME = System.getProperty("jboss.home");
CLASSES_DIR = System.getProperty("test.classes.directory");
ENDPOINT_CLASS = "org.jboss.test.ws.jaxws.jbws2529.JBWS2529Endpoint";
@@ -70,7 +70,6 @@
@RunAsClient
public void test() throws Exception
{
- setUp();
File destDir = new File(TEST_DIR, "wsprovide" + FS + "java");
String absOutput = destDir.getAbsolutePath();
String command = JBOSS_HOME + FS + "bin" + FS + "wsprovide" +
EXT + " -k -w -o " + absOutput + " --classpath " + CLASSES_DIR +
" " + ENDPOINT_CLASS;
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2591/JBWS2591TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2591/JBWS2591TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2591/JBWS2591TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -28,6 +28,7 @@
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -51,10 +52,9 @@
private String JBOSS_HOME;
private String TEST_DIR;
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
JBOSS_HOME = System.getProperty("jboss.home");
TEST_DIR = createResourceFile("..").getAbsolutePath();
}
@@ -64,7 +64,6 @@
@RunAsClient
public void testWSConsumeFromCommandLine() throws Exception
{
- setUp();
// use absolute path for the output to be re-usable
String absWsdlLoc = getResourceFile(WSDL_LOCATION).getAbsolutePath();
String absOutput = new File(TEST_DIR, "wsconsume" + FS +
"java").getAbsolutePath();
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2593/JBWS2593TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2593/JBWS2593TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2593/JBWS2593TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -25,11 +25,12 @@
import java.io.File;
import java.io.FileReader;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.jboss.arquillian.container.test.api.RunAsClient;
-import org.jboss.arquillian.junit.Arquillian;
/**
* [JBWS-2593] WSConsume does not generate @XmlJavaTypeAdapter in SEI
@@ -53,10 +54,9 @@
private String JBOSS_HOME;
private String TEST_DIR;
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
JBOSS_HOME = System.getProperty("jboss.home");
TEST_DIR = createResourceFile("..").getAbsolutePath();
}
@@ -65,7 +65,6 @@
@RunAsClient
public void testRPC() throws Exception
{
- setUp();
this.internalTest(true);
}
@@ -73,7 +72,6 @@
@RunAsClient
public void testDOC() throws Exception
{
- setUp();
this.internalTest(false);
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -29,6 +29,8 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.jboss.arquillian.container.test.api.RunAsClient;
@@ -48,11 +50,9 @@
protected abstract String getEndpointAddress();
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
QName serviceName = new
QName("http://jboss.org/jbws2934",
"EndpointService");
URL wsdlURL = new URL(getEndpointAddress() + "?wsdl");
@@ -64,12 +64,18 @@
((BindingProvider)proxies[i]).getRequestContext().put("thread.local.request.context",
"true");
}
}
+
+ @After
+ public void cleanup() {
+ for (int i = 0; i < THREADS_COUNT; i++) {
+ proxies[i] = null;
+ }
+ }
@Test
@RunAsClient
public void testEndpointConcurrently() throws Exception
{
- setUp();
boolean traceEnabled = log.isTraceEnabled();
for (int i = 0; i < THREADS_COUNT; i++)
{
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -43,13 +43,11 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.logging.Logger;
-import org.jboss.shrinkwrap.api.ArchivePath;
-import org.jboss.shrinkwrap.api.Filter;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.ws.common.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -64,23 +62,21 @@
@RunWith(Arquillian.class)
public final class JBWS2937TestCase extends JBossWSTest
{
- private static final WebServiceFeature[] ADDRESSING_ENABLED = { new
AddressingFeature(true) };
- private static final WebServiceFeature[] ADDRESSING_DISABLED = { new
AddressingFeature(false) };
- private static final String NAMESPACE_URI = "http://jboss.org/jbws2937";
- private static final String XML = "<ns1:echo
xmlns:ns1='http://jboss.org/jbws2937'>" +
+ private final WebServiceFeature[] ADDRESSING_ENABLED = { new AddressingFeature(true)
};
+ private final WebServiceFeature[] ADDRESSING_DISABLED = { new AddressingFeature(false)
};
+ private final String NAMESPACE_URI = "http://jboss.org/jbws2937";
+ private final String XML = "<ns1:echo
xmlns:ns1='http://jboss.org/jbws2937'>" +
" <arg0>" +
" <string>Kermit</string>" +
" <qname>TheFrog</qname>" +
" </arg0>" +
"</ns1:echo>";
- private static final QName SERVICE_QNAME = new QName(NAMESPACE_URI,
"EndpointService");
- private static final QName PORT_QNAME = new QName(NAMESPACE_URI,
"EndpointPort");
- private Service service;
- private Endpoint proxy;
- private EndpointReference epr;
- private UserType user;
+ private final QName SERVICE_QNAME = new QName(NAMESPACE_URI,
"EndpointService");
+ private final QName PORT_QNAME = new QName(NAMESPACE_URI, "EndpointPort");
+ private static Service service;
+ private static Endpoint proxy;
+ private static EndpointReference epr;
-
@ArquillianResource
private URL baseURL;
@@ -93,74 +89,88 @@
.addClass(org.jboss.test.ws.jaxws.jbws2937.UserType.class);
return archive;
}
+
@Before
- public void setUp() throws Exception
+ public void setup() throws Exception
{
- super.setUp();
- URL wsdlURL = new URL("http://" + baseURL.getHost() + ":" +
baseURL.getPort() + "/jaxws-jbws2937" + "?wsdl");
- this.service = EndpointService.create(wsdlURL, SERVICE_QNAME);
- this.proxy = (Endpoint)this.service.getPort(PORT_QNAME, Endpoint.class);
- this.epr = ((BindingProvider)this.proxy).getEndpointReference();
- // prepare request object
- this.user = new UserType();
- this.user.setString("Kermit");
- this.user.setQname(new QName("TheFrog"));
+ if (service == null) {
+ URL wsdlURL = new URL("http://" + baseURL.getHost() + ":" +
baseURL.getPort() + "/jaxws-jbws2937" + "?wsdl");
+ service = EndpointService.create(wsdlURL, SERVICE_QNAME);
+ proxy = (Endpoint)service.getPort(PORT_QNAME, Endpoint.class);
+ epr = ((BindingProvider)proxy).getEndpointReference();
+ }
}
+
+ @AfterClass
+ public static void cleanup() {
+ epr = null;
+ proxy = null;
+ service = null;
+ }
@Test
@RunAsClient
public void testProxy() throws Exception
{
- final UserType response = this.proxy.echo(this.user);
- assertEquals(this.user, response);
+ final UserType user = createUser();
+ final UserType response = proxy.echo(user);
+ assertEquals(user, response);
}
@Test
@RunAsClient
public void testCreateDispatchUsingEPRAndSource() throws Exception
{
- Dispatch<Source> dispatch = this.service.createDispatch(PORT_QNAME,
Source.class, Mode.PAYLOAD);
+ Dispatch<Source> dispatch = service.createDispatch(PORT_QNAME, Source.class,
Mode.PAYLOAD);
assertNotNull("Dispatch is null", dispatch);
this.invokeSourceDispatch(dispatch);
- this.epr = dispatch.getEndpointReference();
- printEPR(this.epr);
+ epr = dispatch.getEndpointReference();
+ printEPR(epr);
- dispatch = this.service.createDispatch(this.epr, Source.class,
Service.Mode.PAYLOAD, ADDRESSING_ENABLED);
+ dispatch = service.createDispatch(epr, Source.class, Service.Mode.PAYLOAD,
ADDRESSING_ENABLED);
assertNotNull("Dispatch is null", dispatch);
this.invokeSourceDispatch(dispatch);
- this.epr = dispatch.getEndpointReference();
- printEPR(this.epr);
+ epr = dispatch.getEndpointReference();
+ printEPR(epr);
- dispatch = this.service.createDispatch(this.epr, Source.class,
Service.Mode.PAYLOAD, ADDRESSING_DISABLED);
+ dispatch = service.createDispatch(epr, Source.class, Service.Mode.PAYLOAD,
ADDRESSING_DISABLED);
assertNotNull("Dispatch is null", dispatch);
this.invokeSourceDispatch(dispatch);
- this.epr = dispatch.getEndpointReference();
- printEPR(this.epr);
+ epr = dispatch.getEndpointReference();
+ printEPR(epr);
}
@Test
@RunAsClient
public void testCreateDispatchUsingEPRAndJAXBContext() throws Exception
{
- Dispatch<Object> dispatch = this.service.createDispatch(PORT_QNAME,
this.createJAXBContext(), Mode.PAYLOAD);
+ Dispatch<Object> dispatch = service.createDispatch(PORT_QNAME,
this.createJAXBContext(), Mode.PAYLOAD);
assertNotNull("Dispatch is null", dispatch);
this.invokeObjectDispatch(dispatch);
- this.epr = dispatch.getEndpointReference();
- printEPR(this.epr);
+ epr = dispatch.getEndpointReference();
+ printEPR(epr);
- dispatch = this.service.createDispatch(this.epr, this.createJAXBContext(),
Service.Mode.PAYLOAD, ADDRESSING_ENABLED);
+ dispatch = service.createDispatch(epr, this.createJAXBContext(),
Service.Mode.PAYLOAD, ADDRESSING_ENABLED);
assertNotNull("Dispatch is null", dispatch);
this.invokeObjectDispatch(dispatch);
- this.epr = dispatch.getEndpointReference();
- printEPR(this.epr);
+ epr = dispatch.getEndpointReference();
+ printEPR(epr);
- dispatch = this.service.createDispatch(this.epr, this.createJAXBContext(),
Service.Mode.PAYLOAD, ADDRESSING_DISABLED);
+ dispatch = service.createDispatch(epr, this.createJAXBContext(),
Service.Mode.PAYLOAD, ADDRESSING_DISABLED);
assertNotNull("Dispatch is null", dispatch);
this.invokeObjectDispatch(dispatch);
- this.epr = dispatch.getEndpointReference();
- printEPR(this.epr);
+ epr = dispatch.getEndpointReference();
+ printEPR(epr);
}
+ private UserType createUser() {
+ // prepare request object
+ UserType user = new UserType();
+ user.setString("Kermit");
+ user.setQname(new QName("TheFrog"));
+ return user;
+ }
+
private JAXBContext createJAXBContext()
{
try
@@ -176,9 +186,10 @@
private void invokeObjectDispatch(final Dispatch<Object> dispatch) throws
Exception
{
Echo request = new Echo();
- request.setArg0(this.user);
+ final UserType user = createUser();
+ request.setArg0(user);
EchoResponse response = (EchoResponse)dispatch.invoke(request);
- assertEquals(response.getReturn(), this.user);
+ assertEquals(response.getReturn(), user);
}
private void invokeSourceDispatch(final Dispatch<Source> dispatch) throws
Exception
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2015, 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.
*
@@ -33,15 +33,14 @@
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
-import junit.framework.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
-
import org.jboss.ws.api.util.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
import org.w3c.dom.Element;
/**
@@ -52,15 +51,15 @@
@RunWith(Arquillian.class)
public class JBWS2960TestCase extends JBossWSTest
{
- private static final QName WSAM_ACTION_QNAME = new
QName("http://www.w3.org/2007/05/addressing/metadata", "Action");
- private static final QName WSAM_ADDRESSING_QNAME = new
QName("http://www.w3.org/2007/05/addressing/metadata", "Addressing");
- private static final QName WSAM_NON_ANONYMOUS_RESPONSES_QNAME = new
QName("http://www.w3.org/2007/05/addressing/metadata",
"NonAnonymousResponses");
- private static final QName POLICY_QNAME = new
QName("http://www.w3.org/ns/ws-policy", "Policy");
- private static final QName POLICY_REFERENCE_QNAME = new
QName("http://www.w3.org/ns/ws-policy", "PolicyReference");
+ private final QName WSAM_ACTION_QNAME = new
QName("http://www.w3.org/2007/05/addressing/metadata", "Action");
+ private final QName WSAM_ADDRESSING_QNAME = new
QName("http://www.w3.org/2007/05/addressing/metadata", "Addressing");
+ private final QName WSAM_NON_ANONYMOUS_RESPONSES_QNAME = new
QName("http://www.w3.org/2007/05/addressing/metadata",
"NonAnonymousResponses");
+ private final QName POLICY_QNAME = new
QName("http://www.w3.org/ns/ws-policy", "Policy");
+ private final QName POLICY_REFERENCE_QNAME = new
QName("http://www.w3.org/ns/ws-policy", "PolicyReference");
private final File wsdlFile =
JBossWSTestHelper.getResourceFile("jaxws/jbws2960/AddNumbersService.wsdl");
- @Override
- public void setUp()
+ @Before
+ public void setup()
{
assertNotNull("WSDL not found", wsdlFile);
assertTrue("WSDL doesn't exist", wsdlFile.exists());
@@ -93,7 +92,6 @@
@RunAsClient
public void testPolicyReference() throws Exception
{
- setUp();
Definition wsdl = getWSDLDefinition(wsdlFile.getAbsolutePath());
List<?> definitionExtElements = wsdl.getExtensibilityElements();
QName serviceQName = new
QName("http://foobar.org/",
"AddNumbersService");
@@ -119,7 +117,6 @@
@RunAsClient
public void testOperations() throws Exception
{
- setUp();
Definition wsdl = getWSDLDefinition(wsdlFile.getAbsolutePath());
PortType port = wsdl.getPortType(new
QName("http://foobar.org/",
"AddNumbers"));
Operation operation = null;
@@ -219,8 +216,8 @@
QName wsamValue =
(QName)operation.getInput().getExtensionAttribute(WSAM_ACTION_QNAME);
log.debug("Validating input of operation " + operation.getName());
- Assert.assertNotNull("No WSAM attr", wsamValue);
- Assert.assertEquals("Wrong WSAM attr. value", expectedValue,
wsamValue.getLocalPart());
+ assertNotNull("No WSAM attr", wsamValue);
+ assertEquals("Wrong WSAM attr. value", expectedValue,
wsamValue.getLocalPart());
}
private void assertOutput(final Operation operation, final String expectedValue)
@@ -228,8 +225,8 @@
QName wsamValue =
(QName)operation.getOutput().getExtensionAttribute(WSAM_ACTION_QNAME);
log.debug("Validating output of operation " + operation.getName());
- Assert.assertNotNull("No WSAM attr", wsamValue);
- Assert.assertEquals("Wrong WSAM attr. value", expectedValue,
wsamValue.getLocalPart());
+ assertNotNull("No WSAM attr", wsamValue);
+ assertEquals("Wrong WSAM attr. value", expectedValue,
wsamValue.getLocalPart());
}
private void assertFault(final Operation operation, final String expectedValue, final
String faultName)
@@ -237,8 +234,8 @@
QName wsamValue =
(QName)operation.getFault(faultName).getExtensionAttribute(WSAM_ACTION_QNAME);
log.debug("Validating fault '" + faultName + "' of operation
" + operation.getName());
- Assert.assertNotNull("No WSAM attr", wsamValue);
- Assert.assertEquals("Wrong WSAM attr. value", expectedValue,
wsamValue.getLocalPart());
+ assertNotNull("No WSAM attr", wsamValue);
+ assertEquals("Wrong WSAM attr. value", expectedValue,
wsamValue.getLocalPart());
}
private Definition getWSDLDefinition(final String wsdlLocation) throws Exception
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -53,8 +53,6 @@
@RunWith(Arquillian.class)
public class JBWS2978TestCase extends JBossWSTest
{
- public Service service = null;
-
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws2978.war");
@@ -69,20 +67,10 @@
return archive;
}
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
- URL wsdlURL = new URL("http://" + getServerHost() + ":" +
getServerPort() + "/jaxws-jbws2978" + "?wsdl");
- QName serviceName = new QName("http://ws.jboss.org",
"AddNumbers");
- service = Service.create(wsdlURL, serviceName);
- }
-
@Test
@RunAsClient
public void testCall() throws Exception
{
- setUp();
String text = "http://" + getServerHost() + ":" +
getServerPort() + "/jaxws-jbws2978";
String requestMessage = "<S:Envelope
xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'><S:Head...
xmlns='http://www.w3.org/2005/08/addressing'>"
+ text
@@ -91,6 +79,10 @@
+ "<ReplyTo
xmlns='http://www.w3.org/2005/08/addressing'><Address>ht...
+ "</S:Header><S:Body><ns1:addNumbers
xmlns:ns1='http://ws.jboss.org'><arg0>10</arg0><arg1>10</arg1></ns1:addNumbers></S:Body></S:Envelope>";
+ URL wsdlURL = new URL(text + "?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org",
"AddNumbers");
+ Service service = Service.create(wsdlURL, serviceName);
+
try
{
Dispatch<SOAPMessage> dispatch = service.createDispatch(new
QName("http://ws.jboss.org", "AddNumbersPort"), SOAPMessage.class ,
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -22,7 +22,6 @@
package org.jboss.test.ws.jaxws.jbws3131;
import java.io.IOException;
-import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
@@ -30,37 +29,31 @@
import javax.xml.ws.Service;
import javax.xml.ws.Service.Mode;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.jboss.arquillian.container.test.api.RunAsClient;
-import org.jboss.arquillian.junit.Arquillian;
@RunWith(Arquillian.class)
public class JBWS3131TestCase extends JBossWSTest
{
- private URL WSDLUrl;
- private URL changedWSDLUrl;
private Service service;
private Service serviceChanged;
+ @Before
public void setUp() throws IOException
{
- WSDLUrl = getResourceURL("jaxws/jbws3131/NfeStatusServico2.wsdl");
- changedWSDLUrl =
getResourceURL("jaxws/jbws3131/NfeStatusServico21.wsdl");
-
QName serviceName = new
QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2",
"NfeStatusServico2");
- service = Service.create(WSDLUrl, serviceName);
-
- serviceName = new
QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2",
"NfeStatusServico2");
- serviceChanged = Service.create(changedWSDLUrl, serviceName);
+ service =
Service.create(getResourceURL("jaxws/jbws3131/NfeStatusServico2.wsdl"),
serviceName);
+ serviceChanged =
Service.create(getResourceURL("jaxws/jbws3131/NfeStatusServico21.wsdl"),
serviceName);
}
@Test
@RunAsClient
public void testSOAP11OnOriginalWSDL() throws IOException
{
- setUp();
QName portName = new
QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2",
"NfeStatusServico2Soap");
Dispatch<Source> dispatch = service.createDispatch(portName, Source.class,
Mode.MESSAGE);
String bindingID = dispatch.getBinding().getBindingID();
@@ -71,7 +64,6 @@
@RunAsClient
public void testSOAP12OnOriginalWSDL() throws IOException
{
- setUp();
QName portName = new
QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2",
"NfeStatusServico2Soap12");
Dispatch<Source> dispatch = service.createDispatch(portName, Source.class,
Mode.MESSAGE);
String bindingID = dispatch.getBinding().getBindingID();
@@ -82,7 +74,6 @@
@RunAsClient
public void testSOAP11OnChangedWSDL() throws IOException
{
- setUp();
QName portName = new
QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2",
"NfeStatusServico2Soap1");
Dispatch<Source> dispatch = serviceChanged.createDispatch(portName,
Source.class, Mode.MESSAGE);
String bindingID = dispatch.getBinding().getBindingID();
@@ -93,7 +84,6 @@
@RunAsClient
public void testSOAP12OnChangedWSDL() throws IOException
{
- setUp();
QName portName = new
QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2",
"NfeStatusServico2Soap12");
Dispatch<Source> dispatch = serviceChanged.createDispatch(portName,
Source.class, Mode.MESSAGE);
String bindingID = dispatch.getBinding().getBindingID();
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3477/JaxWsSpiProviderTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3477/JaxWsSpiProviderTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3477/JaxWsSpiProviderTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -47,7 +47,7 @@
@RunWith(Arquillian.class)
public class JaxWsSpiProviderTestCase extends JBossWSTest
{
- private String defaultProvider;
+ private String defaultProvider =
"org.jboss.wsf.stack.cxf.client.ProviderImpl";
@ArquillianResource
private URL baseURL;
@@ -74,18 +74,11 @@
return archive;
}
- protected void setUp() {
- if (isIntegrationCXF()) {
- defaultProvider = "org.jboss.wsf.stack.cxf.client.ProviderImpl";
- }
- }
-
@Test
@RunAsClient
@OperateOnDeployment("jaxws-jbws3477")
public void testClientSide()
{
- setUp();
Helper.verifyJaxWsSpiProvider(defaultProvider);
}
@@ -99,7 +92,6 @@
@OperateOnDeployment("jaxws-jbws3477")
public void testServerSideDefaultProvider() throws Exception
{
- setUp();
runServerTest(new URL(baseURL + "?provider=" + defaultProvider));
}
@@ -113,7 +105,6 @@
@OperateOnDeployment("jaxws-jbws3477-custom-provider")
public void testServerSideProviderCustomization() throws Exception
{
- setUp();
runServerTest(new URL(baseURL +
"?provider=org.jboss.test.ws.jaxws.jbws3477.DummyProvider"));
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -93,7 +93,6 @@
@RunAsClient
public void testMessageAccess() throws Exception
{
- setUp();
MessageFactory msgFactory = MessageFactory.newInstance();
SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBareTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBareTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPBareTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -34,6 +34,7 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -60,7 +61,8 @@
return DeploymentArchive.createDeployment("bare");
}
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
QName serviceName = new
QName("http://doclit.xop.samples.jaxws.ws.test.jboss.org/",
"MTOMService");
URL wsdlURL = new URL(baseURL + "bare?wsdl");
@@ -77,7 +79,6 @@
@RunAsClient
public void testDataHandlerRoundtrip() throws Exception
{
- setUp();
getBinding().setMTOMEnabled(true);
DataHandler dh = new DataHandler("DataHandlerRoundtrip",
"text/plain");
@@ -98,7 +99,6 @@
@RunAsClient
public void testDataHandlerResponseOptimzed() throws Exception
{
- setUp();
getBinding().setMTOMEnabled(false);
DataHandler dh = new DataHandler("DataHandlerResponseOptimzed",
"text/plain");
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -38,6 +38,7 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -67,8 +68,8 @@
return DeploymentArchive.createDeployment("handler");
}
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
QName serviceName = new
QName("http://doclit.xop.samples.jaxws.ws.test.jboss.org/",
"MTOMService");
URL wsdlURL = new URL(baseURL + "bare?wsdl");
@@ -91,7 +92,6 @@
@RunAsClient
public void testDataHandlerRoundtrip() throws Exception
{
- setUp();
getBinding().setMTOMEnabled(true);
DataHandler dh = new DataHandler("Client Data", "text/plain");
DHResponse response = getPort().echoDataHandler(new DHRequest(dh));
@@ -108,7 +108,6 @@
@RunAsClient
public void testDataHandlerResponseOptimzed() throws Exception
{
- setUp();
getBinding().setMTOMEnabled(false);
DataHandler dh = new DataHandler("Client data", "text/plain");
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -51,8 +51,6 @@
@RunWith(Arquillian.class)
public class XOPWrappedTestCase extends JBossWSTest
{
- private WrappedEndpoint port;
-
@ArquillianResource
private URL baseURL;
@@ -61,25 +59,19 @@
return DeploymentArchive.createDeployment("wrapped");
}
- protected void setUp() throws Exception
+ @Test
+ @RunAsClient
+ public void testParameterAnnotation() throws Exception
{
-
QName serviceName = new
QName("http://doclit.xop.samples.jaxws.ws.test.jboss.org/",
"WrappedService");
URL wsdlURL = new URL(baseURL + "wrapped?wsdl");
Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(WrappedEndpoint.class);
+ WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding();
binding.setMTOMEnabled(true);
-
- }
-
- @Test
- @RunAsClient
- public void testParameterAnnotation() throws Exception
- {
- setUp();
+
DataHandler request = new DataHandler("Client data",
"text/plain");
DataHandler response = port.parameterAnnotation(request);
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -26,6 +26,7 @@
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -53,10 +54,9 @@
public String CLASSES_DIR;
public String TEST_DIR;
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
- super.setUp();
-
JBOSS_HOME = System.getProperty("jboss.home");
CLASSES_DIR = System.getProperty("test.classes.directory");
//JBWS-2479
@@ -68,7 +68,6 @@
@RunAsClient
public void testScritpsAvailable() throws Exception
{
- setUp();
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsprovide"
+ ".sh").exists());
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsprovide"
+ ".bat").exists());
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsconsume"
+ ".sh").exists());
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumeScriptTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumeScriptTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumeScriptTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -48,7 +48,6 @@
@RunAsClient
public void testWSConsumeFromCommandLine() throws Exception
{
- super.setUp();
// use absolute path for the output to be re-usable
String absWsdlLoc = getResourceFile(WSDL_LOCATION).getAbsolutePath();
String absOutput = new File(TEST_DIR, "wsconsume" + FS +
"java").getAbsolutePath();
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCaseForked.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCaseForked.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -23,6 +23,8 @@
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -40,9 +42,9 @@
* Recreates a tools delegate for every test
* @throws Exception
*/
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
-
// JBWS-2175
setupClasspath();
@@ -50,8 +52,8 @@
setDelegate(wscClass);
}
-
- protected void tearDown() throws Exception
+ @After
+ public void teardown() throws Exception
{
restoreClasspath();
}
@@ -64,9 +66,7 @@
@RunAsClient
public void testBindingFiles() throws Exception
{
- setUp();
dispatch("testBindingFiles");
- tearDown();
}
/**
@@ -77,9 +77,7 @@
@RunAsClient
public void testCatalog() throws Exception
{
- setUp();
dispatch("testCatalog");
- tearDown();
}
/**
@@ -90,9 +88,7 @@
@RunAsClient
public void testOutputDirectory() throws Exception
{
- setUp();
dispatch("testOutputDirectory");
- tearDown();
}
/**
@@ -105,9 +101,7 @@
@RunAsClient
public void testSourceDirectory() throws Exception
{
- setUp();
dispatch("testSourceDirectory");
- tearDown();
}
@@ -119,9 +113,7 @@
@RunAsClient
public void testNoCompile() throws Exception
{
- setUp();
dispatch("testNoCompile");
- tearDown();
}
/**
@@ -131,9 +123,7 @@
@RunAsClient
public void testNoCompileNoKeep() throws Exception
{
- setUp();
dispatch("testNoCompileNoKeep");
- tearDown();
}
/**
@@ -144,9 +134,7 @@
@RunAsClient
public void testGenerateSource() throws Exception
{
- setUp();
dispatch("testGenerateSource");
- tearDown();
}
/**
@@ -158,9 +146,7 @@
@RunAsClient
public void testTargetPackage() throws Exception
{
- setUp();
dispatch("testTargetPackage");
- tearDown();
}
/**
@@ -171,9 +157,7 @@
@RunAsClient
public void testWsdlLocation() throws Exception
{
- setUp();
dispatch("testWsdlLocation");
- tearDown();
}
/**
@@ -184,9 +168,7 @@
@RunAsClient
public void testMessageStream() throws Exception
{
- setUp();
dispatch("testMessageStream");
- tearDown();
}
/**
@@ -211,9 +193,7 @@
@RunAsClient
public void testTarget() throws Exception
{
- setUp();
dispatch("testTarget");
- tearDown();
}
/**
@@ -224,9 +204,7 @@
@RunAsClient
public void testSOAP12Extension() throws Exception
{
- setUp();
dispatch("testSOAP12Extension");
- tearDown();
}
/**
@@ -236,8 +214,6 @@
@RunAsClient
public void testAdditionalHeaders() throws Exception
{
- setUp();
dispatch("testAdditionalHeaders");
- tearDown();
}
-}
+}
\ No newline at end of file
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProvideScriptTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProvideScriptTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProvideScriptTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -46,7 +46,6 @@
@RunAsClient
public void testWSProvideFromCommandLine() throws Exception
{
- super.setUp();
String absOutput = new File(TEST_DIR, "wsprovide" + FS +
"java").getAbsolutePath();
String command = JBOSS_HOME + FS + "bin" + FS + "wsprovide" +
EXT + " -k -w -o " + absOutput + " --classpath " + CLASSES_DIR +
" " + ENDPOINT_CLASS;
executeCommand(command, "wsprovide");
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCaseForked.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCaseForked.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -26,6 +26,8 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -59,7 +61,8 @@
* Recreates a tools delegate for every test
* @throws Exception
*/
- protected void setUp() throws Exception
+ @Before
+ public void setup() throws Exception
{
setupClasspath();
@@ -69,7 +72,8 @@
}
- protected void tearDown() throws Exception
+ @After
+ public void teardown() throws Exception
{
restoreClasspath();
}
@@ -78,72 +82,55 @@
@RunAsClient
public void testGenerateWsdl() throws Exception
{
- setUp();
dispatch("testGenerateWsdl");
- tearDown();
}
@Test
@RunAsClient
public void testGenerateWsdlWithExtension() throws Exception
{
- setUp();
dispatch("testGenerateWsdlWithExtension");
- tearDown();
}
@Test
@RunAsClient
public void testGenerateSource() throws Exception
{
- setUp();
dispatch("testGenerateSource");
- tearDown();
}
@Test
@RunAsClient
public void testOutputDirectory() throws Exception
{
- setUp();
dispatch("testOutputDirectory");
- tearDown();
}
@Test
@RunAsClient
public void testResourceDirectory() throws Exception
{
- setUp();
dispatch("testResourceDirectory");
- tearDown();
}
@Test
@RunAsClient
public void testSourceDirectory() throws Exception
{
- setUp();
dispatch("testSourceDirectory");
- tearDown();
}
@Test
@RunAsClient
public void testClassLoader() throws Exception
{
- setUp();
dispatch("testClassLoader");
- tearDown();
}
@Test
@RunAsClient
public void testMessageStream() throws Exception
{
- setUp();
dispatch("testMessageStream");
- tearDown();
}
-
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorTestCase.java 2015-02-16
09:02:14 UTC (rev 19461)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorTestCase.java 2015-02-16
12:04:49 UTC (rev 19462)
@@ -49,9 +49,6 @@
@ArquillianResource
private URL baseURL;
- private final String targetNS =
"http://accessor.wrapped.jaxws.ws.test.jboss.org/";
- private Accessor proxy;
-
@Deployment(testable = false)
public static WebArchive createDeployments() {
WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-wrapped-accessor.war");
@@ -67,30 +64,16 @@
return archive;
}
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- QName serviceName = new QName(targetNS, "AccessorService");
- URL wsdlURL = new URL(baseURL + "AccessorService?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- proxy = (Accessor) service.getPort(Accessor.class);
- }
-
@Test
@RunAsClient
- public void testFieldAccessor() throws Exception
+ public void testFieldAndMethodAccessors() throws Exception
{
- setUp();
+ QName serviceName = new
QName("http://accessor.wrapped.jaxws.ws.test.jboss.org/",
"AccessorService");
+ URL wsdlURL = new URL(baseURL + "AccessorService?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ Accessor proxy = (Accessor) service.getPort(Accessor.class);
+
assertEquals("ing123", proxy.fieldAccessor("ing", 123));
- }
-
- @Test
- @RunAsClient
- public void testMethodAccessor() throws Exception
- {
- setUp();
assertEquals("moretesting456",
proxy.fieldAccessor("moretesting", 456));
}
}