Author: rsearls
Date: 2014-12-22 10:56:53 -0500 (Mon, 22 Dec 2014)
New Revision: 19183
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/calendar/CalendarTestCase.java
Log:
arquillian conversion calendar test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/calendar/CalendarTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/calendar/CalendarTestCase.java 2014-12-22
15:43:10 UTC (rev 19182)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/calendar/CalendarTestCase.java 2014-12-22
15:56:53 UTC (rev 19183)
@@ -36,7 +36,15 @@
import javax.xml.ws.Service;
import javax.xml.ws.Service.Mode;
-import junit.framework.Test;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+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.ArchivePath;
import org.jboss.shrinkwrap.api.Filter;
@@ -51,35 +59,32 @@
* @author alessio.soldano(a)jboss.com
* @since 22-Apr-2014
*/
+(a)RunWith(Arquillian.class)
public class CalendarTestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-calendar/EndpointService";
+ @ArquillianResource
+ private URL baseURL;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-calendar.war") { {
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-calendar.war");
archive
- .addManifest()
- .addPackages(false, new Filter<ArchivePath>() {
- @Override
- public boolean include(ArchivePath path)
- {
- return !path.get().contains("TestCase");
- }
- }, "org.jboss.test.ws.jaxws.calendar");
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ .addManifest()
+ .addPackages(false, new Filter<ArchivePath>() {
+ @Override
+ public boolean include(ArchivePath path)
+ {
+ return !path.get().contains("TestCase");
+ }
+ }, "org.jboss.test.ws.jaxws.calendar");
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(CalendarTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testCalendar() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/EndpointService?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/calendar",
"EndpointService");
Service service = Service.create(wsdlURL, qname);
CalendarEndpoint port = service.getPort(CalendarEndpoint.class);
@@ -90,9 +95,11 @@
assertEquals(calendar.getTimeInMillis(), response.getTimeInMillis());
}
+ @Test
+ @RunAsClient
public void testXMLGregorianCalendar() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/EndpointService?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/calendar",
"EndpointService");
Service service = Service.create(wsdlURL, qname);
CalendarEndpoint port = service.getPort(CalendarEndpoint.class);
@@ -103,9 +110,11 @@
Object response = port.echoXMLGregorianCalendar(calendar);
assertEquals("2002-04-05T00:00:00.000Z", response.toString());
}
-
+
+ @Test
+ @RunAsClient
public void testEmptyCalendar() throws Exception {
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/EndpointService?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/calendar",
"EndpointService");
Service service = Service.create(wsdlURL, qname);
Show replies by date