Author: rsearls
Date: 2014-12-23 11:19:29 -0500 (Tue, 23 Dec 2014)
New Revision: 19227
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java
Log:
arquillian migration addressing test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java 2014-12-23
15:41:01 UTC (rev 19226)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/addressing/AddressingStatefulTestCase.java 2014-12-23
16:19:29 UTC (rev 19227)
@@ -30,7 +30,15 @@
import javax.xml.ws.Service;
import javax.xml.ws.soap.AddressingFeature;
-import junit.framework.Test;
+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.wsf.test.CleanupOperation;
import org.jboss.wsf.test.JBossWSTest;
@@ -45,14 +53,18 @@
* @author alessio.soldano(a)jboss.com
* @since 24-Nov-2005
*/
+(a)RunWith(Arquillian.class)
public class AddressingStatefulTestCase extends JBossWSTest
{
private static AddressingPort port1;
private static AddressingPort port2;
-
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsaddressing.war") { {
+
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-wsaddressing.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.samples.addressing.ServerHandler.class)
@@ -60,41 +72,27 @@
.addClass(org.jboss.test.ws.jaxws.samples.addressing.StatefulEndpointImpl.class)
.addAsResource("org/jboss/test/ws/jaxws/samples/addressing/jaxws-handlers.xml")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/addressing/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(AddressingStatefulTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()), new CleanupOperation() {
- @Override
- public void cleanUp() {
- port1 = null;
- port2 = null;
- }
- });
- }
-
- protected void setUp() throws Exception
- {
+ protected void setUp() throws Exception {
super.setUp();
- if (port1 == null || port2 == null)
- {
- URL wsdlURL = new URL(" http://" + getServerHost() +
":8080/jaxws-samples-wsaddressing/TestService?wsdl");
- QName serviceName = new
QName("http://org.jboss.ws/samples/wsaddressing", "TestService");
+ 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)));
+ Service service1 = Service.create(wsdlURL, serviceName);
+ 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)));
- }
+ 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();
Show replies by date