Author: rsearls
Date: 2014-12-23 12:42:45 -0500 (Tue, 23 Dec 2014)
New Revision: 19232
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java
Log:
arquillian migration httpbinding test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java 2014-12-23
17:25:31 UTC (rev 19231)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpJAXBTestCase.java 2014-12-23
17:42:45 UTC (rev 19232)
@@ -35,7 +35,15 @@
import javax.xml.ws.Service.Mode;
import javax.xml.ws.http.HTTPBinding;
-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.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -50,11 +58,15 @@
* @author Thomas.Diesler(a)jboss.org
* @since 02-Apr-2007
*/
+(a)RunWith(Arquillian.class)
public class HttpJAXBTestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new
JBossWSTestHelper.WarDeployment("jaxws-samples-httpbinding-jaxb.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-httpbinding-jaxb.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.samples.httpbinding.ProviderBeanJAXB.class)
@@ -63,23 +75,20 @@
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/httpbinding/jaxb/META-INF/permissions.xml"),
"permissions.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/httpbinding/shared/wsdl/HttpBinding.wsdl"),
"wsdl/HttpBinding.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/httpbinding/jaxb/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(HttpJAXBTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testWSDLAccess() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-httpbinding-jaxb/ProviderEndpoint?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ProviderEndpoint?wsdl");
Element wsdl = DOMUtils.parse(wsdlURL.openStream());
assertNotNull(wsdl);
}
+ @Test
+ @RunAsClient
public void testProviderDispatch() throws Exception
{
Dispatch<Object> dispatch = createDispatch("ProviderEndpoint");
@@ -97,7 +106,7 @@
String targetNS = "http://org.jboss.ws/httpbinding";
QName serviceName = new QName(targetNS, "ProviderService");
QName portName = new QName(targetNS, "ProviderPort");
- URL endpointAddress = new URL("http://" + getServerHost() +
":8080/jaxws-samples-httpbinding-jaxb/" + target);
+ URL endpointAddress = new URL(baseURL + "/" + target);
Service service = Service.create(serviceName);
service.addPort(portName, HTTPBinding.HTTP_BINDING,
endpointAddress.toExternalForm());
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java 2014-12-23
17:25:31 UTC (rev 19231)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java 2014-12-23
17:42:45 UTC (rev 19232)
@@ -36,7 +36,15 @@
import javax.xml.ws.Service.Mode;
import javax.xml.ws.http.HTTPBinding;
-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.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -51,13 +59,17 @@
* @author Thomas.Diesler(a)jboss.org
* @since 29-Jun-2006
*/
+(a)RunWith(Arquillian.class)
public class HttpPayloadTestCase extends JBossWSTest
{
private String reqString = "<ns1:somePayload
xmlns:ns1='http://org.jboss.ws/httpbinding'>Hello</ns1:somePayload>";
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new
JBossWSTestHelper.WarDeployment("jaxws-samples-httpbinding-payload.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-httpbinding-payload.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.samples.httpbinding.LogicalSourceHandler.class)
@@ -65,23 +77,20 @@
.addAsResource("org/jboss/test/ws/jaxws/samples/httpbinding/httpbinding-handlers.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/httpbinding/shared/wsdl/HttpBinding.wsdl"),
"wsdl/HttpBinding.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/httpbinding/payload/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(HttpPayloadTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testWSDLAccess() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-httpbinding-payload?wsdl");
+ URL wsdlURL = new URL(baseURL + "?wsdl");
Element wsdl = DOMUtils.parse(wsdlURL.openStream());
assertNotNull(wsdl);
}
+ @Test
+ @RunAsClient
public void testProviderDispatch() throws Exception
{
Dispatch<Source> dispatch = createDispatch("ProviderEndpoint");
@@ -99,7 +108,7 @@
String targetNS = "http://org.jboss.ws/httpbinding";
QName serviceName = new QName(targetNS, "ProviderService");
QName portName = new QName(targetNS, "ProviderPort");
- URL endpointAddress = new URL("http://" + getServerHost() +
":8080/jaxws-samples-httpbinding-payload/" + target);
+ URL endpointAddress = new URL(baseURL + "/" + target);
Service service = Service.create(serviceName);
service.addPort(portName, HTTPBinding.HTTP_BINDING,
endpointAddress.toExternalForm());
Show replies by date