Author: rsearls
Date: 2014-12-28 17:21:02 -0500 (Sun, 28 Dec 2014)
New Revision: 19293
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefServletTestCase.java
Log:
arquillian migration serviceref test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.java 2014-12-28
21:35:51 UTC (rev 19292)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.java 2014-12-28
22:21:02 UTC (rev 19293)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.samples.serviceref;
+import java.io.File;
import java.io.InputStream;
import java.net.URL;
@@ -28,7 +29,20 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.jboss.arquillian.container.test.api.Deployer;
+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.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.test.ws.jaxws.samples.serviceref.EJBRemote;
import org.jboss.ws.common.IOUtils;
@@ -41,23 +55,60 @@
* @author Thomas.Diesler(a)jboss.com
* @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
*/
+(a)RunWith(Arquillian.class)
public class ServiceRefEJBTestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-serviceref";
-
- public static Test suite()
- {
- return new JBossWSTestSetup(ServiceRefEJBTestCase.class,
DeploymentArchives.getServerArchiveFilename() + "," +
DeploymentArchives.getEJBClientArchiveFilename());
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(name="jaxws-samples-serviceref", order=1, testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-serviceref.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EndpointService.class)
+ .setWebXML(
+ new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/serviceref/WEB-INF/web.xml"));
+ return archive;
}
+ @Deployment(name = "jaxws-samples-serviceref-ejbclient", order = 2, testable
= false)
+ public static JavaArchive createDeployment1() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"jaxws-samples-serviceref-ejbclient.jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EJBClient.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EJBRemote.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EndpointService.class)
+ .addAsManifestResource(
+ new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/samples/serviceref/META-INF/ejb-jar.xml"),
"ejb-jar.xml")
+ .addAsManifestResource(
+ new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/samples/serviceref/META-INF/permissions.xml"),
"permissions.xml")
+ .addAsManifestResource(
+ new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/samples/serviceref/META-INF/wsdl/Endpoint.wsdl"),
"wsdl/Endpoint.wsdl");
+ return archive;
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-serviceref")
public void testWSDLAccess() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "?wsdl");
InputStream inputStream = wsdlURL.openStream();
assertNotNull(inputStream);
IOUtils.readAndCloseStream(inputStream);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-serviceref")
public void testDynamicProxy() throws Exception
{
URL wsdlURL =
getResourceURL("jaxws/samples/serviceref/META-INF/wsdl/Endpoint.wsdl");
@@ -70,6 +121,9 @@
assertEquals(helloWorld, retObj);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-serviceref")
public void testEJBClient() throws Exception
{
InitialContext iniCtx = null;
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefServletTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefServletTestCase.java 2014-12-28
21:35:51 UTC (rev 19292)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefServletTestCase.java 2014-12-28
22:21:02 UTC (rev 19293)
@@ -21,13 +21,24 @@
*/
package org.jboss.test.ws.jaxws.samples.serviceref;
+import java.io.File;
import java.io.InputStream;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSTestHelper;
+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.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -39,24 +50,59 @@
* @author Thomas.Diesler(a)jboss.com
* @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
*/
+(a)RunWith(Arquillian.class)
public class ServiceRefServletTestCase extends JBossWSTest
{
-
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-serviceref";
-
- public static Test suite()
- {
- return new JBossWSTestSetup(ServiceRefServletTestCase.class,
DeploymentArchives.getServerArchiveFilename() + "," +
DeploymentArchives.getServletClientArchiveFilename());
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(name="jaxws-samples-serviceref", order=1, testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-serviceref.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EndpointService.class)
+ .setWebXML(
+ new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/serviceref/WEB-INF/web.xml"));
+ return archive;
}
+ @Deployment(name="jaxws-samples-serviceref-servlet-client", order=2,
testable = false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-serviceref-servlet-client.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.EndpointService.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.ServletClient.class)
+ .addAsWebInfResource(
+ new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/samples/serviceref/META-INF/wsdl/Endpoint.wsdl"),
"wsdl/Endpoint.wsdl")
+ .addAsWebInfResource(
+ new File(JBossWSTestHelper.getTestResourcesDir()
+ +
"/jaxws/samples/serviceref/servlet-client/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
+ .setWebXML(
+ new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/samples/serviceref/servlet-client/WEB-INF/web.xml"));
+ return archive;
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-serviceref-servlet-client")
public void testWSDLAccess() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL("http://" + baseURL.getHost() +
":8080/jaxws-samples-serviceref?wsdl");
InputStream inputStream = wsdlURL.openStream();
assertNotNull(inputStream);
IOUtils.readAndCloseStream(inputStream);
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-serviceref")
public void testDynamicProxy() throws Exception
{
URL wsdlURL =
getResourceURL("jaxws/samples/serviceref/META-INF/wsdl/Endpoint.wsdl");
@@ -69,9 +115,12 @@
assertEquals(helloWorld, retObj);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-serviceref-servlet-client")
public void testServletClient() throws Exception
{
- URL url = new URL(TARGET_ENDPOINT_ADDRESS +
"-servlet-client?echo=HelloWorld");
+ URL url = new URL("http://" + baseURL.getHost() +
":8080/jaxws-samples-serviceref-servlet-client?echo=HelloWorld");
assertEquals("HelloWorld",
IOUtils.readAndCloseStream(url.openStream()));
}