Author: rsearls
Date: 2014-12-28 17:35:19 -0500 (Sun, 28 Dec 2014)
New Revision: 19294
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
Log:
arquillian migration webservicerefsec test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2014-12-28
22:21:02 UTC (rev 19293)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2014-12-28
22:35:19 UTC (rev 19294)
@@ -26,7 +26,17 @@
import java.util.LinkedList;
import java.util.List;
-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.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -40,40 +50,41 @@
* @author alessio.soldano(a)jboss.com
* @since 12-May-2010
*/
+(a)RunWith(Arquillian.class)
public class WebServiceRefSecTestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-webservicerefsec";
+ @ArquillianResource
+ private URL baseURL;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new
JBossWSTestHelper.JarDeployment("jaxws-samples-webservicerefsec.jar") { {
+ @Deployment(name="jaxws-samples-webservicerefsec", order=1, testable =
false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"jaxws-samples-webservicerefsec.jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.EndpointImpl.class);
+ return archive;
+ }
+
+ @Deployment(name="jaxws-samples-webservicerefsec-servlet-client", order=2,
testable = false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-webservicerefsec-servlet-client.war");
archive
.addManifest()
-
.addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.EndpointImpl.class);
- }
- });
- list.add(new
JBossWSTestHelper.WarDeployment("jaxws-samples-webservicerefsec-servlet-client.war")
{ {
- archive
- .addManifest()
.addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.Client.class)
.addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint.class)
.addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.EndpointService.class)
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl"),
"wsdl/Endpoint.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/webservicerefsec/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(WebServiceRefSecTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()), true);
- }
-
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-webservicerefsec-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-webservicerefsec-servlet-client?echo=HelloWorld");
assertEquals("HelloWorld",
IOUtils.readAndCloseStream(url.openStream()));
}
}
Show replies by date