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);
Show replies by date