Author: asoldano
Date: 2014-12-01 06:23:50 -0500 (Mon, 01 Dec 2014)
New Revision: 19117
Removed:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/DeploymentArchives.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060EJB3TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060ServletTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3497/JBWS3497TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3593/JBWS3593TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3628/JBWS3628TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/scripts/jbws-testsuite-default.groovy
Log:
More tests conversion...
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/DeploymentArchives.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/DeploymentArchives.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/DeploymentArchives.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -1,59 +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.cxf.jaxbintros;
-
-import java.io.File;
-
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.wsf.test.JBossWSTestHelper;
-
-public final class DeploymentArchives
-{
- public static final String SERVER = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-cxf-jaxbintros.jar") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.EndpointBean.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.UserType.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml"),
"jaxb-intros.xml");
- }
- });
-
- public static final String CLIENT = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-cxf-jaxbintros-client.war") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client
services\n"))
- .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml"), "jaxb-intros.xml")
-
.addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.AnnotatedUserEndpoint.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.AnnotatedUserType.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.Helper.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.UserType.class)
- .addClass(org.jboss.wsf.test.ClientHelper.class)
- .addClass(org.jboss.wsf.test.TestServlet.class);
- }
- });
-
- private DeploymentArchives() {
- //NOOP
- }
-}
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroServletTestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.cxf.jaxbintros;
-
-import java.net.URL;
-
-import junit.framework.Test;
-
-import org.jboss.ws.common.IOUtils;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * Test the JAXBIntroduction features.
- *
- * jaxb-intros.xml can reside under META-INF or WEB-INF and should be
- * picked up by JAXBIntroduction deployment aspect on server side.
- *
- * @author alessio.soldano(a)jboss.com
- */
-public class JAXBIntroServletTestCase extends JBossWSTest
-{
-
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JAXBIntroServletTestCase.class,
DeploymentArchives.SERVER + ", " + DeploymentArchives.CLIENT);
- }
-
- /**
- * Both client and server side use plain UserType class but have jaxbintros in place
to deal with customizations
- *
- * @throws Exception
- */
- public void testEndpoint() throws Exception
- {
- assertEquals("1", runTestInContainer("testEndpoint"));
- }
-
- /**
- * Client side uses the annotated user type class, server side uses the plain one but
has jaxbintros in place
- *
- * @throws Exception
- */
- public void testAnnotatedUserEndpoint() throws Exception
- {
- assertEquals("1",
runTestInContainer("testAnnotatedUserEndpoint"));
- }
-
- private String runTestInContainer(String test) throws Exception
- {
- URL url = new URL("http://" + getServerHost()
- +
":8080/jaxws-cxf-jaxbintros-client?path=/jaxws-cxf-jaxbintros/EndpointService&method="
+ test
- + "&helper=" + Helper.class.getName());
- return IOUtils.readAndCloseStream(url.openStream());
- }
-}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -21,17 +21,28 @@
*/
package org.jboss.test.ws.jaxws.cxf.jaxbintros;
+import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import javax.xml.namespace.QName;
-import junit.framework.Test;
-
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
+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.spec.WebArchive;
import org.jboss.ws.common.DOMUtils;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
import org.w3c.dom.Element;
/**
@@ -42,20 +53,52 @@
*
* @author alessio.soldano(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public class JAXBIntroTestCase extends JBossWSTest
{
-
- private String endpointAddress = "http://" + getServerHost() +
":8080/jaxws-cxf-jaxbintros/EndpointService";
+ private static final String DEP = "jaxws-cxf-jaxbintros";
+ private static final String CLIENT_DEP = "jaxws-cxf-jaxbintros-client";
+
private Helper helper;
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JAXBIntroTestCase.class,
DeploymentArchives.SERVER);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(name = DEP, testable = false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, DEP +
".jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.EndpointBean.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.UserType.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml"),
"jaxb-intros.xml");
+ return archive;
}
+ @Deployment(name = CLIENT_DEP, testable = false)
+ public static WebArchive createDeployment2() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, CLIENT_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client
services\n"))
+ .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml"), "jaxb-intros.xml")
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.AnnotatedUserEndpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.AnnotatedUserType.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.Helper.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jaxbintros.UserType.class)
+ .addClass(org.jboss.wsf.test.ClientHelper.class)
+ .addClass(org.jboss.wsf.test.TestServlet.class);
+ return archive;
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(DEP)
public void testWSDLAccess() throws Exception
{
- URL wsdlURL = new URL(endpointAddress + "?wsdl");
+ URL wsdlURL = new URL(baseURL +
"/jaxws-cxf-jaxbintros/EndpointService?wsdl");
Element wsdl = DOMUtils.parse(wsdlURL.openStream());
assertNotNull(wsdl);
Iterator<Element> it = DOMUtils.getChildElements(wsdl, new
QName("http://www.w3.org/2001/XMLSchema","attribute"), true);
@@ -75,7 +118,7 @@
{
if (helper == null)
{
- helper = new Helper(endpointAddress);
+ helper = new Helper(baseURL +
"/jaxws-cxf-jaxbintros/EndpointService");
helper.setJAXBIntroURL(getResourceURL("jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml"));
}
return helper;
@@ -86,6 +129,9 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(DEP)
public void testEndpoint() throws Exception
{
assertTrue(getHelper().testEndpoint());
@@ -96,8 +142,44 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(DEP)
public void testAnnotatedUserEndpoint() throws Exception
{
assertTrue(getHelper().testAnnotatedUserEndpoint());
}
+
+ /**
+ * Both client and server side use plain UserType class but have jaxbintros in place
to deal with customizations
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(CLIENT_DEP)
+ public void testEndpointInContainer() throws Exception
+ {
+ assertEquals("1", runTestInContainer("testEndpoint"));
+ }
+
+ /**
+ * Client side uses the annotated user type class, server side uses the plain one but
has jaxbintros in place
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(CLIENT_DEP)
+ public void testAnnotatedUserEndpointInContainer() throws Exception
+ {
+ assertEquals("1",
runTestInContainer("testAnnotatedUserEndpoint"));
+ }
+
+ private String runTestInContainer(String test) throws Exception
+ {
+ URL url = new URL(baseURL +
"?path=/jaxws-cxf-jaxbintros/EndpointService&method=" + test
+ + "&helper=" + Helper.class.getName());
+ return IOUtils.readAndCloseStream(url.openStream());
+ }
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060EJB3TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060EJB3TestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060EJB3TestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -21,54 +21,47 @@
*/
package org.jboss.test.ws.jaxws.cxf.jbws3060;
-import java.util.LinkedList;
-import java.util.List;
+import java.net.URL;
-import junit.framework.Test;
-
+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.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.runner.RunWith;
/**
*
* @author alessio.soldano(a)jboss.com
* @since 11-Jun-2010
*/
+(a)RunWith(Arquillian.class)
public class JBWS3060EJB3TestCase extends JBWS3060Tests
{
- private String endpointOneURL = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3060/ServiceOne/EndpointOne";
- private String endpointTwoURL = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3060/ServiceTwo/EndpointTwo";
+ @ArquillianResource
+ private URL baseURL;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-cxf-jbws3060.jar") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.logging\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointOneEJB3Impl.class)
-
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointTwoEJB3Impl.class);
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @Deployment(testable = false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"jaxws-cxf-jbws3060.jar");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointOneEJB3Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointTwoEJB3Impl.class);
+ return archive;
}
-
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JBWS3060EJB3TestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+
@Override
protected String getEndpointOneURL()
{
- return endpointOneURL;
+ return baseURL + "/jaxws-cxf-jbws3060/ServiceOne/EndpointOne";
}
@Override
protected String getEndpointTwoURL()
{
- return endpointTwoURL;
+ return baseURL + "/jaxws-cxf-jbws3060/ServiceTwo/EndpointTwo";
}
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060ServletTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060ServletTestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060ServletTestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -22,55 +22,49 @@
package org.jboss.test.ws.jaxws.cxf.jbws3060;
import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
+import java.net.URL;
-import junit.framework.Test;
-
+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.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.junit.runner.RunWith;
/**
*
* @author alessio.soldano(a)jboss.com
* @since 11-Jun-2010
*/
+(a)RunWith(Arquillian.class)
public class JBWS3060ServletTestCase extends JBWS3060Tests
{
- private String endpointOneURL = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3060-jse/ServiceOne/EndpointOne";
- private String endpointTwoURL = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3060-jse/ServiceTwo/EndpointTwo";
+ @ArquillianResource
+ private URL baseURL;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new
JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3060-jse.war") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.logging\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointOneImpl.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointTwoImpl.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3060/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @Deployment(testable = false)
+ public static WebArchive createDeploymentJse() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-jbws3060-jse.war");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointOneImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3060.EndpointTwoImpl.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3060/WEB-INF/web.xml"));
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JBWS3060ServletTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
@Override
protected String getEndpointOneURL()
{
- return endpointOneURL;
+ return baseURL + "/ServiceOne/EndpointOne";
}
@Override
protected String getEndpointTwoURL()
{
- return endpointTwoURL;
+ return baseURL + "/ServiceTwo/EndpointTwo";
}
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -33,7 +33,9 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Test;
/**
*
@@ -53,6 +55,8 @@
protected abstract String getEndpointTwoURL();
+ @Test
+ @RunAsClient
public void testAccess() throws Exception
{
initPorts();
@@ -66,11 +70,15 @@
assertEquals(1, portTwo.getCount() - count2);
}
+ @Test
+ @RunAsClient
public void testConcurrentInvocations() throws Exception
{
runConcurrentTests(false);
}
+ @Test
+ @RunAsClient
public void testConcurrentOneWayInvocations() throws Exception
{
runConcurrentTests(true);
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -23,25 +23,27 @@
import java.io.File;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
-
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.ClientLifeCycleListener;
import org.apache.cxf.endpoint.ClientLifeCycleManager;
import org.apache.cxf.endpoint.ServerLifeCycleManager;
+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.spec.WebArchive;
import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Verifies the Bus is properly configured with Client/Server LifeCycleManager instances
@@ -49,28 +51,23 @@
* @author alessio.soldano(a)jboss.com
* @since 08-Aug-2010
*/
+(a)RunWith(Arquillian.class)
public class ClientServerLifeCycleTestCase extends JBossWSTest
{
- private String endpointOneURL = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3098/ServiceOne/EndpointOne";
- private String targetNS = "http://org.jboss.ws.jaxws.cxf/jbws3098";
-
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3098.war") {
{
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3098.EndpointOneImpl.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3098/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-jbws3098.war");
+ archive.addManifest()
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3098.EndpointOneImpl.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3098/WEB-INF/web.xml"));
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(ClientServerLifeCycleTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testClientLifeCycleManager()
{
Bus bus = BusFactory.newInstance().createBus();
@@ -81,6 +78,8 @@
}
}
+ @Test
+ @RunAsClient
public void testServerLifeCycleManager()
{
Bus bus = BusFactory.newInstance().createBus();
@@ -91,13 +90,15 @@
}
}
+ @Test
+ @RunAsClient
public void testCustomClientLifeCycleListener() throws Exception
{
Bus bus = BusFactory.newInstance().createBus();
BusFactory.setThreadDefaultBus(bus);
try {
- URL wsdlOneURL = new URL(endpointOneURL + "?wsdl");
- QName serviceOneName = new QName(targetNS, "ServiceOne");
+ URL wsdlOneURL = new URL(baseURL + "/ServiceOne/EndpointOne?wsdl");
+ QName serviceOneName = new
QName("http://org.jboss.ws.jaxws.cxf/jbws3098", "ServiceOne");
Service serviceOne = Service.create(wsdlOneURL, serviceOneName, new
UseThreadBusFeature());
CustomClientLifeCycleListener listener = new CustomClientLifeCycleListener();
ClientLifeCycleManager mgr = bus.getExtension(ClientLifeCycleManager.class);
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3497/JBWS3497TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3497/JBWS3497TestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3497/JBWS3497TestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -25,7 +25,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
@@ -35,13 +34,17 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.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.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* [JBWS-3497] Add ability to configure the queue depth on the asynchronous (@Oneway)
work queue.
@@ -49,31 +52,29 @@
* @author alessio.soldano(a)jboss.com
*
*/
+(a)RunWith(Arquillian.class)
public class JBWS3497TestCase extends JBossWSTest
{
private EndpointOne portOne;
protected int defaultSize = 200;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-cxf-jbws3497.jar") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies:
org.apache.cxf,org.jboss.ws.cxf.jbossws-cxf-server\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3497.EndpointOne.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3497.EndpointOneImpl.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3497/META-INF/jboss-webservices.xml"),
"jboss-webservices.xml");
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"jaxws-cxf-jbws3497.jar");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies:
org.apache.cxf,org.jboss.ws.cxf.jbossws-cxf-server\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3497.EndpointOne.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3497.EndpointOneImpl.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3497/META-INF/jboss-webservices.xml"),
"jboss-webservices.xml");
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JBWS3497TestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testAccess() throws Exception
{
initPorts();
@@ -115,7 +116,7 @@
private void initPorts() throws MalformedURLException
{
- URL wsdlOneURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3497/ServiceOne/EndpointOne?wsdl");
+ URL wsdlOneURL = new URL(baseURL +
"/jaxws-cxf-jbws3497/ServiceOne/EndpointOne?wsdl");
QName serviceOneName = new
QName("http://org.jboss.ws.jaxws.cxf/jbws3497", "ServiceOne");
Service serviceOne = Service.create(wsdlOneURL, serviceOneName);
portOne = (EndpointOne)serviceOne.getPort(EndpointOne.class);
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3516/JBWS3516TestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -23,8 +23,6 @@
import java.io.File;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -32,49 +30,49 @@
import javax.xml.ws.Service;
import javax.xml.ws.soap.AddressingFeature;
-import junit.framework.Test;
-
import org.apache.cxf.ws.addressing.AddressingProperties;
import org.apache.cxf.ws.addressing.AttributedURIType;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
import org.apache.cxf.ws.addressing.JAXWSAConstants;
+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.ArchivePath;
import org.jboss.shrinkwrap.api.Filter;
+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;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
-import org.jboss.wsf.test.JBossWSTestSetup;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+(a)RunWith(Arquillian.class)
public class JBWS3516TestCase extends JBossWSTest
{
- public final String endpointAddress = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3516/helloworld";
-
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3516.war") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.apache.cxf.impl\n"))
- .addPackages(false, new Filter<ArchivePath>() {
- @Override
- public boolean include(ArchivePath object)
- {
- return !object.get().contains("TestCase");
- }}, "org.jboss.test.ws.jaxws.cxf.jbws3516")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3516/WEB-INF/wsdl/hello_world.wsdl"),
"wsdl/hello_world.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3516/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-jbws3516.war");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.apache.cxf.impl\n"))
+ .addPackages(false, new Filter<ArchivePath>() {
+ @Override
+ public boolean include(ArchivePath object)
+ {
+ return !object.get().contains("TestCase");
+ }}, "org.jboss.test.ws.jaxws.cxf.jbws3516")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3516/WEB-INF/wsdl/hello_world.wsdl"),
"wsdl/hello_world.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3516/WEB-INF/web.xml"));
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS3516TestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testOneWayFaultTo() throws Exception
{
Greeter greeter = initPort();
@@ -103,6 +101,8 @@
}
+ @Test
+ @RunAsClient
public void testRequestResponseFaultTo() throws Exception
{
Greeter greeter = initPort();
@@ -140,7 +140,7 @@
private Greeter initPort() throws Exception
{
- URL wsdlURL = new URL(endpointAddress + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/helloworld?wsdl");
QName qname = new
QName("http://jboss.org/hello_world",
"SOAPService");
Service service = Service.create(wsdlURL, qname);
Greeter greeter = service.getPort(Greeter.class, new AddressingFeature());
@@ -149,7 +149,7 @@
private String getTargetServletResult() throws Exception
{
- URL url = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3516/target/result");
+ URL url = new URL(baseURL + "/target/result");
return IOUtils.readAndCloseStream(url.openStream());
}
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3593/JBWS3593TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3593/JBWS3593TestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3593/JBWS3593TestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -37,44 +37,43 @@
import javax.xml.ws.handler.Handler;
import javax.xml.ws.soap.SOAPBinding;
-import junit.framework.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.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
-import org.jboss.wsf.test.JBossWSTestSetup;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
*
* @author alessio.soldano(a)jboss.com
* @since 18-Jun-2013
*/
+(a)RunWith(Arquillian.class)
public class JBWS3593TestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-cxf-jbws3593/EndpointBean";
-
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3593.war") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.apache.cxf\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3593.EndpointBean.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3593.MTOMOutInterceptor.class);
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-jbws3593.war");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.apache.cxf\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3593.EndpointBean.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3593.MTOMOutInterceptor.class);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS3593TestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testMTOMAccess() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/EndpointBean?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/jbws3593",
"EndpointBeanService");
Service service = Service.create(wsdlURL, qname);
Endpoint port = service.getPort(Endpoint.class);
@@ -88,9 +87,11 @@
assertEquals("Hello Jimbo", messg);
}
+ @Test
+ @RunAsClient
public void testTextXmlAccess() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/EndpointBean?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/jbws3593",
"EndpointBeanService");
Service service = Service.create(wsdlURL, qname);
Endpoint port = service.getPort(Endpoint.class);
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3628/JBWS3628TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3628/JBWS3628TestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3628/JBWS3628TestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -23,21 +23,22 @@
import java.io.File;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.extensions.TestSetup;
-import junit.framework.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.ws.common.IOUtils;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* Testcase for system property expansion support in WSDL documents.
@@ -45,54 +46,36 @@
* @author alessio.soldano(a)jboss.com
* @since 21-Jul-2014
*/
+(a)RunWith(Arquillian.class)
public class JBWS3628TestCase extends JBossWSTest
{
private static final String POLICY_NAME = "WS-Addressing_policy";
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3628.war") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.apache.cxf\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3628.EndpointOneImpl.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3628.CheckInterceptor.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3628/WEB-INF/wsdl/service.wsdl"),
"wsdl/service.wsdl");
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-jbws3628.war");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.apache.cxf\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3628.EndpointOneImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3628.CheckInterceptor.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3628/WEB-INF/wsdl/service.wsdl"),
"wsdl/service.wsdl");
+ return archive;
}
- public static Test suite()
- {
- TestSetup setup = new JBossWSCXFTestSetup(JBWS3628TestCase.class,
JBossWSTestHelper.writeToFile(createDeployments())) {
-
- private static final String PROPERTY_NAME =
"org.jboss.wsf.test.JBWS3628TestCase.policy";
- private String formerValue;
-
- @Override
- public void setUp() throws Exception {
- formerValue = JBossWSTestHelper.setSystemProperty(PROPERTY_NAME,
POLICY_NAME);
- super.setUp();
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- JBossWSTestHelper.setSystemProperty(PROPERTY_NAME, formerValue);
- formerValue = null;
- }
- };
- return setup;
- }
-
+ @Test
+ @RunAsClient
public void testWSDL() throws Exception {
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3628/ServiceOne" + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ServiceOne" + "?wsdl");
checkPolicyReference(wsdlURL, POLICY_NAME);
}
+ @Test
+ @RunAsClient
public void testInvocation() throws Exception {
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3628/ServiceOne" + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ServiceOne" + "?wsdl");
Service service = Service.create(wsdlURL, new
QName("http://org.jboss.ws.jaxws.cxf/jbws3628", "ServiceOne"));
EndpointOne port = service.getPort(new
QName("http://org.jboss.ws.jaxws.cxf/jbws3628", "EndpointOnePort"),
EndpointOne.class);
assertEquals("Foo", port.echo("Foo"));
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -25,27 +25,30 @@
import java.io.File;
import java.io.PrintWriter;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
-import junit.framework.Test;
-
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.message.Message;
import org.apache.cxf.ws.security.SecurityConstants;
+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.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.CryptoHelper;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.jboss.wsf.test.WrapThreadContextClassLoader;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
*
@@ -53,42 +56,45 @@
* @author alessio.soldano(a)jboss.com
* @since 13-Jun-2013
*/
+(a)RunWith(Arquillian.class)
public class PolicyAttachmentTestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3648-b.war")
{ {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-jbws3648-b.war");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,
org.apache.ws.security\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointFour.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointFourImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointThree.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointThreeImpl.class)
+
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.KeystorePasswordCallback.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/WEB-INF/bob.jks"), "classes/bob.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/WEB-INF/bob.properties"),
"classes/bob.properties")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/policies/My-WSSE-conf-BINDING.xml"),
+ "classes/META-INF/policies/My-WSSE-conf-BINDING.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/policies/org.jboss.wsf.stack.cxf.extensions.policy.PolicyAttachmentStore"),
+
"classes/META-INF/policies/org.jboss.wsf.stack.cxf.extensions.policy.PolicyAttachmentStore");
+ return archive;
+ }
+
+ @Override
+ protected String getClientJarPaths() {
+ return JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-cxf-jbws3648-b-client.jar") { {
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,
org.apache.ws.security\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointFour.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointFourImpl.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointThree.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointThreeImpl.class)
-
.addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.KeystorePasswordCallback.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/WEB-INF/bob.jks"), "classes/bob.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/WEB-INF/bob.properties"),
"classes/bob.properties")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/policies/My-WSSE-conf-BINDING.xml"),
- "classes/META-INF/policies/My-WSSE-conf-BINDING.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/policies/org.jboss.wsf.stack.cxf.extensions.policy.PolicyAttachmentStore"),
-
"classes/META-INF/policies/org.jboss.wsf.stack.cxf.extensions.policy.PolicyAttachmentStore");
- }
- });
- list.add(new
JBossWSTestHelper.JarDeployment("jaxws-cxf-jbws3648-b-client.jar") { {
- archive
.addManifest()
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/META-INF/alice.jks"), "alice.jks")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/jbws3648-b/META-INF/alice.properties"),
"alice.properties");
}
});
- return list.toArray(new BaseDeployment<?>[list.size()]);
}
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(PolicyAttachmentTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
+ @WrapThreadContextClassLoader
public void testEndpointWithWSSEAndWSA() throws Exception {
Bus bus = BusFactory.newInstance().createBus();
BusFactory.setThreadDefaultBus(bus);
@@ -97,7 +103,7 @@
try {
bus.getInInterceptors().add(new LoggingInInterceptor(pw));
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3648-b/ServiceThree" + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ServiceThree?wsdl");
QName serviceName = new
QName("http://org.jboss.ws.jaxws.cxf/jbws3648", "ServiceThree");
Service service = Service.create(wsdlURL, serviceName, new
UseThreadBusFeature());
EndpointThree proxy = (EndpointThree)service.getPort(EndpointThree.class);
@@ -114,6 +120,9 @@
}
}
+ @Test
+ @RunAsClient
+ @WrapThreadContextClassLoader
public void testEndpointWithCustomWSSEAndWSA() throws Exception {
Bus bus = BusFactory.newInstance().createBus();
BusFactory.setThreadDefaultBus(bus);
@@ -122,7 +131,7 @@
try {
bus.getInInterceptors().add(new LoggingInInterceptor(pw));
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3648-b/ServiceFour" + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ServiceFour?wsdl");
QName serviceName = new
QName("http://org.jboss.ws.jaxws.cxf/jbws3648", "ServiceFour");
Service service = Service.create(wsdlURL, serviceName, new
UseThreadBusFeature());
EndpointFour proxy = (EndpointFour)service.getPort(EndpointFour.class);
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java 2014-12-01
11:23:50 UTC (rev 19117)
@@ -22,17 +22,18 @@
package org.jboss.test.ws.jaxws.cxf.jbws3648;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-import junit.framework.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.ws.common.IOUtils;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
*
@@ -40,29 +41,27 @@
* @author alessio.soldano(a)jboss.com
* @since 06-Jun-2013
*/
+(a)RunWith(Arquillian.class)
public class PolicyAttachmentWSDLTestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3648.war") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointOneImpl.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointTwo.class)
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointTwoImpl.class);
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-jbws3648.war");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointOneImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointTwo.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointTwoImpl.class);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(PolicyAttachmentWSDLTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testEndpointOneWSDL() throws Exception {
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3648/ServiceOne" + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ServiceOne?wsdl");
checkPolicyAttachments(wsdlURL, new
String[]{"WS-RM_Policy_spec_example",
"WS-SP-EX223_binding_policy",
"WS-SP-EX223_Binding_Operation_Input_Policy",
@@ -70,9 +69,11 @@
"WS-Addressing_binding_policy"});
}
+ @Test
+ @RunAsClient
public void testEndpointTwoWSDL() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3648/ServiceTwo" + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ServiceTwo?wsdl");
checkPolicyAttachments(wsdlURL, new
String[]{"WS-RM_Policy_spec_example",
"WS-SP-EX223_binding_policy",
"WS-SP-EX223_Binding_Operation_Input_Policy",
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/scripts/jbws-testsuite-default.groovy
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/scripts/jbws-testsuite-default.groovy 2014-11-27
17:40:48 UTC (rev 19116)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/scripts/jbws-testsuite-default.groovy 2014-12-01
11:23:50 UTC (rev 19117)
@@ -197,6 +197,14 @@
/**
+ *
+ * Add a system property for JBWS-3628 testcase
+ */
+root.children().add(1, new Node(null, 'system-properties', null)) //add
system-properties node after the extensions
+def systemProperties = root.'system-properties'[0]
+systemProperties.appendNode('property',
['name':'org.jboss.wsf.test.JBWS3628TestCase.policy','value':'WS-Addressing_policy'])
+
+/**
* Save the configuration to a new file
*/