Author: rsearls
Date: 2014-12-21 21:39:43 -0500 (Sun, 21 Dec 2014)
New Revision: 19178
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java
Log:
arquillian conversion jbws3753 test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java 2014-12-22
02:26:55 UTC (rev 19177)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java 2014-12-22
02:39:43 UTC (rev 19178)
@@ -29,8 +29,17 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-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.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
@@ -41,11 +50,15 @@
*
* @author alessio.soldano(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public class JBWS3753TestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3753.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws3753.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws3753.ServiceAImpl.class)
@@ -53,32 +66,32 @@
.addClass(org.jboss.test.ws.jaxws.jbws3753.ServiceImpl.class)
.addClass(org.jboss.test.ws.jaxws.jbws3753.ServiceInterface.class)
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws3753/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite() {
- return new JBossWSTestSetup(JBWS3753TestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testService() throws Exception
{
- Service service = Service.create(new URL("http://" + getServerHost() +
":8080/jaxws-jbws3753/service?wsdl"), new
QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
+ Service service = Service.create(new URL(baseURL + "/service?wsdl"), new
QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
ServiceInterface port = service.getPort(ServiceInterface.class);
assertEquals("Hi John", port.greetMe("John"));
}
-
+
+ @Test
+ @RunAsClient
public void testServiceA() throws Exception
{
- Service service = Service.create(new URL("http://" + getServerHost() +
":8080/jaxws-jbws3753/serviceA?wsdl"), new
QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
+ Service service = Service.create(new URL(baseURL + "/serviceA?wsdl"), new
QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
ServiceInterface port = service.getPort(ServiceInterface.class);
assertEquals("(A) Hi John", port.greetMe("John"));
}
+ @Test
+ @RunAsClient
public void testServiceB() throws Exception
{
- Service service = Service.create(new URL("http://" + getServerHost() +
":8080/jaxws-jbws3753/serviceB?wsdl"), new
QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
+ Service service = Service.create(new URL(baseURL + "/serviceB?wsdl"), new
QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
ServiceInterface port = service.getPort(ServiceInterface.class);
assertEquals("(B) Hi John", port.greetMe("John"));
}
Show replies by date