Author: asoldano
Date: 2015-02-13 09:43:07 -0500 (Fri, 13 Feb 2015)
New Revision: 19453
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java
Log:
Bunch of fixes to tests that used CleanupOperation in the past for static references to
ports...
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -44,8 +44,6 @@
@RunWith(Arquillian.class)
public class JBWS1422TestCase extends JBossWSTest
{
- private static final String TARGET_NAMESPACE =
"http://jbws1422.jaxws.ws.test.jboss.org/";
-
@ArquillianResource
private URL baseURL;
@@ -63,7 +61,7 @@
@RunAsClient
public void testDeployment() throws Exception
{
- QName serviceName = new QName(TARGET_NAMESPACE, "JBWS1422Service");
+ QName serviceName = new
QName("http://jbws1422.jaxws.ws.test.jboss.org/",
"JBWS1422Service");
URL wsdlURL = new URL(baseURL +
"/jaxws-jbws1422/JBWS1422Service/IWebsvcImpl?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1556/JBWS1556EarTestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.JavaArchive;
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;
@@ -57,7 +59,6 @@
private URL baseURL;
@Deployment(testable = false)
-
public static EnterpriseArchive createDeployment3() {
JavaArchive archive1 = ShrinkWrap.create(JavaArchive.class,
"jaxws-jbws1556.jar");
archive1
@@ -74,11 +75,8 @@
return archive;
}
- protected void cleanUp() {
- port = null;
- }
-
- protected void setUp() throws MalformedURLException
+ @Before
+ public void setup() throws MalformedURLException
{
if (port == null)
{
@@ -88,25 +86,26 @@
port = service.getPort(EndpointInterface.class);
}
}
+
+ @AfterClass
+ public static void cleanup() {
+ port = null;
+ }
@Test
@RunAsClient
public void testSimpleAccess() throws Exception
{
- setUp();
String hello = port.helloSimple("hello");
assertEquals("hello", hello);
- cleanUp();
}
@Test
@RunAsClient
public void testComplexAccess() throws Exception
{
- setUp();
UserType req = new UserType("hello");
UserType res = port.helloComplex(req);
assertEquals(req, res);
- cleanUp();
}
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1841/JBWS1841TestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.JavaArchive;
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;
@@ -76,7 +78,8 @@
return archive;
}
- private void cleanUp() {
+ @AfterClass
+ public static void cleanUp() {
port = null;
remote = null;
if (ctx != null) {
@@ -90,63 +93,56 @@
}
}
- protected void setUp() throws Exception {
- URL wsdlURL = new URL(baseURL +
"/jaxws-jbws1841/EndpointService/EJB3Bean?wsdl");
- QName serviceName = new
QName("http://www.openuri.org/2004/04/HelloWorld",
"EndpointService");
- port = Service.create(wsdlURL, serviceName).getPort(EndpointInterface.class);
-
- ctx = getServerInitialContext();
- remote = (StatelessRemote) ctx.lookup("jaxws-jbws1841//" +
StatelessBean.class.getSimpleName() + "!" + StatelessRemote.class.getName());
+ @Before
+ public void setup() throws Exception {
+ if (port == null) {
+ URL wsdlURL = new URL(baseURL +
"/jaxws-jbws1841/EndpointService/EJB3Bean?wsdl");
+ QName serviceName = new
QName("http://www.openuri.org/2004/04/HelloWorld",
"EndpointService");
+ port = Service.create(wsdlURL, serviceName).getPort(EndpointInterface.class);
+
+ ctx = getServerInitialContext();
+ remote = (StatelessRemote) ctx.lookup("jaxws-jbws1841//" +
StatelessBean.class.getSimpleName() + "!" + StatelessRemote.class.getName());
+ }
}
@Test
@RunAsClient
public void testDirectWSInvocation() throws Exception
{
- setUp();
String result = port.echo("DirectWSInvocation");
assertEquals("DirectWSInvocation", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay1() throws Exception
{
- setUp();
String result = remote.echo1("Relay1");
assertEquals("Relay1", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay2() throws Exception
{
- setUp();
String result = remote.echo2("Relay2");
assertEquals("Relay2", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay3() throws Exception
{
- setUp();
String result = remote.echo3("Relay3");
assertEquals("Relay3", result);
- cleanUp();
}
@Test
@RunAsClient
public void testEJBRelay4() throws Exception
{
- setUp();
String result = remote.echo4("Relay4");
assertEquals("Relay4", result);
- cleanUp();
}
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -49,9 +49,6 @@
@RunWith(Arquillian.class)
public class AddressingStatefulTestCase extends JBossWSTest
{
- private static AddressingPort port1;
- private static AddressingPort port2;
-
@ArquillianResource
private URL baseURL;
@@ -68,49 +65,31 @@
return archive;
}
- protected void setUp() throws Exception {
- super.setUp();
-
+ @Test
+ @RunAsClient
+ public void testItemLifecycle() throws Exception
+ {
URL wsdlURL = new URL(baseURL + "/TestService?wsdl");
QName serviceName = new QName("http://org.jboss.ws/samples/wsaddressing",
"TestService");
Service service1 = Service.create(wsdlURL, serviceName);
- port1 = new AddressingPort(service1.getPort(StatefulEndpoint.class, new
AddressingFeature(true, true)));
+ AddressingPort port1 = new AddressingPort(service1.getPort(StatefulEndpoint.class,
new AddressingFeature(true, true)));
Service service2 = Service.create(wsdlURL, serviceName);
- port2 = new AddressingPort(service2.getPort(StatefulEndpoint.class, new
AddressingFeature(true, true)));
- }
-
- @Test
- @RunAsClient
- public void testItemLifecycle() throws Exception
- {
- setUp();
- firstAddItem();
- secondGetItems();
- thirdCheckout();
- }
-
- private void firstAddItem() throws Exception
- {
+ AddressingPort port2 = new AddressingPort(service2.getPort(StatefulEndpoint.class,
new AddressingFeature(true, true)));
+
port1.addItem("Ice Cream");
port1.addItem("Ferrari");
port2.addItem("Mars Bar");
port2.addItem("Porsche");
- }
-
- private void secondGetItems() throws Exception
- {
+
String items1 = port1.getItems();
assertEquals("[Ice Cream, Ferrari]", items1);
String items2 = port2.getItems();
assertEquals("[Mars Bar, Porsche]", items2);
- }
-
- private void thirdCheckout() throws Exception
- {
+
port1.checkout();
assertEquals("[]", port1.getItems());
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -37,6 +37,8 @@
import org.jboss.shrinkwrap.api.spec.JavaArchive;
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;
@@ -65,22 +67,29 @@
return archive;
}
- public void setUp() throws Exception {
- URL wsdlURL = new URL(baseURL + "/jaxws-samples-context?wsdl");
- QName qname = new QName("http://org.jboss.ws/jaxws/context",
"EndpointService");
- Service service = Service.create(wsdlURL, qname);
- port = (Endpoint) service.getPort(Endpoint.class);
-
- BindingProvider bp = (BindingProvider) port;
- bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
- bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"thefrog");
+ @Before
+ public void setup() throws Exception {
+ if (port == null) {
+ URL wsdlURL = new URL(baseURL + "/jaxws-samples-context?wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/context",
"EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ port = (Endpoint) service.getPort(Endpoint.class);
+
+ BindingProvider bp = (BindingProvider) port;
+ bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"kermit");
+ bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"thefrog");
+ }
}
+
+ @AfterClass
+ public static void clean() {
+ port = null;
+ }
@Test
@RunAsClient
public void testGetWebContext() throws Exception
{
- setUp();
String retStr = port.testGetMessageContext();
assertEquals("pass", retStr);
}
@@ -89,7 +98,6 @@
@RunAsClient
public void testMessageContextProperties() throws Exception
{
- setUp();
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
@@ -98,7 +106,6 @@
@RunAsClient
public void testGetUserPrincipal() throws Exception
{
- setUp();
String retStr = port.testGetUserPrincipal();
assertEquals("kermit", retStr);
}
@@ -107,7 +114,6 @@
@RunAsClient
public void testIsUserInRole() throws Exception
{
- setUp();
assertTrue("kermit is my friend",
port.testIsUserInRole("friend"));
}
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -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;
@@ -67,23 +69,29 @@
return archive;
}
-
- public void setUp() throws Exception {
- URL wsdlURL = new URL(baseURL + "/jaxws-samples-context-jse?wsdl");
- QName qname = new QName("http://org.jboss.ws/jaxws/context",
"EndpointService");
- Service service = Service.create(wsdlURL, qname);
- port = (Endpoint) service.getPort(Endpoint.class);
-
- BindingProvider bp = (BindingProvider) port;
- bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
- bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"thefrog");
+ @Before
+ public void setup() throws Exception {
+ if (port == null) {
+ URL wsdlURL = new URL(baseURL + "/jaxws-samples-context-jse?wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/context",
"EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ port = (Endpoint) service.getPort(Endpoint.class);
+
+ BindingProvider bp = (BindingProvider) port;
+ bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"kermit");
+ bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"thefrog");
+ }
}
+
+ @AfterClass
+ public static void cleanup() {
+ port = null;
+ }
@Test
@RunAsClient
public void testGetWebContext() throws Exception
{
- setUp();
String retStr = port.testGetMessageContext();
assertEquals("pass", retStr);
}
@@ -92,7 +100,6 @@
@RunAsClient
public void testMessageContextProperties() throws Exception
{
- setUp();
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
@@ -101,7 +108,6 @@
@RunAsClient
public void testGetUserPrincipal() throws Exception
{
- setUp();
String retStr = port.testGetUserPrincipal();
assertEquals("kermit", retStr);
}
@@ -110,7 +116,6 @@
@RunAsClient
public void testIsUserInRole() throws Exception
{
- setUp();
assertTrue("kermit is my friend",
port.testIsUserInRole("friend"));
}
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -34,6 +34,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.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -75,15 +77,20 @@
return archive;
}
- protected void setUp() throws Exception {
+ @BeforeClass
+ public static void setup() throws Exception {
data = new DataHandler("Client data", "text/plain");
}
+
+ @AfterClass
+ public static void clean() {
+ data = null;
+ }
@Test
@RunAsClient
public void testBeanAnnotationWithBare() throws Exception
{
- setUp();
Service service = Service.create(new URL(baseURL +
"/jaxws-swaref/BareEndpointService/BareEndpoint?wsdl"), bareServiceQName);
BareEndpoint port = service.getPort(BareEndpoint.class);
DocumentPayload response = port.beanAnnotation(new DocumentPayload(data));
@@ -94,7 +101,6 @@
@RunAsClient
public void testBeanAnnotationWithWrapped() throws Exception
{
- setUp();
Service service = Service.create(new
URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"),
wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
@@ -106,7 +112,6 @@
@RunAsClient
public void testParameterAnnotationWithWrapped() throws Exception
{
- setUp();
Service service = Service.create(new
URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"),
wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
@@ -119,7 +124,6 @@
@RunAsClient
public void testBeanAnnotationWithRPC() throws Exception
{
- setUp();
Service service = Service.create(new
URL(baseURL+"/jaxws-swaref/RpcLitEndpointService/RpcLitEndpoint?wsdl"),
rpcLitServiceQName);
RpcLitEndpoint port = service.getPort(RpcLitEndpoint.class);
@@ -132,7 +136,6 @@
@RunAsClient
public void testListAnnotationWithWrapped() throws Exception
{
- setUp();
//[JBWS-2708]
Service service = Service.create(new
URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"),
wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java 2015-02-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webparam/WebParamTestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -35,7 +35,7 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.junit.After;
+import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -115,8 +115,8 @@
port.securePing(doc, secHeader);
}
- @After
- public void resetPort() {
+ @AfterClass
+ public static void cleanupPort() {
port = null;
}
}
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-12
16:54:59 UTC (rev 19452)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webresult/WebResultTestCase.java 2015-02-13
14:43:07 UTC (rev 19453)
@@ -55,8 +55,6 @@
{
private String targetNS =
"http://webresult.samples.jaxws.ws.test.jboss.org/";
- private static CustomerService port;
-
@ArquillianResource
private URL baseURL;
@@ -72,23 +70,16 @@
return archive;
}
- public void setUp() throws Exception
- {
- if (port == null)
- {
- QName serviceName = new QName(targetNS, "CustomerServiceService");
- URL wsdlURL =
getResourceURL("jaxws/samples/webresult/META-INF/wsdl/CustomerService.wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(CustomerService.class);
- }
- }
-
@Test
@RunAsClient
public void testLocateCustomer() throws Exception
{
- setUp();
+ QName serviceName = new QName(targetNS, "CustomerServiceService");
+ URL wsdlURL =
getResourceURL("jaxws/samples/webresult/META-INF/wsdl/CustomerService.wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ CustomerService port = service.getPort(CustomerService.class);
+
USAddress addr = new USAddress();
addr.setAddress("Wall Street");