JBossWS SVN: r19314 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-03 12:20:43 -0500 (Sat, 03 Jan 2015)
New Revision: 19314
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java
Log:
arquillian migration jbws1178 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java 2015-01-03 17:18:51 UTC (rev 19313)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java 2015-01-03 17:20:43 UTC (rev 19314)
@@ -36,7 +36,15 @@
import javax.xml.ws.Service;
import junit.extensions.TestSetup;
-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.ws.common.ObjectNameFactory;
import org.jboss.wsf.test.JBossWSTest;
@@ -51,51 +59,46 @@
* @author Thomas.Diesler(a)jboss.com
* @since 05-Oct-2006
*/
+(a)RunWith(Arquillian.class)
public class JBWS1178TestCaseForked extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws1178.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws1178.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws1178.EndpointImpl.class)
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1178/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- TestSetup testSetup = new JBossWSTestSetup(JBWS1178TestCaseForked.class, JBossWSTestHelper.writeToFile(createDeployments()))
- {
- private final ObjectName objectName = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
- private String webServiceHost;
+ private final ObjectName objectName = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+ private String webServiceHost;
- public void setUp() throws Exception
- {
- // Setting the WebServiceHost to an empty string, causes the request host to be used.
- // This must be done before deploy time.
- webServiceHost = (String)getServer().getAttribute(objectName, "WebServiceHost");
- getServer().setAttribute(objectName, new Attribute("WebServiceHost", ""));
- super.setUp();
- }
+ public void setUp() throws Exception {
+ // Setting the WebServiceHost to an empty string, causes the request host to be used.
+ // This must be done before deploy time.
+ webServiceHost = (String) getServer().getAttribute(objectName, "WebServiceHost");
+ getServer().setAttribute(objectName, new Attribute("WebServiceHost", ""));
+ super.setUp();
+ }
- public void tearDown() throws Exception
- {
- super.tearDown();
- getServer().setAttribute(objectName, new Attribute("WebServiceHost", webServiceHost));
- }
- };
- return testSetup;
+ public void tearDown() throws Exception {
+ super.tearDown();
+ getServer().setAttribute(objectName, new Attribute("WebServiceHost", webServiceHost));
}
-
+ @Test
+ @RunAsClient
public void testHostAddress() throws Exception
{
+ setUp();
InetAddress inetAddr = InetAddress.getByName(getServerHost());
String hostAddress = inetAddr instanceof Inet6Address ? "[" + inetAddr.getHostAddress() + "]" : inetAddr.getHostAddress();
- URL wsdlURL = new URL("http://" + hostAddress + ":8080/jaxws-jbws1178/testpattern?wsdl");
+ URL wsdlURL = new URL(baseURL + "/testpattern?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jbws1178", "EndpointService");
Service service = Service.create(wsdlURL, serviceName);
@@ -104,12 +107,16 @@
URL epURL = new URL((String)reqCtx.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
assertEquals(wsdlURL.getHost(), epURL.getHost());
+ tearDown();
}
+ @Test
+ @RunAsClient
public void testHostName() throws Exception
{
+ setUp();
InetAddress inetAddr = InetAddress.getByName(getServerHost());
- URL wsdlURL = new URL("http://" + inetAddr.getHostName() + ":8080/jaxws-jbws1178/testpattern?wsdl");
+ URL wsdlURL = new URL(baseURL + "/testpattern?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jbws1178", "EndpointService");
Service service = Service.create(wsdlURL, serviceName);
@@ -118,5 +125,6 @@
URL epURL = new URL((String)reqCtx.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
assertEquals(wsdlURL.getHost(), epURL.getHost());
+ tearDown();
}
}
9 years, 11 months
JBossWS SVN: r19313 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-03 12:18:51 -0500 (Sat, 03 Jan 2015)
New Revision: 19313
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java
Log:
arquillian migration jbws2937 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java 2015-01-03 17:16:18 UTC (rev 19312)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2937/JBWS2937TestCase.java 2015-01-03 17:18:51 UTC (rev 19313)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.jbws2937;
+import java.io.File;
import java.io.StringReader;
import java.net.URL;
import java.util.LinkedList;
@@ -40,7 +41,17 @@
import javax.xml.ws.WebServiceFeature;
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.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.logging.Logger;
import org.jboss.shrinkwrap.api.ArchivePath;
@@ -58,9 +69,9 @@
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2937TestCase extends JBossWSTest
{
- private static final String ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2937";
private static final WebServiceFeature[] ADDRESSING_ENABLED = { new AddressingFeature(true) };
private static final WebServiceFeature[] ADDRESSING_DISABLED = { new AddressingFeature(false) };
private static final String NAMESPACE_URI = "http://jboss.org/jbws2937";
@@ -76,41 +87,44 @@
private Endpoint proxy;
private EndpointReference epr;
private UserType user;
-
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-jbws2937-client.jar") { {
+
+
+ //@ArquillianResource
+ //private URL baseURL;
+
+ @Deployment(name="jaxws-jbws2937-client", order=2, testable = false)
+ public static JavaArchive createDeployment1() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws2937-client.jar");
archive
- .addManifest()
- .addPackages(false, new Filter<ArchivePath>() {
- @Override
- public boolean include(ArchivePath path)
- {
- return !path.get().contains("TestCase");
- }
- }, "org.jboss.test.ws.jaxws.jbws2937");
- }
- });
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-jbws2937.jar") { {
+ .addManifest()
+ .addPackages(false, new Filter<ArchivePath>() {
+ @Override
+ public boolean include(ArchivePath path) {
+ return !path.get().contains("TestCase");
+ }
+ }, "org.jboss.test.ws.jaxws.jbws2937");
+
+ System.out.println("###: " + archive.toString(true) ); // rls debug
+ archive.as(ZipExporter.class).exportTo(new File("/tmp/u4/jaxws-jbws2937-client.jar"), true); // rls debug
+
+ return archive;
+ }
+
+ @Deployment(name="jaxws-jbws2937", order=1, testable = false)
+ public static JavaArchive createDeployment2() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws2937.jar");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2937.EndpointImpl.class)
.addClass(org.jboss.test.ws.jaxws.jbws2937.UserType.class);
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS2937TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
protected void setUp() throws Exception
{
super.setUp();
- URL wsdlURL = new URL(ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2937" + "?wsdl");
this.service = EndpointService.create(wsdlURL, SERVICE_QNAME);
this.proxy = (Endpoint)this.service.getPort(PORT_QNAME, Endpoint.class);
this.epr = ((BindingProvider)this.proxy).getEndpointReference();
@@ -119,15 +133,23 @@
this.user.setString("Kermit");
this.user.setQname(new QName("TheFrog"));
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws2937-client")
public void testProxy() throws Exception
{
+ setUp();
final UserType response = this.proxy.echo(this.user);
assertEquals(this.user, response);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws2937-client")
public void testCreateDispatchUsingEPRAndSource() throws Exception
{
+ setUp();
Dispatch<Source> dispatch = this.service.createDispatch(PORT_QNAME, Source.class, Mode.PAYLOAD);
assertNotNull("Dispatch is null", dispatch);
this.invokeSourceDispatch(dispatch);
@@ -146,9 +168,13 @@
this.epr = dispatch.getEndpointReference();
printEPR(this.epr);
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws2937-client")
public void testCreateDispatchUsingEPRAndJAXBContext() throws Exception
{
+ setUp();
Dispatch<Object> dispatch = this.service.createDispatch(PORT_QNAME, this.createJAXBContext(), Mode.PAYLOAD);
assertNotNull("Dispatch is null", dispatch);
this.invokeObjectDispatch(dispatch);
9 years, 11 months
JBossWS SVN: r19312 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-03 12:16:18 -0500 (Sat, 03 Jan 2015)
New Revision: 19312
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.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/ServiceRefClientTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2015-01-03 16:57:47 UTC (rev 19311)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2015-01-03 17:16:18 UTC (rev 19312)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.samples.serviceref;
+import java.io.File;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
@@ -29,7 +30,21 @@
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.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.Archive;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -42,23 +57,74 @@
* @author Thomas.Diesler(a)jboss.com
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
+(a)RunWith(Arquillian.class)
public class ServiceRefClientTestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-serviceref";
+ private static String fullAppclientDepName;
+ @ArquillianResource
+ private URL baseURL;
- public static Test suite()
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(name="jaxws-samples-serviceref", testable = false)
+ public static WebArchive createClientDeployment() {
+ 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;
+ }
+
+ private static final String DEPLOYMENT = "jaxws-samples-serviceref-appclient";
+
+ @Deployment(name = DEPLOYMENT, testable = false, managed = false)
+ public static EnterpriseArchive createDeployment1() {
+ JavaArchive archive1 = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-serviceref-appclient.jar");
+ archive1
+ .setManifest(
+ new StringAsset("Manifest-Version: 1.0\n"
+ + "main-class: org.jboss.test.ws.jaxws.samples.serviceref.ApplicationClient\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.serviceref.ApplicationClient.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/application-client.xml"), "application-client.xml")
+ .addAsManifestResource(
+ new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/samples/serviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl");
+ writeToDisk(archive1);
+
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, DEPLOYMENT + ".ear");
+ archive.addManifest().addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-samples-serviceref-appclient.jar"));
+ writeToDisk(archive);
+ fullAppclientDepName = archive.getName() + "#" + archive1.getName();
+ return archive;
+ }
+
+ public static void writeToDisk(Archive archive)
{
- return new JBossWSTestSetup(ServiceRefClientTestCase.class, DeploymentArchives.getServerArchiveFilename());
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
+ @Test
+ @RunAsClient
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
public void testDynamicProxy() throws Exception
{
URL wsdlURL = getResourceURL("jaxws/samples/serviceref/META-INF/wsdl/Endpoint.wsdl");
@@ -71,12 +137,18 @@
assertEquals(request, response);
}
+ /** todo:
+ * Arquillian does not have like function to deploy client app.
+ * Need to create functionality to run this test in aqruillian.
+ **/
+ @Test
+ @RunAsClient
public void testApplicationClient() throws Exception
{
try
{
final OutputStream appclientOS = new ByteArrayOutputStream();
- JBossWSTestHelper.deployAppclient(DeploymentArchives.getAppclientEarArchiveFilename() + "#" + DeploymentArchives.getAppclientJarArchiveFilename(), appclientOS, "Hello World!");
+ JBossWSTestHelper.deployAppclient(fullAppclientDepName, appclientOS, "Hello World!");
// wait till appclient stops
String appclientLog = appclientOS.toString();
while (!appclientLog.contains("stopped in")) {
@@ -91,7 +163,8 @@
}
finally
{
- JBossWSTestHelper.undeployAppclient(DeploymentArchives.getAppclientEarArchiveFilename() + "#" + DeploymentArchives.getAppclientJarArchiveFilename(), false);
+ JBossWSTestHelper.undeployAppclient(fullAppclientDepName, false);
}
}
+
}
9 years, 11 months
JBossWS SVN: r19311 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-03 11:57:47 -0500 (Sat, 03 Jan 2015)
New Revision: 19311
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/DeploymentArchives.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java
Log:
arquillian migration webserviceref test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/DeploymentArchives.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/DeploymentArchives.java 2015-01-03 03:23:39 UTC (rev 19310)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/DeploymentArchives.java 2015-01-03 16:57:47 UTC (rev 19311)
@@ -22,92 +22,104 @@
package org.jboss.test.ws.jaxws.samples.webserviceref;
import java.io.File;
+import java.lang.System;
import org.jboss.shrinkwrap.api.asset.StringAsset;
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.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.Archive;
+
public final class DeploymentArchives
{
- private final String server;
- private final String appclient;
- private final String appclientEar;
- private final String ejbClient;
- private final String servletClient;
-
- private static final DeploymentArchives me = new DeploymentArchives();
-
- public static String getServerArchiveFilename() {
- return me.server;
+ public static final String DEP_EJB3_CLIENT_JAR = "jaxws-samples-webserviceref-ejb3-client";
+ public static JavaArchive getEJBClientArchiveFilename() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-webserviceref-ejb3-client.jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EJB3Client.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EJB3Remote.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/jboss.xml"), "jboss.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/permissions.xml"), "permissions.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl");
+ return archive;
}
-
- public static String getAppclientJarArchiveFilename() {
- return me.appclient;
+
+ public static final String DEP_WAR = "jaxws-samples-webserviceref";
+
+ public static WebArchive getServerArchiveFilename() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webserviceref.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointImpl.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF/web.xml"));
+ return archive;
}
-
- public static String getAppclientEarArchiveFilename() {
- return me.appclientEar;
+
+ public static final String DEP_APPCLIENT_JAR ="jaxws-samples-webserviceref-appclient";
+
+ public static JavaArchive getAppclientJarArchiveFilename() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-webserviceref-appclient.jar");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "main-class: org.jboss.test.ws.jaxws.samples.webserviceref.EndpointClientOne\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointClientOne.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/application-client.xml"), "application-client.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/jboss-client.xml"), "jboss-client.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl");
+ writeToDisk(archive);
+ return archive;
}
-
- public static String getEJBClientArchiveFilename() {
- return me.ejbClient;
+
+ public static final String DEP_APPCLIENT_EAR="jaxws-samples-webserviceref-appclient";
+
+ public static EnterpriseArchive getAppclientEarArchiveFilename() {
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "jaxws-samples-webserviceref-appclient.ear");
+ archive
+ .addManifest()
+ .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-samples-webserviceref-appclient.jar"));
+ writeToDisk(archive);
+ return archive;
}
-
- public static String getServletClientArchiveFilename() {
- return me.servletClient;
+
+ public static final String DEP_SERVLET_CLIENT_WAR = "jaxws-samples-webserviceref-servlet-client";
+
+ public static WebArchive getServletClientArchiveFilename() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webserviceref-servlet-client.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.MultipleEndpointService.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.ServletClient.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF-client/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF-client/web.xml"));
+ return archive;
}
-
- private DeploymentArchives() {
- ejbClient = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-webserviceref-ejb3-client.jar") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EJB3Client.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EJB3Remote.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/jboss.xml"), "jboss.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/permissions.xml"), "permissions.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl");
- }
- });
- server = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-webserviceref.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointImpl.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF/web.xml"));
- }
- });
- appclient = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-webserviceref-appclient.jar") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "main-class: org.jboss.test.ws.jaxws.samples.webserviceref.EndpointClientOne\n"))
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointClientOne.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/application-client.xml"), "application-client.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/jboss-client.xml"), "jboss-client.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl");
- }
- });
- appclientEar = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-webserviceref-appclient.ear") { {
- archive
- .addManifest()
- .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-samples-webserviceref-appclient.jar"));
- }
- });
- servletClient = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-webserviceref-servlet-client.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.MultipleEndpointService.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.ServletClient.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF-client/jboss-web.xml"), "jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF-client/web.xml"));
- }
- });
+
+ public static void writeToDisk(Archive archive)
+ {
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
}
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java 2015-01-03 03:23:39 UTC (rev 19310)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java 2015-01-03 16:57:47 UTC (rev 19311)
@@ -24,11 +24,24 @@
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.net.URL;
+import java.io.File;
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.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.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
@@ -40,18 +53,36 @@
* @author Thomas.Diesler(a)jboss.com
* @since 23-Oct-2005
*/
+(a)RunWith(Arquillian.class)
public class WebServiceRefClientTestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-webserviceref";
- public static Test suite()
- {
- return new JBossWSTestSetup(WebServiceRefClientTestCase.class, DeploymentArchives.getServerArchiveFilename());
+ private static String fullAppclientDepName;
+
+ @ArquillianResource
+ private URL baseURL;
+
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(name=DeploymentArchives.DEP_WAR, testable = false)
+ public static WebArchive createDeployment() {
+ return DeploymentArchives.getServerArchiveFilename();
}
+ @Deployment(name = DeploymentArchives.DEP_APPCLIENT_EAR, testable = false, managed = false)
+ public static EnterpriseArchive createDeployment1() {
+ JavaArchive jarArchive = DeploymentArchives.getAppclientJarArchiveFilename();
+ EnterpriseArchive earArchive = DeploymentArchives.getAppclientEarArchiveFilename();
+ fullAppclientDepName = earArchive.getName() + "#" + jarArchive.getName();
+ return earArchive;
+ }
+
+ @Test
+ @RunAsClient
public void testGeneratedService() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "?wsdl");
QName serviceQName = new QName("http://org.jboss.ws/wsref", "EndpointService");
EndpointService service = new EndpointService(wsdlURL, serviceQName);
@@ -62,9 +93,11 @@
assertEquals(helloWorld, retObj);
}
+ @Test
+ @RunAsClient
public void testDynamicProxy() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "?wsdl");
QName serviceQName = new QName("http://org.jboss.ws/wsref", "EndpointService");
Service service = Service.create(wsdlURL, serviceQName);
Endpoint port = service.getPort(Endpoint.class);
@@ -73,10 +106,14 @@
Object retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
}
-
+ /** todo:
+ * Arquillian does not have like function to deploy client app.
+ * Need to create functionality to run this test in aqruillian.
+ **/
+ @Test
+ @RunAsClient
public void testApplicationClient() throws Throwable
{
- final String fullAppclientDepName = DeploymentArchives.getAppclientEarArchiveFilename() + "#" + DeploymentArchives.getAppclientJarArchiveFilename();
try
{
final String appclientArg = "Hello World!";
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java 2015-01-03 03:23:39 UTC (rev 19310)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java 2015-01-03 16:57:47 UTC (rev 19311)
@@ -37,8 +37,6 @@
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;
@@ -62,31 +60,14 @@
@ArquillianResource
Deployer deployer;
- @Deployment(testable = false)
+ @Deployment(name=DeploymentArchives.DEP_WAR, testable = false)
public static WebArchive createDeployment() {
- WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webserviceref.war");
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointImpl.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF/web.xml"));
- return archive;
+ return DeploymentArchives.getServerArchiveFilename();
}
- private static final String DEPLOYMENT = "jaxws-samples-webserviceref-ejb3-client";
- @Deployment(name = DEPLOYMENT, testable = false, managed = false)
+ @Deployment(name = DeploymentArchives.DEP_EJB3_CLIENT_JAR, testable = false, managed = false)
public static JavaArchive createDeployment1(){
- JavaArchive archive = ShrinkWrap.create(JavaArchive.class, DEPLOYMENT + ".jar");
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EJB3Client.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EJB3Remote.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/jboss.xml"), "jboss.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/permissions.xml"), "permissions.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl");
- return archive;
+ return DeploymentArchives.getEJBClientArchiveFilename();
}
@Test
@@ -106,7 +87,7 @@
public void testEJB3Client() throws Exception
{
InitialContext iniCtx = null;
- deployer.deploy(DEPLOYMENT);
+ deployer.deploy(DeploymentArchives.DEP_EJB3_CLIENT_JAR);
try
{
iniCtx = getServerInitialContext();
@@ -122,7 +103,7 @@
{
iniCtx.close();
}
- deployer.undeploy(DEPLOYMENT);
+ deployer.undeploy(DeploymentArchives.DEP_EJB3_CLIENT_JAR);
}
}
}
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java 2015-01-03 03:23:39 UTC (rev 19310)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java 2015-01-03 16:57:47 UTC (rev 19311)
@@ -36,8 +36,6 @@
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.ws.common.IOUtils;
@@ -54,39 +52,20 @@
@RunWith(Arquillian.class)
public class WebServiceRefServletTestCase extends JBossWSTest
{
- @ArquillianResource
- private URL baseURL;
+ @ArquillianResource
+ private URL baseURL;
@ArquillianResource
Deployer deployer;
- @Deployment(testable = false)
+ @Deployment(name=DeploymentArchives.DEP_WAR, testable = false)
public static WebArchive createDeployment() {
- WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webserviceref.war");
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointImpl.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF/web.xml"));
- return archive;
+ return DeploymentArchives.getServerArchiveFilename();
}
- private static final String DEPLOYMENT = "jaxws-samples-webserviceref-servlet-client";
-
- @Deployment(name = DEPLOYMENT, testable = false, managed = false)
+ @Deployment(name = DeploymentArchives.DEP_SERVLET_CLIENT_WAR, testable = false, managed = false)
public static WebArchive createDeployment1() {
-
- WebArchive archive = ShrinkWrap.create(WebArchive.class, DEPLOYMENT + ".war");
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.MultipleEndpointService.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webserviceref.ServletClient.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF-client/jboss-web.xml"), "jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/WEB-INF-client/web.xml"));
- return archive;
+ return DeploymentArchives.getServletClientArchiveFilename();
}
@Test
@@ -107,7 +86,7 @@
@RunAsClient
public void testServletClient() throws Exception
{
- deployer.deploy(DEPLOYMENT);
+ deployer.deploy(DeploymentArchives.DEP_SERVLET_CLIENT_WAR);
try
{
String text = baseURL.toString().substring(0, baseURL.toString().length()-1);
@@ -116,7 +95,7 @@
}
finally
{
- deployer.undeploy(DEPLOYMENT);
+ deployer.undeploy(DeploymentArchives.DEP_SERVLET_CLIENT_WAR);
}
}
}
9 years, 11 months
JBossWS SVN: r19310 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-02 22:23:39 -0500 (Fri, 02 Jan 2015)
New Revision: 19310
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
Log:
arquillian migration clientConfig test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2015-01-02 21:25:47 UTC (rev 19309)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2015-01-03 03:23:39 UTC (rev 19310)
@@ -26,7 +26,18 @@
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.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.ws.common.IOUtils;
@@ -41,11 +52,15 @@
* @author alessio.soldano(a)jboss.com
* @since 31-May-2012
*/
+(a)RunWith(Arquillian.class)
public class ClientConfigurationTestCaseForked extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-clientConfig-inContainer-client.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(name="jaxws-clientConfig-inContainer-client", testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-clientConfig-inContainer-client.war");
archive
.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.jboss.ws.common\n"))
@@ -62,32 +77,34 @@
.addClass(org.jboss.test.ws.jaxws.clientConfig.TestUtils.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.UserHandler.class)
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/clientConfig/META-INF/permissions.xml"), "permissions.xml");
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-clientConfig.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.EndpointImpl.class);
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(ClientConfigurationTestCaseForked.class, JBossWSTestHelper.writeToFile(createDeployments()));
+ @Deployment(name = "jaxws-clientConfig", testable = false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-clientConfig.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.clientConfig.EndpointImpl.class);
+ return archive;
}
-
+
/**
* Verifies the default client configuration from AS model is used
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testDefaultClientConfigurationInContainer() throws Exception {
assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
}
@@ -97,6 +114,9 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testSEIClassDefaultClientConfigurationInContainer() throws Exception {
assertEquals("1", runTestInContainer("testSEIClassDefaultClientConfiguration"));
}
@@ -107,6 +127,9 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testSEIClassDefaultFileClientConfigurationInContainer() throws Exception {
assertEquals("1", runTestInContainer("testSEIClassDefaultFileClientConfiguration"));
}
@@ -117,18 +140,30 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testCustomClientConfigurationInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfiguration"));
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testCustomClientConfigurationOnDispatchInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatch"));
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfigurationUsingFeature"));
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
public void testCustomClientConfigurationOnDispatchUsingFeatureInContainer() throws Exception {
assertEquals("1", runTestInContainer("testCustomClientConfigurationOnDispatchUsingFeature"));
}
@@ -137,8 +172,8 @@
private String runTestInContainer(String test) throws Exception
{
- URL url = new URL("http://" + getServerHost()
- + ":8080/jaxws-clientConfig-inContainer-client?path=/jaxws-clientConfig/EndpointImpl&method=" + test
+ URL url = new URL(baseURL
+ + "?path=/jaxws-clientConfig/EndpointImpl&method=" + test
+ "&helper=" + Helper.class.getName());
return IOUtils.readAndCloseStream(url.openStream());
}
9 years, 11 months
JBossWS SVN: r19309 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-02 16:25:47 -0500 (Fri, 02 Jan 2015)
New Revision: 19309
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java
Log:
arquillian migration handlerauth test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java 2015-01-02 17:12:00 UTC (rev 19308)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java 2015-01-02 21:25:47 UTC (rev 19309)
@@ -32,7 +32,16 @@
import javax.xml.ws.BindingProvider;
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.RunAsClient;
+import org.jboss.arquillian.container.test.api.Deployment;
+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.JavaArchive;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
@@ -45,29 +54,39 @@
* @author Alessio Soldano
* @since 24-Sep-2013
*/
+(a)RunWith(Arquillian.class)
public class HandlerAuthTestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-handlerauth2.jar") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(name="jaxws-handlerauth2", order= 1, testable = false)
+ public static JavaArchive createDeployment1() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-handlerauth2.jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.handlerauth.LogicalSimpleHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.handlerauth.SecureEndpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.handlerauth.SecureEndpointImpl2.class)
+ .addAsResource("org/jboss/test/ws/jaxws/handlerauth/handlers2.xml");
+ return archive;
+ }
+
+ @Deployment(name="jaxws-handlerauth", order= 1, testable = false)
+ public static JavaArchive createDeployment2() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-handlerauth.jar");
archive
.addManifest()
- .addClass(org.jboss.test.ws.jaxws.handlerauth.LogicalSimpleHandler.class)
.addClass(org.jboss.test.ws.jaxws.handlerauth.SecureEndpoint.class)
- .addClass(org.jboss.test.ws.jaxws.handlerauth.SecureEndpointImpl2.class)
- .addAsResource("org/jboss/test/ws/jaxws/handlerauth/handlers2.xml");
- }
- });
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-handlerauth.jar") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.handlerauth.SecureEndpoint.class)
.addClass(org.jboss.test.ws.jaxws.handlerauth.SecureEndpointImpl.class)
.addClass(org.jboss.test.ws.jaxws.handlerauth.SimpleHandler.class)
.addAsResource("org/jboss/test/ws/jaxws/handlerauth/handlers.xml");
- }
- });
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-handlerauth3.jar") { {
+ return archive;
+ }
+
+ @Deployment(name="jaxws-handlerauth3", order= 2, testable = false)
+ public static JavaArchive createDeployment3() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-handlerauth3.jar");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.handlerauth.SecureEndpoint.class)
@@ -75,39 +94,34 @@
.addClass(org.jboss.test.ws.jaxws.handlerauth.SimpleHandler.class)
.addAsResource("org/jboss/test/ws/jaxws/handlerauth/handlers.xml")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/handlerauth/META-INF/jboss-webservices.xml"), "jboss-webservices.xml");
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- public static Test suite()
- {
- JBossWSTestSetup testSetup = new JBossWSTestSetup(HandlerAuthTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- Map<String, String> authenticationOptions = new HashMap<String, String>();
- authenticationOptions.put("usersProperties",
- getResourceFile("jaxws/handlerauth/jbossws-users.properties").getAbsolutePath());
- authenticationOptions.put("rolesProperties",
- getResourceFile("jaxws/handlerauth/jbossws-roles.properties").getAbsolutePath());
- testSetup.addSecurityDomainRequirement("handlerauth-security-domain", authenticationOptions);
- return testSetup;
- }
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-handlerauth")
public void testAuthSOAPHandler() throws Exception {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/handlerauth?wsdl");
+ URL wsdlURL = new URL(baseURL + "/handlerauth?wsdl");
Service service = Service.create(wsdlURL, new QName("http://ws/", "SecureEndpointImplService"));
SecureEndpoint port = service.getPort(new QName("http://ws/", "SecureEndpointPort"), SecureEndpoint.class);
testAuth(port);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-handlerauth2")
public void testAuthLogicalHandler() throws Exception {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/handlerauth2?wsdl");
+ URL wsdlURL = new URL(baseURL + "/handlerauth2?wsdl");
Service service = Service.create(wsdlURL, new QName("http://ws/", "SecureEndpointImpl2Service"));
SecureEndpoint port = service.getPort(new QName("http://ws/", "SecureEndpoint2Port"), SecureEndpoint.class);
testAuth(port);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-handlerauth3")
public void testNoHandlerAuth() throws Exception {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/handlerauth3?wsdl");
+ URL wsdlURL = new URL(baseURL + "/handlerauth3?wsdl");
Service service = Service.create(wsdlURL, new QName("http://ws/", "SecureEndpointImpl3Service"));
SecureEndpoint port = service.getPort(new QName("http://ws/", "SecureEndpoint3Port"), SecureEndpoint.class);
setUser((BindingProvider)port, "John", "foo");
9 years, 11 months
JBossWS SVN: r19308 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-02 12:12:00 -0500 (Fri, 02 Jan 2015)
New Revision: 19308
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
Log:
arquillian migration jbws2150 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2015-01-02 14:24:30 UTC (rev 19307)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2015-01-02 17:12:00 UTC (rev 19308)
@@ -42,7 +42,18 @@
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceFeature;
-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.arquillian.container.test.api.Deployer;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.wsf.spi.management.ServerConfig;
@@ -67,15 +78,26 @@
* @author richard.opalka(a)jboss.com
* @author alessio.soldano(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2150TestCaseForked extends JBossWSTest
{
private static final ObjectName SERVER_CONFIG_OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
private static final String NAMESPACE = "http://test.jboss.org/addressrewrite";
private static final String NAMESPACE_IMP = "http://test.jboss.org/addressrewrite/wsdlimp";
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2150.war") { {
+ protected static Boolean modifySOAPAddress;
+ protected static String webServiceHost;
+ protected static int webServicePort;
+ protected static int webServiceSecurePort;
+ protected static String webServicePath;
+ protected static String webServiceUriScheme;
+
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(testable = false, name="dep-jaxws-jbws2150", managed = false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2150.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2150.InvalidSecureService.class)
@@ -86,16 +108,22 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2150/WEB-INF/wsdl/Service.wsdl"), "wsdl/Service.wsdl")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2150/WEB-INF/wsdl/inner.wsdl"), "wsdl/inner.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2150/WEB-INF/web.xml"));
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2150-codefirst.war") { {
+ return archive;
+ }
+
+ @Deployment(testable = false, name="dep-jaxws-jbws2150-codefirst", managed = false)
+ public static WebArchive createDeployment2() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2150-codefirst.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2150.CodeFirstService.class)
.addClass(org.jboss.test.ws.jaxws.jbws2150.ServiceIface.class);
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2150-sec.war") { {
+ return archive;
+ }
+
+ @Deployment(testable = false, name="dep-jaxws-jbws2150-sec", managed = false)
+ public static WebArchive createDeployment3() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2150-sec.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2150.InvalidSecureService.class)
@@ -106,63 +134,37 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2150/WEB-INF/wsdl/Service.wsdl"), "wsdl/Service.wsdl")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2150/WEB-INF/wsdl/inner.wsdl"), "wsdl/inner.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2150/WEB-INF/web-sec.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- static {
- JBossWSTestHelper.writeToFile(createDeployments());
- }
- protected static class JBWS2150TestSetup extends JBossWSTestSetup {
-
- protected static Boolean modifySOAPAddress;
- protected static String webServiceHost;
- protected static int webServicePort;
- protected static int webServiceSecurePort;
- protected static String webServicePath;
- protected static String webServiceUriScheme;
-
- public JBWS2150TestSetup() {
- super(JBWS2150TestCaseForked.class, null);
- }
-
- public void setUp() throws Exception
- {
- modifySOAPAddress = (Boolean)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "ModifySOAPAddress");
- webServiceHost = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceHost");
- webServicePort = (Integer)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServicePort");
- webServiceSecurePort = (Integer)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceSecurePort");
- webServicePath = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServicePathRewriteRule");
- webServiceUriScheme = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceUriScheme");
- super.setUp();
- }
+ public void setUp() throws Exception {
+ modifySOAPAddress = (Boolean) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "ModifySOAPAddress");
+ webServiceHost = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceHost");
+ webServicePort = (Integer) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServicePort");
+ webServiceSecurePort = (Integer) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceSecurePort");
+ webServicePath = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServicePathRewriteRule");
+ webServiceUriScheme = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceUriScheme");
+ super.setUp();
}
- public static Test suite()
- {
- return new JBWS2150TestSetup();
- }
-
public void tearDown() throws Exception
{
- Attribute attr = new Attribute("ModifySOAPAddress", JBWS2150TestSetup.modifySOAPAddress);
+ Attribute attr = new Attribute("ModifySOAPAddress", modifySOAPAddress);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServiceHost", JBWS2150TestSetup.webServiceHost);
+ attr = new Attribute("WebServiceHost", webServiceHost);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServicePort", JBWS2150TestSetup.webServicePort);
+ attr = new Attribute("WebServicePort", webServicePort);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServiceSecurePort", JBWS2150TestSetup.webServiceSecurePort);
+ attr = new Attribute("WebServiceSecurePort", webServiceSecurePort);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServicePathRewriteRule", JBWS2150TestSetup.webServicePath);
+ attr = new Attribute("WebServicePathRewriteRule", webServicePath);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServiceUriScheme", JBWS2150TestSetup.webServiceUriScheme);
+ attr = new Attribute("WebServiceUriScheme", webServiceUriScheme);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
}
private String getWebServiceHost() {
- return JBWS2150TestSetup.webServiceHost;
+ return webServiceHost;
}
/**
@@ -170,10 +172,13 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -230,7 +235,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -239,12 +245,16 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancer() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150.war");
+ //deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -292,7 +302,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -301,11 +312,14 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -352,7 +366,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -361,10 +376,13 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testSecureRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
- deploy("jaxws-jbws2150-sec.war");
+ deployer.deploy("dep-jaxws-jbws2150-sec");
try
{
final Map<String, String> wsdlLocationsSecMap = new HashMap<String, String>();
@@ -412,21 +430,25 @@
}
finally
{
- undeploy("jaxws-jbws2150-sec.war");
+ deployer.undeploy("dep-jaxws-jbws2150-sec");
+ tearDown();
}
}
-
+
/**
* [JBWS-454] Test soap:address URL rewrite according to transport guarantee
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testSecureRewriteLoadBalancer() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150-sec.war");
+ deployer.deploy("dep-jaxws-jbws2150-sec");
try
{
final Map<String, String> wsdlLocationsSecMap = new HashMap<String, String>();
@@ -474,7 +496,8 @@
}
finally
{
- undeploy("jaxws-jbws2150-sec.war");
+ deployer.undeploy("dep-jaxws-jbws2150-sec");
+ tearDown();
}
}
@@ -483,10 +506,13 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testNoRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(false);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -534,19 +560,23 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine is on (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), getWebServiceHost(), false);
@@ -556,19 +586,23 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite when the rewrite engine is off (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testNoRewriteCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(false);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), getWebServiceHost(), false);
@@ -578,21 +612,25 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on and the webServiceHost set to a (fake) load balancer host (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancerCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), testWebServiceHost, true);
@@ -602,23 +640,27 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on , the webServiceHost set to a (fake) load balancer host (code-first endpoint) and forced https scheme
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancerCodeFirstForceHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
setWebServiceSecurePort(443);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
Definition definition = getWSDLDefinition("http://" + getServerHost() + ":8080/jaxws-jbws2150-codefirst/CodeFirstService?wsdl");
@@ -627,22 +669,26 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Basically the same as testRewriteLoadBalancerCodeFirst; even if rewrite is off, we still get the loadbalancer address in the wsdl
* for code-first endpoint, as there's no user provided wsdl with a different address in it.
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testNoRewriteLoadBalancerCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(false);
final String testWebServiceHost = "myloadbalancer2.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), testWebServiceHost, true);
@@ -652,20 +698,24 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on and the webServiceHost set to jbossws.undefined.host (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), getServerHost(), true);
@@ -675,22 +725,26 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite when a path rewrite rule is specified.
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteWithPathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
setWebServicePathRewriteRule(sedCmd);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final String serverHost = getServerHost();
@@ -727,7 +781,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -736,13 +791,16 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteCodeFirstPathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
setWebServicePathRewriteRule(sedCmd);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
final String serverHost = getServerHost();
@@ -754,7 +812,8 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
@@ -764,14 +823,17 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteCodeFirstPathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
String serverHost = getServerHost();
@@ -788,7 +850,8 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
@@ -797,14 +860,17 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewritePathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -853,21 +919,25 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on and forced https scheme and secure port
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteForceHttpsSchemeAndPorts() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceUriScheme("https");
setWebServiceSecurePort(8192);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -916,22 +986,26 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on, the webServiceHost set to a (fake) load balancer host and forced https uri scheme
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancerForceHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -979,7 +1053,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -988,11 +1063,14 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteForceHttp() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
@@ -1039,7 +1117,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -1048,12 +1127,15 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testSecureRewriteOverriddenByForcedHttp() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceUriScheme("http");
setWebServicePort(80);
- deploy("jaxws-jbws2150-sec.war");
+ deployer.deploy("dep-jaxws-jbws2150-sec");
try
{
final Map<String, String> wsdlLocationsSecMap = new HashMap<String, String>();
@@ -1101,23 +1183,27 @@
}
finally
{
- undeploy("jaxws-jbws2150-sec.war");
+ deployer.undeploy("dep-jaxws-jbws2150-sec");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite when a path rewrite rule is specified and https scheme is forced.
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteWithPathRuleAndForcedHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final String serverHost = getServerHost();
@@ -1154,7 +1240,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -1164,15 +1251,18 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteCodeFirstPathRuleAndForcedHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
String serverHost = getServerHost();
@@ -1189,10 +1279,12 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
+
}
-
+
private void checkWsdlAndInvokeCodeFirstEndpoint(String testHost, String expectedWsdlHost, boolean setTargetAddress) throws Exception {
final String addr = "http://" + testHost + ":8080/jaxws-jbws2150-codefirst/CodeFirstService";
final String wsdlLocation = addr + "?wsdl";
9 years, 11 months
JBossWS SVN: r19307 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-02 09:24:30 -0500 (Fri, 02 Jan 2015)
New Revision: 19307
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java
Log:
arquillian migration jbws1283 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java 2015-01-02 14:21:47 UTC (rev 19306)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1283/JBWS1283TestCase.java 2015-01-02 14:24:30 UTC (rev 19307)
@@ -36,7 +36,15 @@
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-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.JavaArchive;
import org.jboss.ws.api.handler.GenericSOAPHandler;
import org.jboss.wsf.test.JBossWSTest;
@@ -47,14 +55,18 @@
/**
* [JBWS-1283] Attachment dropped on outbound messages if they have been added through a handler
*/
+(a)RunWith(Arquillian.class)
public class JBWS1283TestCase extends JBossWSTest
{
private final String targetNS = "http://org.jboss.test.ws/jbws1283";
private JBWS1283Endpoint port;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-jbws1283.jar") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static JavaArchive createDeployments() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1283.jar");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws1283.AttachmentHandler.class)
@@ -63,30 +75,26 @@
.addClass(org.jboss.test.ws.jaxws.jbws1283.JBWS1283TestCase.VerifyAttachmentHandler.class)
.addClass(org.jboss.test.ws.jaxws.jbws1283.JBWS1283TestCase.class)
.addAsResource("org/jboss/test/ws/jaxws/jbws1283/jaxws-handlers-server.xml");
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS1283TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
@Override
protected void setUp() throws Exception
{
super.setUp();
QName serviceName = new QName(targetNS, "JBWS1283Service");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1283/JBWS1283Service/JBWS1283EndpointImpl?wsdl");
+ URL wsdlURL = new URL(baseURL + "/jaxws-jbws1283/JBWS1283Service/JBWS1283EndpointImpl?wsdl");
Service service = Service.create(wsdlURL, serviceName);
port = service.getPort(JBWS1283Endpoint.class);
}
+ @Test
+ @RunAsClient
public void testAttachmentResponse() throws Exception
{
+ setUp();
// Add a client-side handler that verifes existence of the attachment
BindingProvider bindingProvider = (BindingProvider)port;
@SuppressWarnings("rawtypes")
9 years, 11 months
JBossWS SVN: r19306 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-02 09:21:47 -0500 (Fri, 02 Jan 2015)
New Revision: 19306
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
Log:
arquillian migration jbws2978 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java 2015-01-02 14:19:22 UTC (rev 19305)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java 2015-01-02 14:21:47 UTC (rev 19306)
@@ -35,7 +35,15 @@
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPFaultException;
-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;
@@ -47,22 +55,14 @@
*
* @author <a href="ema(a)redhat.com">Jim Ma</a>
*/
+(a)RunWith(Arquillian.class)
public class JBWS2978TestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2978";
-
- private final String requestMessage = "<S:Envelope xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'><S:Header><To xmlns='http://www.w3.org/2005/08/addressing'>"
- + TARGET_ENDPOINT_ADDRESS
- + "</To><Action xmlns='http://www.w3.org/2005/08/addressing'>inputAction</Action>"
- + "<MessageID xmlns='http://www.w3.org/2005/08/addressing'>uuid:56d586f8-980c-48cf-982d-77a2f56e5c5b</MessageID>"
- + "<ReplyTo xmlns='http://www.w3.org/2005/08/addressing'><Address>http://www.w3.org/2005/08/addressing/anonymous</Address></ReplyTo>"
- + "</S:Header><S:Body><ns1:addNumbers xmlns:ns1='http://ws.jboss.org'><arg0>10</arg0><arg1>10</arg1></ns1:addNumbers></S:Body></S:Envelope>";
-
public Service service = null;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2978.war") { {
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2978.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2978.AddNumbers.class)
@@ -71,27 +71,31 @@
.addClass(org.jboss.test.ws.jaxws.jbws2978.AddNumbersResponse.class)
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2978/WEB-INF/jboss-web.xml"), "jboss-web.xml")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2978/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS2978TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
@Override
public void setUp() throws Exception
{
super.setUp();
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2978" + "?wsdl");
QName serviceName = new QName("http://ws.jboss.org", "AddNumbers");
service = Service.create(wsdlURL, serviceName);
}
+ @Test
+ @RunAsClient
public void testCall() throws Exception
{
+ setUp();
+ String text = "http://" + getServerHost() + ":8080/jaxws-jbws2978";
+ String requestMessage = "<S:Envelope xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'><S:Header><To xmlns='http://www.w3.org/2005/08/addressing'>"
+ + text
+ + "</To><Action xmlns='http://www.w3.org/2005/08/addressing'>inputAction</Action>"
+ + "<MessageID xmlns='http://www.w3.org/2005/08/addressing'>uuid:56d586f8-980c-48cf-982d-77a2f56e5c5b</MessageID>"
+ + "<ReplyTo xmlns='http://www.w3.org/2005/08/addressing'><Address>http://www.w3.org/2005/08/addressing/anonymous</Address></ReplyTo>"
+ + "</S:Header><S:Body><ns1:addNumbers xmlns:ns1='http://ws.jboss.org'><arg0>10</arg0><arg1>10</arg1></ns1:addNumbers></S:Body></S:Envelope>";
+
try
{
Dispatch<SOAPMessage> dispatch = service.createDispatch(new QName("http://ws.jboss.org", "AddNumbersPort"), SOAPMessage.class ,
9 years, 11 months
JBossWS SVN: r19305 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-02 09:19:22 -0500 (Fri, 02 Jan 2015)
New Revision: 19305
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java
Log:
arquillian migration doclit test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java 2015-01-01 21:56:28 UTC (rev 19304)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java 2015-01-02 14:19:22 UTC (rev 19305)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxws.samples.xop.doclit;
import java.io.InputStream;
+import java.lang.System;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -33,7 +34,14 @@
import javax.xml.ws.handler.Handler;
import javax.xml.ws.soap.SOAPBinding;
-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.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -50,22 +58,22 @@
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @since 05.12.2006
*/
+(a)RunWith(Arquillian.class)
public class XOPHandlerTestCase extends XOPBase
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-xop-doclit/bare";
+ @ArquillianResource
+ private URL baseURL;
- public static Test suite()
- {
- return new JBossWSTestSetup(XOPHandlerTestCase.class, DeploymentArchive.NAME);
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ return DeploymentArchive.createDeployment();
}
@Override
protected void setUp() throws Exception
{
-
QName serviceName = new QName("http://doclit.xop.samples.jaxws.ws.test.jboss.org/", "MTOMService");
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
-
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-xop-doclit/bare" + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
port = service.getPort(MTOMEndpoint.class);
binding = (SOAPBinding)((BindingProvider)port).getBinding();
@@ -81,11 +89,12 @@
* Consumption of inlined data should will always result on 'application/octet-stream'
* @throws Exception
*/
- @Override
+ @Test
+ @RunAsClient
public void testDataHandlerRoundtrip() throws Exception
{
+ setUp();
getBinding().setMTOMEnabled(true);
-
DataHandler dh = new DataHandler("Client Data", "text/plain");
DHResponse response = getPort().echoDataHandler(new DHRequest(dh));
assertNotNull(response);
@@ -97,9 +106,11 @@
* Consumption of inlined data should will always result on 'application/octet-stream'
* @throws Exception
*/
- @Override
+ @Test
+ @RunAsClient
public void testDataHandlerResponseOptimzed() throws Exception
{
+ setUp();
getBinding().setMTOMEnabled(false);
DataHandler dh = new DataHandler("Client data", "text/plain");
9 years, 11 months