JBossWS SVN: r19464 - stack/cxf/branches/jbossws-cxf-4.3.x.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-16 12:00:59 -0500 (Mon, 16 Feb 2015)
New Revision: 19464
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml
Log:
Move to released Apache CXF 2.7.15
Modified: stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml 2015-02-16 13:35:34 UTC (rev 19463)
+++ stack/cxf/branches/jbossws-cxf-4.3.x/pom.xml 2015-02-16 17:00:59 UTC (rev 19464)
@@ -72,7 +72,7 @@
<wildfly800.version>8.0.0.Final</wildfly800.version>
<wildfly810.version>8.1.0.Final</wildfly810.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>2.7.15-SNAPSHOT</cxf.version>
+ <cxf.version>2.7.15</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.1</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
9 years, 10 months
JBossWS SVN: r19463 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-16 08:35:34 -0500 (Mon, 16 Feb 2015)
New Revision: 19463
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBWS-3868] Move to Apache CXF 3.0.4
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2015-02-16 12:04:49 UTC (rev 19462)
+++ stack/cxf/trunk/pom.xml 2015-02-16 13:35:34 UTC (rev 19463)
@@ -73,7 +73,7 @@
<wildfly820.version>8.2.0.Final</wildfly820.version>
<wildfly900.version>9.0.0.Alpha2-SNAPSHOT</wildfly900.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>3.0.4-SNAPSHOT</cxf.version>
+ <cxf.version>3.0.4</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>3.0.2</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
9 years, 10 months
JBossWS SVN: r19462 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy and 30 other directories.
by jbossws-commits@lists.jboss.org
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:Header><To xmlns='http://www.w3.org/2005/08/addressing'>"
+ text
@@ -91,6 +79,10 @@
+ "<ReplyTo xmlns='http://www.w3.org/2005/08/addressing'><Address>http://www.w3.org/2005/08/addressing/anonymous</Address></ReplyTo>"
+ "</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));
}
}
9 years, 10 months
JBossWS SVN: r19461 - stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/client.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-16 04:02:14 -0500 (Mon, 16 Feb 2015)
New Revision: 19461
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/client/SimpleServiceTestCase.java
Log:
[JBWS-3668] More cleanup
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/client/SimpleServiceTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/client/SimpleServiceTestCase.java 2015-02-13 16:18:51 UTC (rev 19460)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/client/SimpleServiceTestCase.java 2015-02-16 09:02:14 UTC (rev 19461)
@@ -23,28 +23,22 @@
import java.io.File;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import org.apache.cxf.endpoint.Client;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.apache.cxf.endpoint.Client;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.test.ws.jaxws.samples.wsrm.generated.SimpleService;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Client invoking web service using WS-RM
@@ -54,8 +48,6 @@
@RunWith(Arquillian.class)
public final class SimpleServiceTestCase extends JBossWSTest
{
- private final String serviceURL = "http://" + getServerHost() + ":" + getServerPort() + "/jaxws-samples-wsrm/SimpleService";
- private SimpleService proxy;
@Deployment(name = "jaxws-samples-wsrm", order = 1, testable = false)
public static WebArchive createDeployment1() {
@@ -80,33 +72,23 @@
return archive;
}
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "SimpleService");
- URL wsdlURL = new URL(serviceURL + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- proxy = (SimpleService)service.getPort(SimpleService.class);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- if (proxy != null) {
- ((Client)proxy).destroy();
- }
- }
-
@Test
@RunAsClient
public void test() throws Exception
{
- setUp();
- assertEquals("Hello World!", proxy.echo("Hello World!")); // request responce call
- proxy.ping(); // one way call
- tearDown();
+ SimpleService proxy = null;
+ try {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "SimpleService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":" + getServerPort() + "/jaxws-samples-wsrm/SimpleService?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ proxy = (SimpleService)service.getPort(SimpleService.class);
+ assertEquals("Hello World!", proxy.echo("Hello World!")); // request responce call
+ proxy.ping(); // one way call
+ } finally {
+ if (proxy != null) {
+ ((Client)proxy).destroy();
+ }
+ }
}
}
9 years, 10 months
JBossWS SVN: r19460 - stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-13 11:18:51 -0500 (Fri, 13 Feb 2015)
New Revision: 19460
Modified:
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
Log:
Get server host property once
Modified: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2015-02-13 16:12:58 UTC (rev 19459)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2015-02-13 16:18:51 UTC (rev 19460)
@@ -50,7 +50,6 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
/**
* A JBossWS test helper that deals with test deployment/undeployment, etc.
@@ -76,6 +75,7 @@
private static final String testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY);
private static final String integrationTarget;
private static final String implInfo;
+ private static final String serverHost = System.getProperty(SYSPROP_JBOSS_BIND_ADDRESS, "localhost");
private static WeakHashMap<ClassLoader, Hashtable<String, String>> containerEnvs = new WeakHashMap<ClassLoader, Hashtable<String,String>>();
@@ -150,8 +150,7 @@
*/
public static String getServerHost()
{
- final String host = System.getProperty(SYSPROP_JBOSS_BIND_ADDRESS, "localhost");
- return toIPv6URLFormat(host);
+ return toIPv6URLFormat(serverHost);
}
public static int getServerPort()
9 years, 10 months
JBossWS SVN: r19459 - in stack/cxf/trunk/modules: testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-13 11:12:58 -0500 (Fri, 13 Feb 2015)
New Revision: 19459
Removed:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/DeploymentArchives.java
Modified:
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
Log:
[JBWS-3668] More cleanup
Modified: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2015-02-13 15:56:07 UTC (rev 19458)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2015-02-13 16:12:58 UTC (rev 19459)
@@ -441,14 +441,6 @@
return sb.toString().trim();
}
- public static abstract class WarDeployment extends BaseDeployment<WebArchive>
- {
- public WarDeployment(String name)
- {
- super(WebArchive.class, name);
- }
- }
-
public static abstract class JarDeployment extends BaseDeployment<JavaArchive>
{
public JarDeployment(String name)
Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/DeploymentArchives.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/DeploymentArchives.java 2015-02-13 15:56:07 UTC (rev 19458)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/DeploymentArchives.java 2015-02-13 16:12:58 UTC (rev 19459)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.cxf.bus;
-
-import java.io.File;
-
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.wsf.test.JBossWSTestHelper;
-
-public final class DeploymentArchives
-{
- public static final String SERVER = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-cxf-bus.war") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.apache.cxf\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.ClientEndpoint.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.ClientEndpointImpl.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.EndpointImpl.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/META-INF/permissions.xml"), "permissions.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/WEB-INF/web.xml"));
- }
- });
-
- public static final String SERVER_2 = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-cxf-bus-wsdl.war") { {
- archive
- .addManifest()
- .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/InvalidAddressEndpoint.wsdl"), "InvalidAddressEndpoint.wsdl")
- .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/ValidAddressEndpoint.wsdl"), "ValidAddressEndpoint.wsdl")
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.WSDLServlet.class);
- }
- });
-
- public static final String SERVLET_CLIENT = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-cxf-bus-servlet-client.war") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client services export,com.sun.xml.messaging.saaj services\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.AbstractClient.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.BusTestException.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.EndpointService.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.ServletClient.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/WEB-INF-client/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/WEB-INF-client/web.xml"));
- }
- });
-
- public static final String EJB3_CLIENT = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-cxf-bus-ejb3-client.jar") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.AbstractClient.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.BusTestException.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.EJB3Client.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.EJB3ClientRemoteInterface.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.bus.EndpointService.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/META-INF/permissions.xml"), "permissions.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/bus/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl");
- }
- });
-
- private DeploymentArchives() {
- //NOOP
- }
-}
9 years, 10 months
JBossWS SVN: r19457 - in stack/cxf/trunk/modules: dist/src/main/scripts and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-13 10:54:23 -0500 (Fri, 13 Feb 2015)
New Revision: 19457
Removed:
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/CleanupOperation.java
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSCXFTestSetup.java
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
Modified:
stack/cxf/trunk/modules/dist/pom.xml
stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.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/enventry/EnvEntryServletTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java
Log:
[JBWS-3668] Removing old deploy/undeploy mechanism and cleaning up a bunch of stuff not used anymore
Modified: stack/cxf/trunk/modules/dist/pom.xml
===================================================================
--- stack/cxf/trunk/modules/dist/pom.xml 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/dist/pom.xml 2015-02-13 15:54:23 UTC (rev 19457)
@@ -235,11 +235,6 @@
<artifactId>jbossws-wildfly800-server-integration</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-wildfly800-tests-integration</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
</profile>
@@ -261,11 +256,6 @@
<artifactId>jbossws-wildfly810-server-integration</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-wildfly810-tests-integration</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
</profile>
@@ -287,11 +277,6 @@
<artifactId>jbossws-wildfly820-server-integration</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-wildfly820-tests-integration</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
</profile>
Modified: stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2015-02-13 15:54:23 UTC (rev 19457)
@@ -107,17 +107,6 @@
<outputDirectory>deploy-artifacts/lib</outputDirectory>
<unpack>false</unpack>
<includes>
- <include>org.jboss.ws:jbossws-wildfly*-tests-integration:jar</include>
- </includes>
- <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
- <scope>provided</scope>
- <useProjectArtifact>false</useProjectArtifact>
- </dependencySet>
-
- <dependencySet>
- <outputDirectory>deploy-artifacts/lib</outputDirectory>
- <unpack>false</unpack>
- <includes>
<include>org.jboss.ws:jbossws-wildfly*-server-integration:jar</include>
<include>org.picketbox:picketbox:jar</include>
</includes>
Deleted: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/CleanupOperation.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/CleanupOperation.java 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/CleanupOperation.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.test;
-
-public interface CleanupOperation
-{
- void cleanUp();
-}
Deleted: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSCXFTestSetup.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSCXFTestSetup.java 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSCXFTestSetup.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.test;
-
-import junit.framework.Test;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- *
- * @author alessio.soldano(a)jboss.com
- */
-public class JBossWSCXFTestSetup extends JBossWSTestSetup
-{
- private Bus defaultBus;
-
- public JBossWSCXFTestSetup(Class<?> testClass, String archiveList)
- {
- super(testClass, archiveList);
- }
-
- public JBossWSCXFTestSetup(Class<?> testClass, String archiveList, boolean requiresDefaultSecurityDomain)
- {
- super(testClass, archiveList, requiresDefaultSecurityDomain);
- }
-
- public JBossWSCXFTestSetup(Test test, String archiveList)
- {
- super(test, archiveList);
- }
-
- public JBossWSCXFTestSetup(Test test, String archiveList, boolean requiresDefaultSecurityDomain)
- {
- super(test, archiveList, requiresDefaultSecurityDomain);
- }
-
- public JBossWSCXFTestSetup(Class<?> testClass, String archiveList, boolean requiresDefaultSecurityDomain, CleanupOperation cleanupOp)
- {
- super(testClass, archiveList, requiresDefaultSecurityDomain, cleanupOp);
- }
-
- public JBossWSCXFTestSetup(Test test)
- {
- super(test);
- }
-
- @Override
- protected void setUp() throws Exception {
- defaultBus = BusFactory.getDefaultBus(false);
- super.setUp();
- Bus threadBus = BusFactory.getThreadDefaultBus(false);
- if (threadBus != null)
- {
- ClassLoader busLoader = threadBus.getExtension(ClassLoader.class);
- ClassLoader origLoader = this.getOriginalClassLoader();
- //overwrite the ClassLoader extension with the new TCCL, to allow CXF seeing the client side archives
- if (busLoader != null && busLoader == origLoader)
- {
- threadBus.setExtension(Thread.currentThread().getContextClassLoader(), ClassLoader.class);
- }
- }
- }
-
- @Override
- protected void tearDown() throws Exception {
- Bus threadBus = BusFactory.getThreadDefaultBus(false);
- if (threadBus != null)
- {
- ClassLoader busLoader = threadBus.getExtension(ClassLoader.class);
- ClassLoader origLoader = this.getOriginalClassLoader();
- //restore the ClassLoader extension to the orig loader
- if (busLoader != null && busLoader == Thread.currentThread().getContextClassLoader())
- {
- threadBus.setExtension(origLoader, ClassLoader.class);
- }
- }
-
- try
- {
- Bus afterTestsDefaultBus = BusFactory.getDefaultBus(false);
-
- if (defaultBus == null && afterTestsDefaultBus != null)
- {
- Logger.getLogger(this.getClass()).info("Default CXF bus has been set during test execution");
- }
- else if (defaultBus != afterTestsDefaultBus)
- {
- throw new Exception("CXF Default bus changed during test: \nBEFORE: " + defaultBus + "\nAFTER: "
- + afterTestsDefaultBus);
- }
- }
- finally
- {
- defaultBus = null; //remove reference, to help GC
- super.tearDown();
- }
- }
-}
Modified: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2014, 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.
*
@@ -212,16 +212,6 @@
return JBossWSTestHelper.isIntegrationCXF();
}
- public static void deploy(String archive) throws Exception
- {
- JBossWSTestHelper.deploy(archive);
- }
-
- public static void undeploy(String archive) throws Exception
- {
- JBossWSTestHelper.undeploy(archive);
- }
-
public static String getServerHost()
{
return JBossWSTestHelper.getServerHost();
Modified: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2014, 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.
*
@@ -32,9 +32,8 @@
import java.net.UnknownHostException;
import java.util.Hashtable;
import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
import java.util.Map.Entry;
+import java.util.Properties;
import java.util.WeakHashMap;
import javax.management.MBeanServerConnection;
@@ -52,9 +51,6 @@
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployer.Deployer;
/**
* A JBossWS test helper that deals with test deployment/undeployment, etc.
@@ -75,15 +71,12 @@
private static final String SYSPROP_AS_SERVER_CONN_RETRIEVAL_ATTEMPTS = "test.as.server.connection.retrieval.attempts";
private static final String TEST_USERNAME = "test.username";
private static final String TEST_PASSWORD = "test.password";
- private static final boolean DEPLOY_PROCESS_ENABLED = !Boolean.getBoolean("disable.test.archive.deployment");
private static final int AS_SERVER_CONN_RETRIEVAL_ATTEMPTS = Integer.getInteger(SYSPROP_AS_SERVER_CONN_RETRIEVAL_ATTEMPTS, 5);
private static final String testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY);
private static final String testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY);
private static final String integrationTarget;
private static final String implInfo;
- private static volatile Deployer deployer;
-
private static WeakHashMap<ClassLoader, Hashtable<String, String>> containerEnvs = new WeakHashMap<ClassLoader, Hashtable<String,String>>();
static {
@@ -94,55 +87,12 @@
implInfo = obj.getClass().getPackage().getName();
}
- private static Deployer getDeployer()
- {
- //lazy loading of deployer
- if (deployer == null)
- {
- synchronized (JBossWSTestHelper.class)
- {
- if (deployer == null)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- deployer = spiProvider.getSPI(Deployer.class);
- }
- }
- }
- return deployer;
- }
-
- /** Deploy the given archive to the server
- */
- public static void deploy(final String archive) throws Exception
- {
- if (DEPLOY_PROCESS_ENABLED)
- {
- URL archiveURL = getArchiveFile(archive).toURI().toURL();
- getDeployer().deploy(archiveURL);
- }
- }
-
- /** Undeploy the given archive from the server
- */
- public static void undeploy(final String archive) throws Exception
- {
- if (DEPLOY_PROCESS_ENABLED)
- {
- URL archiveURL = getArchiveFile(archive).toURI().toURL();
- getDeployer().undeploy(archiveURL);
- }
- }
-
/** Deploy the given archive to the appclient.
* Archive name is always in form archive.ear#appclient.jar
*/
public static Process deployAppclient(final String archive, final OutputStream appclientOS, final String... appclientArgs) throws Exception
{
- if (DEPLOY_PROCESS_ENABLED)
- {
- return AppclientHelper.deployAppclient(archive, appclientOS, appclientArgs);
- }
- return null;
+ return AppclientHelper.deployAppclient(archive, appclientOS, appclientArgs);
}
/** Undeploy the given archive from the appclient
@@ -150,10 +100,7 @@
*/
public static void undeployAppclient(final String archive, boolean awaitShutdown) throws Exception
{
- if (DEPLOY_PROCESS_ENABLED)
- {
- AppclientHelper.undeployAppclient(archive, awaitShutdown);
- }
+ AppclientHelper.undeployAppclient(archive, awaitShutdown);
}
public static boolean isTargetWildFly8()
@@ -431,43 +378,6 @@
return prop;
}
- public static void addSecurityDomain(String name, Map<String,String> authenticationOptions) throws Exception
- {
- getDeployer().addSecurityDomain(name, authenticationOptions);
- }
-
- public static void addJaspiSecurityDomain(String name, String loginModuleStackName, Map<String, String> loginModuleOptions, String authModuleName,
- Map<String, String> authModuleOptions) throws Exception
- {
- getDeployer().addJaspiSecurityDomain(name, loginModuleStackName, loginModuleOptions, authModuleName, authModuleOptions);
- }
-
-
- public static void removeSecurityDomain(String name) throws Exception
- {
- getDeployer().removeSecurityDomain(name);
- }
-
- public static void addHttpsConnector(Map<String, String> options) throws Exception
- {
- getDeployer().addHttpsConnector(options);
- }
-
- public static void removeHttpsConnector() throws Exception
- {
- getDeployer().removeHttpsConnector();
- }
-
- public static String setSystemProperty(String propName, String propValue) throws Exception
- {
- return getDeployer().setSystemProperty(propName, propValue);
- }
-
- public static void restartServer() throws Exception
- {
- getDeployer().restart();
- }
-
@SuppressWarnings("rawtypes")
public static void writeToFile(Archive archive)
{
Deleted: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -1,360 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.test;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import javax.management.MBeanServerConnection;
-import javax.naming.NamingException;
-import javax.security.sasl.SaslException;
-
-import junit.extensions.TestSetup;
-import junit.framework.Protectable;
-import junit.framework.Test;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-import org.jboss.logging.Logger;
-
-/**
- * A test setup that deploys/undeploys archives
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author alessio.soldano(a)jboss.com
- * @since 14-Oct-2004
- */
-public class JBossWSTestSetup extends TestSetup
-{
- // provide logging
- private static Logger log = Logger.getLogger(JBossWSTestSetup.class);
-
- private static final String JBOSSWS_SEC_DOMAIN = "JBossWS";
- private static final String SYSPROP_HTTPS_CONNECTION_REUSE_TIMEOUT = "test.https.connection.reuse.timeout";
- private static final int HTTPS_CONNECTION_REUSE_TIMEOUT = Integer.getInteger(SYSPROP_HTTPS_CONNECTION_REUSE_TIMEOUT, 5000);
-
- private String[] archives = new String[0];
- private OutputStream appclientOutputStream;
- private String appclientArg;
- private ClassLoader originalClassLoader;
- private Map<String, Map<String, String>> securityDomains;
- private boolean defaultSecurityDomainRequirement = false;
- private Map<String, String> httpsConnOptions;
- private CleanupOperation cleanupOp;
-
- private static volatile long lastHttpsConnectorRemoval = 0;
-
- public JBossWSTestSetup(Class<?> testClass, String archiveList)
- {
- super(new TestSuite(testClass));
- getArchiveArray(archiveList);
- }
-
- public JBossWSTestSetup(Class<?> testClass, String archiveList, CleanupOperation cleanupOp)
- {
- this(testClass, archiveList);
- this.cleanupOp = cleanupOp;
- }
-
- public JBossWSTestSetup(Class<?> testClass, String archiveList, OutputStream appclientOutputStream)
- {
- super(new TestSuite(testClass));
- getArchiveArray(archiveList);
- this.appclientOutputStream = appclientOutputStream;
- }
-
- public JBossWSTestSetup(Class<?> testClass, String archiveList, boolean requiresDefaultSecurityDomain)
- {
- this(testClass, archiveList);
- setDefaultSecurityDomainRequirement(requiresDefaultSecurityDomain);
- }
-
- public JBossWSTestSetup(Class<?> testClass, String archiveList, boolean requiresDefaultSecurityDomain, CleanupOperation cleanupOp)
- {
- this(testClass, archiveList, requiresDefaultSecurityDomain);
- this.cleanupOp = cleanupOp;
- }
-
- public JBossWSTestSetup(Test test, String archiveList)
- {
- super(test);
- getArchiveArray(archiveList);
- }
-
- public JBossWSTestSetup(Test test, String archiveList, CleanupOperation cleanupOp)
- {
- this(test, archiveList);
- this.cleanupOp = cleanupOp;
- }
-
- public JBossWSTestSetup(Test test, String archiveList, boolean requiresDefaultSecurityDomain)
- {
- this(test, archiveList);
- setDefaultSecurityDomainRequirement(requiresDefaultSecurityDomain);
- }
-
- public JBossWSTestSetup(Test test)
- {
- super(test);
- }
-
- /**
- * Override junit.extensions.TestSetup:run(TestResult result) to call cleanup operation
- * before tearing down the whole test setup. Required for allowing tests to perform
- * final cleanup of static references.
- */
- @Override
- public void run(final TestResult result)
- {
- Protectable p = new Protectable()
- {
- public void protect() throws Exception
- {
- setUp();
- basicRun(result);
- if (cleanupOp != null) {
- cleanupOp.cleanUp();
- }
- tearDown();
- }
- };
- result.runProtected(this, p);
- }
-
- public File getArchiveFile(String archive)
- {
- return JBossWSTestHelper.getArchiveFile(archive);
- }
-
- public URL getArchiveURL(String archive) throws MalformedURLException
- {
- return JBossWSTestHelper.getArchiveFile(archive).toURI().toURL();
- }
-
- public File getResourceFile(String resource)
- {
- return JBossWSTestHelper.getResourceFile(resource);
- }
-
- public URL getResourceURL(String resource) throws MalformedURLException
- {
- return JBossWSTestHelper.getResourceFile(resource).toURI().toURL();
- }
-
- private void getArchiveArray(String archiveList)
- {
- if (archiveList != null)
- {
- StringTokenizer st = new StringTokenizer(archiveList, ", ");
- archives = new String[st.countTokens()];
-
- for (int i = 0; i < archives.length; i++)
- archives[i] = st.nextToken();
- }
- }
-
- protected void setUp() throws Exception
- {
- // verify integration target
- String integrationTarget = JBossWSTestHelper.getIntegrationTarget();
- log.debug("Integration target: " + integrationTarget);
-
- if (securityDomains != null && !securityDomains.isEmpty())
- {
- for (String key : securityDomains.keySet())
- {
- JBossWSTestHelper.addSecurityDomain(key, securityDomains.get(key));
- }
- }
- if (defaultSecurityDomainRequirement)
- {
- String usersPropFile = System.getProperty("org.jboss.ws.testsuite.securityDomain.users.propfile");
- String rolesPropFile = System.getProperty("org.jboss.ws.testsuite.securityDomain.roles.propfile");
- Map<String, String> authenticationOptions = new HashMap<String, String>();
- if (usersPropFile != null) {
- authenticationOptions.put("usersProperties", usersPropFile);
- }
- if (rolesPropFile != null) {
- authenticationOptions.put("rolesProperties", rolesPropFile);
- }
- authenticationOptions.put("unauthenticatedIdentity", "anonymous");
- try {
- JBossWSTestHelper.addSecurityDomain(JBOSSWS_SEC_DOMAIN, authenticationOptions);
- } catch (Exception e) {
- //be lenient here, the default jbossws security domain might be there because of
- //a previously prematurely interrupted testsuite run, so go ahead with that, it
- //will removed and re-installed at next test requiring it in any case
- e.printStackTrace();
- log.warn("Could not add default security domain!", e);
- }
- }
- if (httpsConnOptions != null) {
- JBossWSTestHelper.addHttpsConnector(httpsConnOptions);
- }
-
- List<URL> clientJars = new ArrayList<URL>();
- for (int i = 0; i < archives.length; i++)
- {
- String archive = archives[i];
- if (archive.endsWith("-appclient.jar"))
- {
- URL archiveURL = getArchiveURL(archive.substring(archive.indexOf('#') + 1));
- clientJars.add(archiveURL);
- JBossWSTestHelper.deployAppclient(archive, appclientOutputStream, appclientArg);
- }
- else if (archive.endsWith("-client.jar"))
- {
- URL archiveURL = getArchiveURL(archive);
- clientJars.add(archiveURL);
- }
- else
- {
- performDeploy(archive);
- }
- }
-
- ClassLoader parent = Thread.currentThread().getContextClassLoader();
- originalClassLoader = parent;
- // add client jars to the class loader
- if (!clientJars.isEmpty())
- {
- URL[] urls = new URL[clientJars.size()];
- for (int i = 0; i < clientJars.size(); i++)
- {
- urls[i] = clientJars.get(i);
- }
- URLClassLoader cl = new URLClassLoader(urls, parent);
- Thread.currentThread().setContextClassLoader(cl);
- }
- if (httpsConnOptions != null) {
- final long lr = lastHttpsConnectorRemoval;
- if (lr != 0) {
- final long wait = HTTPS_CONNECTION_REUSE_TIMEOUT - (System.currentTimeMillis() - lr);
- if (wait > 0) {
- log.info("Will sleep for " + wait + " ms...");
- Thread.sleep(wait);
- log.debug("Going on!");
- }
- }
- }
- }
-
- private static void performDeploy(String archive) throws Exception
- {
- try
- {
- JBossWSTestHelper.deploy(archive);
- }
- catch (Throwable ex)
- {
- ex.printStackTrace();
- Throwable cause = ex.getCause();
- boolean foundSecurityCause = false;
- while (!foundSecurityCause && cause != null && cause != ex) {
- foundSecurityCause = cause instanceof SaslException;
- ex = cause;
- cause = cause.getCause();
- }
- if (foundSecurityCause) {
- System.out.println("\n** Please make sure you properly setup authentication credentials to the application server management console **\n\n" +
- "In order for running the JBossWS testsuite against a protected application server (username/password different from 'admin' / 'admin'),\n" +
- "use '-Djbossws.deployer.authentication.username=username -Djbossws.deployer.authentication.password=password'\n");
- }
- JBossWSTestHelper.undeploy(archive);
- }
- }
-
- protected void tearDown() throws Exception
- {
- try
- {
- for (int i = 0; i < archives.length; i++)
- {
- String archive = archives[archives.length - i - 1];
- if (archive.endsWith("-appclient.jar"))
- {
- JBossWSTestHelper.undeployAppclient(archive, true);
- }
- else if (!archive.endsWith("-client.jar"))
- {
- JBossWSTestHelper.undeploy(archive);
- }
- }
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(originalClassLoader);
-
- if (securityDomains != null && !securityDomains.isEmpty())
- {
- for (String key : securityDomains.keySet())
- {
- JBossWSTestHelper.removeSecurityDomain(key);
- }
- }
- if (defaultSecurityDomainRequirement)
- {
- JBossWSTestHelper.removeSecurityDomain(JBOSSWS_SEC_DOMAIN);
- }
- if (httpsConnOptions != null)
- {
- JBossWSTestHelper.removeHttpsConnector();
- lastHttpsConnectorRemoval = System.currentTimeMillis();
- }
- }
- }
-
- protected ClassLoader getOriginalClassLoader()
- {
- return originalClassLoader;
- }
-
- public MBeanServerConnection getServer() throws NamingException
- {
- return JBossWSTestHelper.getServer();
- }
-
- public void addSecurityDomainRequirement(String securityDomainName, Map<String, String> authenticationOptions)
- {
- if (securityDomains == null) {
- securityDomains = new HashMap<String, Map<String,String>>();
- }
- securityDomains.put(securityDomainName, authenticationOptions);
- }
-
- public void setDefaultSecurityDomainRequirement(boolean defaultSecurityDomainRequirement)
- {
- this.defaultSecurityDomainRequirement = defaultSecurityDomainRequirement;
- }
-
- public void setHttpsConnectorRequirement(Map<String, String> options) {
- httpsConnOptions = options;
- }
-}
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-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -54,7 +54,6 @@
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java 2015-02-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/enventry/EnvEntryServletTestCase.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -23,24 +23,18 @@
import java.io.File;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-import org.junit.Test;
-import org.junit.runner.RunWith;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
-
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
-import org.jboss.wsf.test.JBossWSTestSetup;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Test env entry access
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-13 15:37:58 UTC (rev 19456)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java 2015-02-13 15:54:23 UTC (rev 19457)
@@ -24,7 +24,6 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import javax.xml.namespace.QName;
@@ -36,21 +35,17 @@
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.ws.api.handler.GenericSOAPHandler;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
-import org.jboss.wsf.test.JBossWSTestSetup;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* [JBWS-1283] Attachment dropped on outbound messages if they have been added through a handler
9 years, 10 months
JBossWS SVN: r19456 - container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-13 10:37:58 -0500 (Fri, 13 Feb 2015)
New Revision: 19456
Removed:
container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
Log:
[JBWS-3668] Removing RemoteDeployer not used anymore
Deleted: container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
===================================================================
--- container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-02-13 15:37:25 UTC (rev 19455)
+++ container/wildfly80/branches/jbossws-wildfly800/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-02-13 15:37:58 UTC (rev 19456)
@@ -1,584 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.as.webservices.deployer;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.Semaphore;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.sasl.RealmCallback;
-import javax.security.sasl.RealmChoiceCallback;
-
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.client.ModelControllerClient;
-import org.jboss.as.controller.client.OperationBuilder;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentAction;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlan;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
-import org.jboss.as.controller.operations.common.Util;
-import org.jboss.as.security.Constants;
-import org.jboss.dmr.ModelNode;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployer.Deployer;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ALLOW_RESOURCE_SERVICE_RESTART;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.AUTHENTICATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.COMPOSITE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.FAILURE_DESCRIPTION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OPERATION_HEADERS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_RESOURCE_OPERATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RELEASE_VERSION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUIRED;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESTART;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ROLLBACK_ON_RUNTIME_FAILURE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVER_IDENTITY;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SHUTDOWN;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SSL;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STEPS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TRUSTSTORE;
-import static org.jboss.as.security.Constants.CLASSIC;
-import static org.jboss.as.security.Constants.CODE;
-import static org.jboss.as.security.Constants.FLAG;
-import static org.jboss.as.security.Constants.AUTH_MODULE;
-import static org.jboss.as.security.Constants.JASPI;
-import static org.jboss.as.security.Constants.LOGIN_MODULE;
-import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK;
-import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK_REF;
-import static org.jboss.as.security.Constants.MODULE_OPTIONS;
-import static org.jboss.as.security.Constants.SECURITY_DOMAIN;
-
-/**
- * Remote deployer that uses AS7 client deployment API.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
- * @author <a href="mailto:ema@redhat.com">Alessio Soldano</a>
- */
-public final class RemoteDeployer implements Deployer {
-
- private static final Logger LOGGER = Logger.getLogger(RemoteDeployer.class);
- private static final int DEFAULT_PORT = 9990;
- private static final String JBWS_DEPLOYER_HOST = "jbossws.deployer.host";
- private static final String JBWS_DEPLOYER_PORT = "jbossws.deployer.port";
- private static final String JBWS_DEPLOYER_PROTOCOL = "jbossws.deployer.protocol";
- private static final String JBWS_DEPLOYER_AUTH_USER = "jbossws.deployer.authentication.username";
- private static final String JBWS_DEPLOYER_AUTH_PWD = "jbossws.deployer.authentication.password";
- private static final String JBWS_DEPLOYER_HTTPS_LISTENER_NAME = "jbws-test-https-listener";
- private static final String JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME = "jbws-test-https-realm";
- private static final CallbackHandler callbackHandler = getCallbackHandler();
- private static final int TIMEOUT = 60000;
- private static InetAddress address;
- private static Integer port;
- private static String protocol;
- private final Map<URL, String> url2Id = new HashMap<URL, String>();
- private final Map<String, Integer> securityDomainUsers = new HashMap<String, Integer>(1);
- private final Map<String, Integer> archiveCounters = new HashMap<String, Integer>();
- private final Semaphore httpsConnSemaphore = new Semaphore(1);
-
- private static final String SERVER_IDENTITY_SSL = SERVER_IDENTITY + "." + SSL + ".";
- private static final String AUTHENTICATION_TRUSTORE = AUTHENTICATION + "." + TRUSTSTORE + ".";
-
- static {
- try {
- final String host = System.getProperty(JBWS_DEPLOYER_HOST);
- address = host != null ? InetAddress.getByName(host) : InetAddress.getByName("localhost");
- port = Integer.getInteger(JBWS_DEPLOYER_PORT, DEFAULT_PORT);
- protocol = System.getProperty(JBWS_DEPLOYER_PROTOCOL, "http-remoting");
- } catch (final IOException e) {
- LOGGER.fatal(e.getMessage(), e);
- System.exit(1);
- }
- }
-
- @Override
- public void deploy(final URL archiveURL) throws Exception {
- synchronized (archiveCounters) {
- String k = archiveURL.toString();
- if (archiveCounters.containsKey(k)) {
- int count = archiveCounters.get(k);
- archiveCounters.put(k, (count + 1));
- return;
- } else {
- archiveCounters.put(k, 1);
- }
- final ModelControllerClient client = newModelControllerClient();
- final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
- final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan().add(archiveURL).andDeploy();
- final DeploymentPlan plan = builder.build();
- final DeploymentAction deployAction = builder.getLastAction();
- final String uniqueId = deployAction.getDeploymentUnitUniqueName();
- executeDeploymentPlan(plan, deployAction, client, deploymentManager);
- url2Id.put(archiveURL, uniqueId);
- }
- }
-
- @Override
- public void undeploy(final URL archiveURL) throws Exception {
- synchronized (archiveCounters) {
- String k = archiveURL.toString();
- if (archiveCounters.containsKey(k)) {
- int count = archiveCounters.get(k);
- if (count > 1) {
- archiveCounters.put(k, (count - 1));
- return;
- } else {
- archiveCounters.remove(k);
- }
- } else {
- LOGGER.warn("Trying to undeploy archive " + archiveURL + " which is not currently deployed!");
- return;
- }
-
- final String uniqueName = url2Id.get(archiveURL);
- if (uniqueName != null) {
- final ModelControllerClient client = newModelControllerClient();
- final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
- final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
- final DeploymentPlan plan = builder.undeploy(uniqueName).remove(uniqueName).build();
- final DeploymentAction deployAction = builder.getLastAction();
- try {
- executeDeploymentPlan(plan, deployAction, client, deploymentManager);
- } finally {
- url2Id.remove(archiveURL);
- }
- }
- }
- }
-
- private void executeDeploymentPlan(final DeploymentPlan plan, final DeploymentAction deployAction,
- final ModelControllerClient client, final ServerDeploymentManager deploymentManager) throws Exception {
- try {
- final ServerDeploymentPlanResult planResult = deploymentManager.execute(plan).get();
-
- if (deployAction != null) {
- final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(deployAction.getId());
- if (actionResult != null) {
- final Exception deploymentException = (Exception) actionResult.getDeploymentException();
- if (deploymentException != null)
- throw deploymentException;
- }
- }
- } catch (final Exception e) {
- LOGGER.fatal(e.getMessage(), e);
- throw e;
- } finally {
- client.close();
- deploymentManager.close();
- }
- }
-
- public String getServerVersion() throws Exception {
- final ModelNode request = new ModelNode();
- request.get(OP).set(READ_ATTRIBUTE_OPERATION);
- request.get(OP_ADDR).setEmptyList();
- request.get(NAME).set(RELEASE_VERSION);
-
- final ModelNode response = applyUpdate(request);
- return response.get(RESULT).asString();
- }
-
- @Override
- public void addSecurityDomain(String name, Map<String, String> authenticationOptions) throws Exception {
- synchronized (securityDomainUsers) {
- if (securityDomainUsers.containsKey(name)) {
- int count = securityDomainUsers.get(name);
- securityDomainUsers.put(name, (count + 1));
- return;
- } else {
- securityDomainUsers.put(name, 1);
- }
-
- final List<ModelNode> updates = new ArrayList<ModelNode>();
-
- final ModelNode compositeOp = new ModelNode();
- compositeOp.get(OP).set(COMPOSITE);
- compositeOp.get(OP_ADDR).setEmptyList();
- compositeOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
-
- ModelNode steps = compositeOp.get(STEPS);
- PathAddress address = PathAddress.pathAddress()
- .append(SUBSYSTEM, "security")
- .append(SECURITY_DOMAIN, name);
- steps.add(Util.createAddOperation(address));
- address = address.append(Constants.AUTHENTICATION, CLASSIC);
- steps.add(Util.createAddOperation(address));
- ModelNode loginModule = Util.createAddOperation(address.append(LOGIN_MODULE, "UsersRoles"));
- loginModule.get(CODE).set("UsersRoles");
- loginModule.get(FLAG).set(REQUIRED);
- loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- final ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- if (authenticationOptions != null) {
- for (final String k : authenticationOptions.keySet()) {
- moduleOptions.add(k, authenticationOptions.get(k));
- }
- }
- steps.add(loginModule);
- updates.add(compositeOp);
-
- applyUpdates(updates);
- }
- }
-
- public void addJaspiSecurityDomain(String name, String loginModuleStackName, Map<String, String> loginModuleOptions,
- String authModuleName, Map<String, String> authModuleOptions) throws Exception {
- synchronized (securityDomainUsers) {
- if (securityDomainUsers.containsKey(name)) {
- int count = securityDomainUsers.get(name);
- securityDomainUsers.put(name, (count + 1));
- return;
- } else {
- securityDomainUsers.put(name, 1);
- }
-
- final List<ModelNode> updates = new ArrayList<ModelNode>();
-
- final ModelNode compositeOp = new ModelNode();
- compositeOp.get(OP).set(COMPOSITE);
- compositeOp.get(OP_ADDR).setEmptyList();
- compositeOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
-
- ModelNode steps = compositeOp.get(STEPS);
- PathAddress address = PathAddress.pathAddress().append(SUBSYSTEM, "security").append(SECURITY_DOMAIN, name);
- steps.add(Util.createAddOperation(address));
-
- PathAddress parentAddress = address.append(AUTHENTICATION, JASPI);
- steps.add(Util.createAddOperation(parentAddress));
-
- // step 3
- PathAddress loignStackAddress = parentAddress.append(LOGIN_MODULE_STACK, loginModuleStackName);
- ModelNode loginStack = Util.createAddOperation(loignStackAddress);
- steps.add(loginStack);
-
- // step 4
- ModelNode loginModule = Util.createAddOperation(loignStackAddress.append(LOGIN_MODULE, "UsersRoles"));
- loginModule.get(CODE).set("UsersRoles");
- loginModule.get(FLAG).set(REQUIRED);
- loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- final ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- if (loginModuleOptions != null) {
- for (final String k : loginModuleOptions.keySet()) {
- moduleOptions.add(k, loginModuleOptions.get(k));
- }
- }
- steps.add(loginModule);
-
- PathAddress authModule = parentAddress.append(AUTH_MODULE, authModuleName);
- ModelNode authModuleNode = Util.createAddOperation(authModule);
- authModuleNode.get(LOGIN_MODULE_STACK_REF).set(loginModuleStackName);
- authModuleNode.get(CODE).set(authModuleName);
- ModelNode options = authModuleNode.get(MODULE_OPTIONS);
- if (authModuleOptions != null) {
- for (final String k : authModuleOptions.keySet()) {
- options.add(k, authModuleOptions.get(k));
- }
- }
- steps.add(authModuleNode);
-
- updates.add(compositeOp);
-
- applyUpdates(updates);
- }
- }
-
- @Override
- public void removeSecurityDomain(String name) throws Exception {
- synchronized (securityDomainUsers) {
- int count = securityDomainUsers.get(name);
- if (count > 1) {
- securityDomainUsers.put(name, (count - 1));
- return;
- } else {
- securityDomainUsers.remove(name);
- }
-
- final ModelNode op = new ModelNode();
- op.get(OP).set(REMOVE);
- op.get(OP_ADDR).add(SUBSYSTEM, "security");
- op.get(OP_ADDR).add(SECURITY_DOMAIN, name);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- op.get(OPERATION_HEADERS, ROLLBACK_ON_RUNTIME_FAILURE).set(false);
-
- applyUpdate(op);
- }
- }
-
- public void addHttpsConnector(Map<String, String> options) throws Exception {
- final Map<String, String> sslOptionsMap = new HashMap<String, String>();
- final Map<String, String> truststoreOptionsMap = new HashMap<String, String>();
- if (options != null) {
- for (final Entry<String, String> entry : options.entrySet()) {
- final String k = entry.getKey();
- if (k.startsWith(SERVER_IDENTITY_SSL)) {
- final String key = k.substring(SERVER_IDENTITY_SSL.length());
- sslOptionsMap.put(key, entry.getValue());
- } else if (k.startsWith(AUTHENTICATION_TRUSTORE)) {
- final String key = k.substring(AUTHENTICATION_TRUSTORE.length());
- truststoreOptionsMap.put(key, entry.getValue());
- }
- }
- }
- httpsConnSemaphore.acquire();
- try {
- addSecurityRealm(JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME, sslOptionsMap, truststoreOptionsMap);
- final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
- final ModelNode steps = composite.get(STEPS);
- ModelNode op = createOpNode("subsystem=undertow/server=default-server/https-listener=" + JBWS_DEPLOYER_HTTPS_LISTENER_NAME, "add");
- op.get("socket-binding").set("https");
- op.get("security-realm").set(JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME);
- final String verifyClient = "verify-client";
- if (options != null && options.containsKey(verifyClient)) {
- op.get(verifyClient).set(options.get(verifyClient));
- }
- steps.add(op);
- applyUpdate(composite);
- } catch (Exception e) {
- httpsConnSemaphore.release();
- throw e;
- }
- }
-
- private static void addSecurityRealm(String realm, Map<String, String> sslOptions, Map<String, String> truststoreOptions) throws Exception {
- final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
- final ModelNode steps = composite.get(STEPS);
- ModelNode op = createOpNode("core-service=management/security-realm=" + realm, ADD);
- steps.add(op);
- if (!sslOptions.isEmpty()) {
- ModelNode ssl = createOpNode("core-service=management/security-realm=" + realm + "/server-identity=ssl", ADD);
- for (final Entry<String, String> entry : sslOptions.entrySet()) {
- ssl.get(entry.getKey()).set(entry.getValue());
- }
- steps.add(ssl);
- }
-
- if (!truststoreOptions.isEmpty()) {
- ModelNode truststore = createOpNode("core-service=management/security-realm=" + realm + "/authentication=truststore", ADD);
- for (final Entry<String, String> entry : truststoreOptions.entrySet()) {
- truststore.get(entry.getKey()).set(entry.getValue());
- }
- steps.add(truststore);
- }
- applyUpdate(composite);
- }
-
- public void removeHttpsConnector() throws Exception {
- try {
- ModelNode op = createOpNode("subsystem=undertow/server=default-server/https-listener=" + JBWS_DEPLOYER_HTTPS_LISTENER_NAME, REMOVE);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- applyUpdate(op);
- op = createOpNode("core-service=management/security-realm=" + JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME, REMOVE);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- applyUpdate(op);
- } finally {
- httpsConnSemaphore.release();
- }
- }
-
- @Override
- public void restart() throws Exception {
- ModelNode op = new ModelNode();
- op.get("operation").set(SHUTDOWN);
- op.get(RESTART).set("true");
- applyUpdate(op);
- waitForServerToRestart(TIMEOUT);
- }
-
- @Override
- public String setSystemProperty(String propName, String propValue) throws Exception {
- if (propName == null || propName.trim().length() == 0) {
- throw new IllegalArgumentException("Empty system property name specified!");
- }
- ModelNode op = createOpNode("system-property=" + propName, READ_RESOURCE_OPERATION);
- String previousValue = null;
- try {
- ModelNode response = applyUpdate(op);
- String rawResult = response.get(RESULT).asString();
- previousValue = rawResult.substring(13, rawResult.length() - 2); //{"value" => "xyz"}
- } catch (Exception e) {
- if (!e.getMessage().contains("WFLYCTL0216") && !e.getMessage().contains("JBAS014807")) {
- throw e;
- }
- }
- if (previousValue != null) {
- op = createOpNode("system-property=" + propName, REMOVE);
- applyUpdate(op);
- }
- if (propValue != null) {
- op = createOpNode("system-property=" + propName, ADD);
- op.get("value").set(propValue);
- applyUpdate(op);
- }
- return previousValue;
- }
-
- private static void applyUpdates(final List<ModelNode> updates) throws Exception {
- for (final ModelNode update : updates) {
- applyUpdate(update);
- }
- }
-
- private static ModelNode applyUpdate(final ModelNode update) throws Exception {
- final ModelControllerClient client = newModelControllerClient();
- try {
- final ModelNode result = client.execute(new OperationBuilder(update).build());
- checkResult(result);
- return result;
- } finally {
- client.close();
- }
- }
-
- private static void checkResult(final ModelNode result) throws Exception {
- if (result.hasDefined(OUTCOME) && SUCCESS.equals(result.get(OUTCOME).asString())) {
- if (result.hasDefined(RESULT)) {
- LOGGER.info(result.get(RESULT));
- }
- } else if (result.hasDefined(FAILURE_DESCRIPTION)) {
- throw new Exception(result.get(FAILURE_DESCRIPTION).toString());
- } else {
- throw new Exception("Operation not successful; outcome = " + result.get(OUTCOME));
- }
- }
-
- private static CallbackHandler getCallbackHandler() {
- final String username = getSystemProperty(JBWS_DEPLOYER_AUTH_USER, null);
- if (username == null || ("${" + JBWS_DEPLOYER_AUTH_USER + "}").equals(username)) {
- return null;
- }
- String pwd = getSystemProperty(JBWS_DEPLOYER_AUTH_PWD, null);
- if (("${" + JBWS_DEPLOYER_AUTH_PWD + "}").equals(pwd)) {
- pwd = null;
- }
- final String password = pwd;
- return new CallbackHandler() {
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (Callback current : callbacks) {
- if (current instanceof NameCallback) {
- NameCallback ncb = (NameCallback) current;
- ncb.setName(username);
- } else if (current instanceof PasswordCallback) {
- PasswordCallback pcb = (PasswordCallback) current;
- pcb.setPassword(password.toCharArray());
- } else if (current instanceof RealmCallback) {
- RealmCallback rcb = (RealmCallback) current;
- rcb.setText(rcb.getDefaultText());
- } else if (current instanceof RealmChoiceCallback) {
- // Ignored but not rejected.
- } else {
- throw new UnsupportedCallbackException(current);
- }
- }
- }
- };
- }
-
- public static ModelNode createOpNode(String address, String operation) {
- ModelNode op = new ModelNode();
- // set address
- ModelNode list = op.get("address").setEmptyList();
- if (address != null) {
- String[] pathSegments = address.split("/");
- for (String segment : pathSegments) {
- String[] elements = segment.split("=");
- list.add(elements[0], elements[1]);
- }
- }
- op.get("operation").set(operation);
- return op;
- }
-
- private void waitForServerToRestart(int timeout) throws Exception {
- Thread.sleep(1000);
- long start = System.currentTimeMillis();
- long now;
- do {
- final ModelControllerClient client = newModelControllerClient(timeout / 10);
- ModelNode operation = new ModelNode();
- operation.get(OP_ADDR).setEmptyList();
- operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
- operation.get(NAME).set("server-state");
- try {
- ModelNode result = client.execute(operation);
- boolean normal = "running".equals(result.get(RESULT).asString());
- if (normal) {
- return;
- }
- } catch (Exception e) {
- //NOOP
- } finally {
- client.close();
- }
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- }
- now = System.currentTimeMillis();
- } while (now - start < timeout);
- throw new Exception("Server did not restart!");
- }
-
- private static String getSystemProperty(final String name, final String defaultValue) {
- PrivilegedAction<String> action = new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(name, defaultValue);
- }
- };
- return AccessController.doPrivileged(action);
- }
-
- private static ModelControllerClient newModelControllerClient() throws Exception {
- return newModelControllerClient(TIMEOUT);
- }
-
- private static ModelControllerClient newModelControllerClient(int timeout) throws Exception {
- return ModelControllerClient.Factory.create(protocol, address.getHostAddress(), port, callbackHandler, null, timeout);
- }
-
- private static ServerDeploymentManager newDeploymentManager(ModelControllerClient client) throws Exception {
- return ServerDeploymentManager.Factory.create(client);
- }
-}
9 years, 10 months
JBossWS SVN: r19455 - container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-02-13 10:37:25 -0500 (Fri, 13 Feb 2015)
New Revision: 19455
Removed:
container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
Log:
[JBWS-3668] Removing RemoteDeployer not used anymore
Deleted: container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
===================================================================
--- container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-02-13 15:36:55 UTC (rev 19454)
+++ container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-02-13 15:37:25 UTC (rev 19455)
@@ -1,584 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.as.webservices.deployer;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.Semaphore;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.sasl.RealmCallback;
-import javax.security.sasl.RealmChoiceCallback;
-
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.client.ModelControllerClient;
-import org.jboss.as.controller.client.OperationBuilder;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentAction;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlan;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
-import org.jboss.as.controller.operations.common.Util;
-import org.jboss.as.security.Constants;
-import org.jboss.dmr.ModelNode;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployer.Deployer;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ALLOW_RESOURCE_SERVICE_RESTART;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.AUTHENTICATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.COMPOSITE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.FAILURE_DESCRIPTION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OPERATION_HEADERS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_RESOURCE_OPERATION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RELEASE_VERSION;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUIRED;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESTART;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ROLLBACK_ON_RUNTIME_FAILURE;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVER_IDENTITY;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SHUTDOWN;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SSL;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STEPS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TRUSTSTORE;
-import static org.jboss.as.security.Constants.CLASSIC;
-import static org.jboss.as.security.Constants.CODE;
-import static org.jboss.as.security.Constants.FLAG;
-import static org.jboss.as.security.Constants.AUTH_MODULE;
-import static org.jboss.as.security.Constants.JASPI;
-import static org.jboss.as.security.Constants.LOGIN_MODULE;
-import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK;
-import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK_REF;
-import static org.jboss.as.security.Constants.MODULE_OPTIONS;
-import static org.jboss.as.security.Constants.SECURITY_DOMAIN;
-
-/**
- * Remote deployer that uses AS7 client deployment API.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
- * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
- */
-public final class RemoteDeployer implements Deployer {
-
- private static final Logger LOGGER = Logger.getLogger(RemoteDeployer.class);
- private static final int DEFAULT_PORT = 9990;
- private static final String JBWS_DEPLOYER_HOST = "jbossws.deployer.host";
- private static final String JBWS_DEPLOYER_PORT = "jbossws.deployer.port";
- private static final String JBWS_DEPLOYER_PROTOCOL = "jbossws.deployer.protocol";
- private static final String JBWS_DEPLOYER_AUTH_USER = "jbossws.deployer.authentication.username";
- private static final String JBWS_DEPLOYER_AUTH_PWD = "jbossws.deployer.authentication.password";
- private static final String JBWS_DEPLOYER_HTTPS_LISTENER_NAME = "jbws-test-https-listener";
- private static final String JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME = "jbws-test-https-realm";
- private static final CallbackHandler callbackHandler = getCallbackHandler();
- private static final int TIMEOUT = 60000;
- private static InetAddress address;
- private static Integer port;
- private static String protocol;
- private final Map<URL, String> url2Id = new HashMap<URL, String>();
- private final Map<String, Integer> securityDomainUsers = new HashMap<String, Integer>(1);
- private final Map<String, Integer> archiveCounters = new HashMap<String, Integer>();
- private final Semaphore httpsConnSemaphore = new Semaphore(1);
-
- private static final String SERVER_IDENTITY_SSL = SERVER_IDENTITY + "." + SSL + ".";
- private static final String AUTHENTICATION_TRUSTORE = AUTHENTICATION + "." + TRUSTSTORE + ".";
-
- static {
- try {
- final String host = System.getProperty(JBWS_DEPLOYER_HOST);
- address = host != null ? InetAddress.getByName(host) : InetAddress.getByName("localhost");
- port = Integer.getInteger(JBWS_DEPLOYER_PORT, DEFAULT_PORT);
- protocol = System.getProperty(JBWS_DEPLOYER_PROTOCOL, "http-remoting");
- } catch (final IOException e) {
- LOGGER.fatal(e.getMessage(), e);
- System.exit(1);
- }
- }
-
- @Override
- public void deploy(final URL archiveURL) throws Exception {
- synchronized (archiveCounters) {
- String k = archiveURL.toString();
- if (archiveCounters.containsKey(k)) {
- int count = archiveCounters.get(k);
- archiveCounters.put(k, (count + 1));
- return;
- } else {
- archiveCounters.put(k, 1);
- }
- final ModelControllerClient client = newModelControllerClient();
- final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
- final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan().add(archiveURL).andDeploy();
- final DeploymentPlan plan = builder.build();
- final DeploymentAction deployAction = builder.getLastAction();
- final String uniqueId = deployAction.getDeploymentUnitUniqueName();
- executeDeploymentPlan(plan, deployAction, client, deploymentManager);
- url2Id.put(archiveURL, uniqueId);
- }
- }
-
- @Override
- public void undeploy(final URL archiveURL) throws Exception {
- synchronized (archiveCounters) {
- String k = archiveURL.toString();
- if (archiveCounters.containsKey(k)) {
- int count = archiveCounters.get(k);
- if (count > 1) {
- archiveCounters.put(k, (count - 1));
- return;
- } else {
- archiveCounters.remove(k);
- }
- } else {
- LOGGER.warn("Trying to undeploy archive " + archiveURL + " which is not currently deployed!");
- return;
- }
-
- final String uniqueName = url2Id.get(archiveURL);
- if (uniqueName != null) {
- final ModelControllerClient client = newModelControllerClient();
- final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
- final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
- final DeploymentPlan plan = builder.undeploy(uniqueName).remove(uniqueName).build();
- final DeploymentAction deployAction = builder.getLastAction();
- try {
- executeDeploymentPlan(plan, deployAction, client, deploymentManager);
- } finally {
- url2Id.remove(archiveURL);
- }
- }
- }
- }
-
- private void executeDeploymentPlan(final DeploymentPlan plan, final DeploymentAction deployAction,
- final ModelControllerClient client, final ServerDeploymentManager deploymentManager) throws Exception {
- try {
- final ServerDeploymentPlanResult planResult = deploymentManager.execute(plan).get();
-
- if (deployAction != null) {
- final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(deployAction.getId());
- if (actionResult != null) {
- final Exception deploymentException = (Exception) actionResult.getDeploymentException();
- if (deploymentException != null)
- throw deploymentException;
- }
- }
- } catch (final Exception e) {
- LOGGER.fatal(e.getMessage(), e);
- throw e;
- } finally {
- client.close();
- deploymentManager.close();
- }
- }
-
- public String getServerVersion() throws Exception {
- final ModelNode request = new ModelNode();
- request.get(OP).set(READ_ATTRIBUTE_OPERATION);
- request.get(OP_ADDR).setEmptyList();
- request.get(NAME).set(RELEASE_VERSION);
-
- final ModelNode response = applyUpdate(request);
- return response.get(RESULT).asString();
- }
-
- @Override
- public void addSecurityDomain(String name, Map<String, String> authenticationOptions) throws Exception {
- synchronized (securityDomainUsers) {
- if (securityDomainUsers.containsKey(name)) {
- int count = securityDomainUsers.get(name);
- securityDomainUsers.put(name, (count + 1));
- return;
- } else {
- securityDomainUsers.put(name, 1);
- }
-
- final List<ModelNode> updates = new ArrayList<ModelNode>();
-
- final ModelNode compositeOp = new ModelNode();
- compositeOp.get(OP).set(COMPOSITE);
- compositeOp.get(OP_ADDR).setEmptyList();
- compositeOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
-
- ModelNode steps = compositeOp.get(STEPS);
- PathAddress address = PathAddress.pathAddress()
- .append(SUBSYSTEM, "security")
- .append(SECURITY_DOMAIN, name);
- steps.add(Util.createAddOperation(address));
- address = address.append(Constants.AUTHENTICATION, CLASSIC);
- steps.add(Util.createAddOperation(address));
- ModelNode loginModule = Util.createAddOperation(address.append(LOGIN_MODULE, "UsersRoles"));
- loginModule.get(CODE).set("UsersRoles");
- loginModule.get(FLAG).set(REQUIRED);
- loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- final ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- if (authenticationOptions != null) {
- for (final String k : authenticationOptions.keySet()) {
- moduleOptions.add(k, authenticationOptions.get(k));
- }
- }
- steps.add(loginModule);
- updates.add(compositeOp);
-
- applyUpdates(updates);
- }
- }
-
- public void addJaspiSecurityDomain(String name, String loginModuleStackName, Map<String, String> loginModuleOptions,
- String authModuleName, Map<String, String> authModuleOptions) throws Exception {
- synchronized (securityDomainUsers) {
- if (securityDomainUsers.containsKey(name)) {
- int count = securityDomainUsers.get(name);
- securityDomainUsers.put(name, (count + 1));
- return;
- } else {
- securityDomainUsers.put(name, 1);
- }
-
- final List<ModelNode> updates = new ArrayList<ModelNode>();
-
- final ModelNode compositeOp = new ModelNode();
- compositeOp.get(OP).set(COMPOSITE);
- compositeOp.get(OP_ADDR).setEmptyList();
- compositeOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
-
- ModelNode steps = compositeOp.get(STEPS);
- PathAddress address = PathAddress.pathAddress().append(SUBSYSTEM, "security").append(SECURITY_DOMAIN, name);
- steps.add(Util.createAddOperation(address));
-
- PathAddress parentAddress = address.append(AUTHENTICATION, JASPI);
- steps.add(Util.createAddOperation(parentAddress));
-
- // step 3
- PathAddress loignStackAddress = parentAddress.append(LOGIN_MODULE_STACK, loginModuleStackName);
- ModelNode loginStack = Util.createAddOperation(loignStackAddress);
- steps.add(loginStack);
-
- // step 4
- ModelNode loginModule = Util.createAddOperation(loignStackAddress.append(LOGIN_MODULE, "UsersRoles"));
- loginModule.get(CODE).set("UsersRoles");
- loginModule.get(FLAG).set(REQUIRED);
- loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- final ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
- if (loginModuleOptions != null) {
- for (final String k : loginModuleOptions.keySet()) {
- moduleOptions.add(k, loginModuleOptions.get(k));
- }
- }
- steps.add(loginModule);
-
- PathAddress authModule = parentAddress.append(AUTH_MODULE, authModuleName);
- ModelNode authModuleNode = Util.createAddOperation(authModule);
- authModuleNode.get(LOGIN_MODULE_STACK_REF).set(loginModuleStackName);
- authModuleNode.get(CODE).set(authModuleName);
- ModelNode options = authModuleNode.get(MODULE_OPTIONS);
- if (authModuleOptions != null) {
- for (final String k : authModuleOptions.keySet()) {
- options.add(k, authModuleOptions.get(k));
- }
- }
- steps.add(authModuleNode);
-
- updates.add(compositeOp);
-
- applyUpdates(updates);
- }
- }
-
- @Override
- public void removeSecurityDomain(String name) throws Exception {
- synchronized (securityDomainUsers) {
- int count = securityDomainUsers.get(name);
- if (count > 1) {
- securityDomainUsers.put(name, (count - 1));
- return;
- } else {
- securityDomainUsers.remove(name);
- }
-
- final ModelNode op = new ModelNode();
- op.get(OP).set(REMOVE);
- op.get(OP_ADDR).add(SUBSYSTEM, "security");
- op.get(OP_ADDR).add(SECURITY_DOMAIN, name);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- op.get(OPERATION_HEADERS, ROLLBACK_ON_RUNTIME_FAILURE).set(false);
-
- applyUpdate(op);
- }
- }
-
- public void addHttpsConnector(Map<String, String> options) throws Exception {
- final Map<String, String> sslOptionsMap = new HashMap<String, String>();
- final Map<String, String> truststoreOptionsMap = new HashMap<String, String>();
- if (options != null) {
- for (final Entry<String, String> entry : options.entrySet()) {
- final String k = entry.getKey();
- if (k.startsWith(SERVER_IDENTITY_SSL)) {
- final String key = k.substring(SERVER_IDENTITY_SSL.length());
- sslOptionsMap.put(key, entry.getValue());
- } else if (k.startsWith(AUTHENTICATION_TRUSTORE)) {
- final String key = k.substring(AUTHENTICATION_TRUSTORE.length());
- truststoreOptionsMap.put(key, entry.getValue());
- }
- }
- }
- httpsConnSemaphore.acquire();
- try {
- addSecurityRealm(JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME, sslOptionsMap, truststoreOptionsMap);
- final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
- final ModelNode steps = composite.get(STEPS);
- ModelNode op = createOpNode("subsystem=undertow/server=default-server/https-listener=" + JBWS_DEPLOYER_HTTPS_LISTENER_NAME, "add");
- op.get("socket-binding").set("https");
- op.get("security-realm").set(JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME);
- final String verifyClient = "verify-client";
- if (options != null && options.containsKey(verifyClient)) {
- op.get(verifyClient).set(options.get(verifyClient));
- }
- steps.add(op);
- applyUpdate(composite);
- } catch (Exception e) {
- httpsConnSemaphore.release();
- throw e;
- }
- }
-
- private static void addSecurityRealm(String realm, Map<String, String> sslOptions, Map<String, String> truststoreOptions) throws Exception {
- final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
- final ModelNode steps = composite.get(STEPS);
- ModelNode op = createOpNode("core-service=management/security-realm=" + realm, ADD);
- steps.add(op);
- if (!sslOptions.isEmpty()) {
- ModelNode ssl = createOpNode("core-service=management/security-realm=" + realm + "/server-identity=ssl", ADD);
- for (final Entry<String, String> entry : sslOptions.entrySet()) {
- ssl.get(entry.getKey()).set(entry.getValue());
- }
- steps.add(ssl);
- }
-
- if (!truststoreOptions.isEmpty()) {
- ModelNode truststore = createOpNode("core-service=management/security-realm=" + realm + "/authentication=truststore", ADD);
- for (final Entry<String, String> entry : truststoreOptions.entrySet()) {
- truststore.get(entry.getKey()).set(entry.getValue());
- }
- steps.add(truststore);
- }
- applyUpdate(composite);
- }
-
- public void removeHttpsConnector() throws Exception {
- try {
- ModelNode op = createOpNode("subsystem=undertow/server=default-server/https-listener=" + JBWS_DEPLOYER_HTTPS_LISTENER_NAME, REMOVE);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- applyUpdate(op);
- op = createOpNode("core-service=management/security-realm=" + JBWS_DEPLOYER_HTTPS_LISTENER_REALM_NAME, REMOVE);
- op.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
- applyUpdate(op);
- } finally {
- httpsConnSemaphore.release();
- }
- }
-
- @Override
- public void restart() throws Exception {
- ModelNode op = new ModelNode();
- op.get("operation").set(SHUTDOWN);
- op.get(RESTART).set("true");
- applyUpdate(op);
- waitForServerToRestart(TIMEOUT);
- }
-
- @Override
- public String setSystemProperty(String propName, String propValue) throws Exception {
- if (propName == null || propName.trim().length() == 0) {
- throw new IllegalArgumentException("Empty system property name specified!");
- }
- ModelNode op = createOpNode("system-property=" + propName, READ_RESOURCE_OPERATION);
- String previousValue = null;
- try {
- ModelNode response = applyUpdate(op);
- String rawResult = response.get(RESULT).asString();
- previousValue = rawResult.substring(13, rawResult.length() - 2); //{"value" => "xyz"}
- } catch (Exception e) {
- if (!e.getMessage().contains("WFLYCTL0216") && !e.getMessage().contains("JBAS014807")) {
- throw e;
- }
- }
- if (previousValue != null) {
- op = createOpNode("system-property=" + propName, REMOVE);
- applyUpdate(op);
- }
- if (propValue != null) {
- op = createOpNode("system-property=" + propName, ADD);
- op.get("value").set(propValue);
- applyUpdate(op);
- }
- return previousValue;
- }
-
- private static void applyUpdates(final List<ModelNode> updates) throws Exception {
- for (final ModelNode update : updates) {
- applyUpdate(update);
- }
- }
-
- private static ModelNode applyUpdate(final ModelNode update) throws Exception {
- final ModelControllerClient client = newModelControllerClient();
- try {
- final ModelNode result = client.execute(new OperationBuilder(update).build());
- checkResult(result);
- return result;
- } finally {
- client.close();
- }
- }
-
- private static void checkResult(final ModelNode result) throws Exception {
- if (result.hasDefined(OUTCOME) && SUCCESS.equals(result.get(OUTCOME).asString())) {
- if (result.hasDefined(RESULT)) {
- LOGGER.info(result.get(RESULT));
- }
- } else if (result.hasDefined(FAILURE_DESCRIPTION)) {
- throw new Exception(result.get(FAILURE_DESCRIPTION).toString());
- } else {
- throw new Exception("Operation not successful; outcome = " + result.get(OUTCOME));
- }
- }
-
- private static CallbackHandler getCallbackHandler() {
- final String username = getSystemProperty(JBWS_DEPLOYER_AUTH_USER, null);
- if (username == null || ("${" + JBWS_DEPLOYER_AUTH_USER + "}").equals(username)) {
- return null;
- }
- String pwd = getSystemProperty(JBWS_DEPLOYER_AUTH_PWD, null);
- if (("${" + JBWS_DEPLOYER_AUTH_PWD + "}").equals(pwd)) {
- pwd = null;
- }
- final String password = pwd;
- return new CallbackHandler() {
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (Callback current : callbacks) {
- if (current instanceof NameCallback) {
- NameCallback ncb = (NameCallback) current;
- ncb.setName(username);
- } else if (current instanceof PasswordCallback) {
- PasswordCallback pcb = (PasswordCallback) current;
- pcb.setPassword(password.toCharArray());
- } else if (current instanceof RealmCallback) {
- RealmCallback rcb = (RealmCallback) current;
- rcb.setText(rcb.getDefaultText());
- } else if (current instanceof RealmChoiceCallback) {
- // Ignored but not rejected.
- } else {
- throw new UnsupportedCallbackException(current);
- }
- }
- }
- };
- }
-
- public static ModelNode createOpNode(String address, String operation) {
- ModelNode op = new ModelNode();
- // set address
- ModelNode list = op.get("address").setEmptyList();
- if (address != null) {
- String[] pathSegments = address.split("/");
- for (String segment : pathSegments) {
- String[] elements = segment.split("=");
- list.add(elements[0], elements[1]);
- }
- }
- op.get("operation").set(operation);
- return op;
- }
-
- private void waitForServerToRestart(int timeout) throws Exception {
- Thread.sleep(1000);
- long start = System.currentTimeMillis();
- long now;
- do {
- final ModelControllerClient client = newModelControllerClient(timeout / 10);
- ModelNode operation = new ModelNode();
- operation.get(OP_ADDR).setEmptyList();
- operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
- operation.get(NAME).set("server-state");
- try {
- ModelNode result = client.execute(operation);
- boolean normal = "running".equals(result.get(RESULT).asString());
- if (normal) {
- return;
- }
- } catch (Exception e) {
- //NOOP
- } finally {
- client.close();
- }
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- }
- now = System.currentTimeMillis();
- } while (now - start < timeout);
- throw new Exception("Server did not restart!");
- }
-
- private static String getSystemProperty(final String name, final String defaultValue) {
- PrivilegedAction<String> action = new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty(name, defaultValue);
- }
- };
- return AccessController.doPrivileged(action);
- }
-
- private static ModelControllerClient newModelControllerClient() throws Exception {
- return newModelControllerClient(TIMEOUT);
- }
-
- private static ModelControllerClient newModelControllerClient(int timeout) throws Exception {
- return ModelControllerClient.Factory.create(protocol, address.getHostAddress(), port, callbackHandler, null, timeout);
- }
-
- private static ServerDeploymentManager newDeploymentManager(ModelControllerClient client) throws Exception {
- return ServerDeploymentManager.Factory.create(client);
- }
-}
9 years, 10 months