Author: rsearls
Date: 2014-12-25 23:27:21 -0500 (Thu, 25 Dec 2014)
New Revision: 19270
Removed:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/DeploymentArchive.java
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java
Log:
arquillian migration asynchronous test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java 2014-12-26
03:55:06 UTC (rev 19269)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java 2014-12-26
04:27:21 UTC (rev 19270)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.samples.asynchronous;
+import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.net.MalformedURLException;
@@ -37,12 +38,21 @@
import javax.xml.ws.Service;
import javax.xml.ws.Service.Mode;
-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;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.w3c.dom.Element;
+import org.jboss.wsf.test.JBossWSTestHelper;
/**
* Test JAXWS asynchrous dispatch
@@ -50,6 +60,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 12-Aug-2006
*/
+(a)RunWith(Arquillian.class)
public class AsynchronousDispatchTestCase extends JBossWSTest
{
private final String targetNS = "http://org.jboss.ws/jaxws/asynchronous";
@@ -57,11 +68,22 @@
private Exception handlerException;
private boolean asyncHandlerCalled;
- public static Test suite()
- {
- return new JBossWSTestSetup(AsynchronousDispatchTestCase.class,
DeploymentArchive.NAME);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-asynchronous.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.asynchronous.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.asynchronous.EndpointBean.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/asynchronous/WEB-INF/web.xml"));
+ return archive;
}
+ @Test
+ @RunAsClient
public void testInvokeAsynch() throws Exception
{
Source reqObj = new StreamSource(new StringReader(reqPayload));
@@ -69,6 +91,8 @@
verifyResponse(response.get(3000, TimeUnit.MILLISECONDS));
}
+ @Test
+ @RunAsClient
public void testInvokeAsynchHandler() throws Exception
{
AsyncHandler<Source> handler = new AsyncHandler<Source>()
@@ -99,7 +123,7 @@
private Dispatch<Source> createDispatch() throws MalformedURLException
{
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-asynchronous?wsdl");
+ URL wsdlURL = new URL(baseURL + "?wsdl");
QName serviceName = new QName(targetNS, "EndpointBeanService");
QName portName = new QName(targetNS, "EndpointPort");
Service service = Service.create(wsdlURL, serviceName);
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java 2014-12-26
03:55:06 UTC (rev 19269)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousProxyTestCase.java 2014-12-26
04:27:21 UTC (rev 19270)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.samples.asynchronous;
+import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.Future;
@@ -31,10 +32,19 @@
import javax.xml.ws.Response;
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.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.JBossWSTestSetup;
+import org.jboss.wsf.test.JBossWSTestHelper;
/**
* Test JAXWS asynchrous proxy
@@ -42,17 +52,29 @@
* @author Thomas.Diesler(a)jboss.org
* @since 12-Aug-2006
*/
+(a)RunWith(Arquillian.class)
public class AsynchronousProxyTestCase extends JBossWSTest
{
private final String targetNS = "http://org.jboss.ws/jaxws/asynchronous";
private Exception handlerException;
private boolean asyncHandlerCalled;
- public static Test suite()
- {
- return new JBossWSTestSetup(AsynchronousProxyTestCase.class,
DeploymentArchive.NAME);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-asynchronous.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.asynchronous.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.asynchronous.EndpointBean.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/asynchronous/WEB-INF/web.xml"));
+ return archive;
}
+ @Test
+ @RunAsClient
public void testInvokeSync() throws Exception
{
Endpoint port = createProxy();
@@ -60,6 +82,8 @@
assertEquals("Hello", retStr);
}
+ @Test
+ @RunAsClient
public void testInvokeAsync() throws Exception
{
Endpoint port = createProxy();
@@ -70,6 +94,8 @@
assertEquals("Async", retStr);
}
+ @Test
+ @RunAsClient
public void testInvokeAsyncHandler() throws Exception
{
AsyncHandler<String> handler = new AsyncHandler<String>()
@@ -106,7 +132,7 @@
private Endpoint createProxy() throws MalformedURLException
{
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-asynchronous?wsdl");
+ URL wsdlURL = new URL(baseURL + "?wsdl");
QName serviceName = new QName(targetNS, "EndpointBeanService");
Service service = Service.create(wsdlURL, serviceName);
return service.getPort(Endpoint.class);
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/DeploymentArchive.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/DeploymentArchive.java 2014-12-26
03:55:06 UTC (rev 19269)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/asynchronous/DeploymentArchive.java 2014-12-26
04:27:21 UTC (rev 19270)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.samples.asynchronous;
-
-import java.io.File;
-
-import org.jboss.wsf.test.JBossWSTestHelper;
-
-public final class DeploymentArchive
-{
- public static final String NAME = getName();
-
- private static String getName() {
- return JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-asynchronous.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.asynchronous.Endpoint.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.asynchronous.EndpointBean.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/asynchronous/WEB-INF/web.xml"));
- }
- });
- }
-
- private DeploymentArchive() {
- //NO OP
- }
-}