JBossWS SVN: r19173 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3114.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-21 19:41:15 -0500 (Sun, 21 Dec 2014)
New Revision: 19173
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java
Log:
arquillian conversion jbws3114 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java 2014-12-22 00:26:55 UTC (rev 19172)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java 2014-12-22 00:41:15 UTC (rev 19173)
@@ -22,14 +22,22 @@
package org.jboss.test.ws.jaxws.jbws3114;
import java.io.File;
+import java.lang.System;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
import javax.xml.ws.BindingProvider;
-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.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
@@ -38,32 +46,29 @@
* https://jira.jboss.org/browse/JBWS-3114
* @author ema(a)redhat.com
*/
+(a)RunWith(Arquillian.class)
public class JBWS3114TestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3114.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws3114.war");
archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws3114.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3114.EndpointImpl.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3114/WEB-INF/jboss-web.xml"), "jboss-web.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3114/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws3114.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3114.EndpointImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3114/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3114/WEB-INF/web.xml"));
+ return archive;
}
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws3114";
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS3114TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testConfigureTimeout() throws Exception
{
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "?wsdl");
EndpointService service = new EndpointService(wsdlURL);
Endpoint port = service.getEndpointPort();
String response = port.echo("testjbws3114");
11 years
JBossWS SVN: r19172 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-21 19:26:55 -0500 (Sun, 21 Dec 2014)
New Revision: 19172
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java
Log:
arquillian conversion jbws1702 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java 2014-12-22 00:25:41 UTC (rev 19171)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java 2014-12-22 00:26:55 UTC (rev 19172)
@@ -24,6 +24,7 @@
import static org.jboss.wsf.test.JBossWSTestHelper.getTestResourcesDir;
import java.io.File;
+import java.lang.Exception;
import java.lang.System;
import java.net.URL;
import java.util.LinkedList;
11 years
JBossWS SVN: r19171 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-21 19:25:41 -0500 (Sun, 21 Dec 2014)
New Revision: 19171
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java
Log:
arquillian conversion jbws1702 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java 2014-12-22 00:00:30 UTC (rev 19170)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1702/JBWS1702TestCase.java 2014-12-22 00:25:41 UTC (rev 19171)
@@ -24,6 +24,7 @@
import static org.jboss.wsf.test.JBossWSTestHelper.getTestResourcesDir;
import java.io.File;
+import java.lang.System;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
@@ -32,7 +33,15 @@
import javax.xml.ws.BindingProvider;
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.test.ws.jaxws.jbws1702.types.ClassB;
import org.jboss.test.ws.jaxws.jbws1702.types.ClassC;
@@ -48,40 +57,39 @@
*
* @author Heiko.Braun(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public class JBWS1702TestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws1702.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws1702.war");
archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws1702.JBWS1702TestCase.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSBareSEI.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSRpcSEI.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWithDocument_Bare.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWithDocument_Wrapped.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWithRPC_Bare.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWrappedSEI.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ClassA.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ClassB.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ClassC.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ResponseWrapperB.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ResponseWrapperC.class)
- .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws1702/WEB-INF/jboss-web.xml"), "jboss-web.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1702/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.JBWS1702TestCase.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSBareSEI.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSRpcSEI.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWithDocument_Bare.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWithDocument_Wrapped.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWithRPC_Bare.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.SampleWSWrappedSEI.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ClassA.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ClassB.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ClassC.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ResponseWrapperB.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1702.types.ResponseWrapperC.class)
+ .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws1702/WEB-INF/jboss-web.xml"), "jboss-web.xml")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1702/WEB-INF/web.xml"));
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS1702TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testInheritanceRpc() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jbws1702/SampleWSWithRPC_Bare?wsdl");
+ URL wsdlURL = new URL(baseURL + "SampleWSWithRPC_Bare?wsdl");
QName serviceName = new QName("http://jbws1702.jaxws.ws.test.jboss.org/", "SampleWSWithRPC_BareService");
Service service = Service.create(wsdlURL, serviceName);
@@ -90,9 +98,11 @@
assertTrue("Should be an instance of ClassC, but was " + b, (b instanceof ClassC));
}
+ @Test
+ @RunAsClient
public void testInheritanceBare() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jbws1702/SampleWSWithDocument_Bare?wsdl");
+ URL wsdlURL = new URL(baseURL + "SampleWSWithDocument_Bare?wsdl");
QName serviceName = new QName("http://jbws1702.jaxws.ws.test.jboss.org/", "SampleWSWithDocument_BareService");
Service service = Service.create(wsdlURL, serviceName);
@@ -107,9 +117,11 @@
assertNotNull(wrapperC.getData());
}
+ @Test
+ @RunAsClient
public void testInheritanceWrapped() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jbws1702/SampleWSWithDocument_Wrapped?wsdl");
+ URL wsdlURL = new URL(baseURL + "SampleWSWithDocument_Wrapped?wsdl");
QName serviceName = new QName("http://jbws1702.jaxws.ws.test.jboss.org/", "SampleWSWithDocument_WrappedService");
Service service = Service.create(wsdlURL, serviceName);
11 years
JBossWS SVN: r19170 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-21 19:00:30 -0500 (Sun, 21 Dec 2014)
New Revision: 19170
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
Log:
arquillian conversion jbws1422 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java 2014-12-21 22:25:09 UTC (rev 19169)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java 2014-12-22 00:00:30 UTC (rev 19170)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.jbws1422;
+import java.lang.System;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
@@ -28,7 +29,15 @@
import javax.xml.namespace.QName;
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.JavaArchive;
import org.jboss.wsf.test.CleanupOperation;
import org.jboss.wsf.test.JBossWSTest;
@@ -41,49 +50,33 @@
*
* @author Thomas.Diesler(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public class JBWS1422TestCase extends JBossWSTest
{
private static final String TARGET_NAMESPACE = "http://jbws1422.jaxws.ws.test.jboss.org/";
- private static URL wsdlURL;
- private static IWebsvc port;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-jbws1422.jar") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1422.jar");
archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws1422.IWebsvc.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1422.IWebsvcImpl.class);
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws1422.IWebsvc.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1422.IWebsvcImpl.class);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS1422TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()), new CleanupOperation() {
- @Override
- public void cleanUp() {
- port = null;
- }
- });
- }
-
- @Override
- protected void setUp() throws Exception
- {
- if (port == null)
- {
- QName serviceName = new QName(TARGET_NAMESPACE, "JBWS1422Service");
- wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1422/JBWS1422Service/IWebsvcImpl?wsdl");
-
- Service service = Service.create(wsdlURL, serviceName);
- port = service.getPort(IWebsvc.class);
- }
- }
-
+ @Test
+ @RunAsClient
public void testDeployment() throws Exception
{
+ QName serviceName = new QName(TARGET_NAMESPACE, "JBWS1422Service");
+ URL wsdlURL = new URL(baseURL + "/jaxws-jbws1422/JBWS1422Service/IWebsvcImpl?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ IWebsvc port = service.getPort(IWebsvc.class);
String result = port.cancel("myFooBar");
assertEquals("Cancelled-myFooBar", result);
}
11 years
JBossWS SVN: r19169 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-21 17:25:09 -0500 (Sun, 21 Dec 2014)
New Revision: 19169
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java
Log:
arquillian conversion jbws3282 1 of 2 tests
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java 2014-12-21 16:33:45 UTC (rev 19168)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java 2014-12-21 22:25:09 UTC (rev 19169)
@@ -29,8 +29,15 @@
import javax.xml.namespace.QName;
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.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
@@ -45,42 +52,41 @@
* @author alessio.soldano(a)jboss.com
* @since 03-May-2011
*/
+(a)RunWith(Arquillian.class)
public class HandlerChainTestCase extends JBossWSTest
{
private final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3282.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws3282.war");
archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws3282.AuthorizationHandler.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointHandler.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointImpl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint4Impl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint5Impl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint6Impl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.LogHandler.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.RoutingHandler.class)
- .addAsResource("org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml")
- .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml"))
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml"), "my-endpoint-config.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.AuthorizationHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint4Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint5Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint6Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.LogHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.RoutingHandler.class)
+ .addAsResource("org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml")
+ .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml"))
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml"), "my-endpoint-config.xml")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/web.xml"));
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(HandlerChainTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testHandlerChain() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ep?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
@@ -94,10 +100,12 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testHandlerChain4() throws Exception
{
QName serviceName = new QName(targetNS, "Endpoint4ImplService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep4?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ep4?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
@@ -112,10 +120,12 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testHandlerChain5() throws Exception
{
QName serviceName = new QName(targetNS, "Endpoint5ImplService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep5?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ep5?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
@@ -130,10 +140,12 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testHandlerChain6() throws Exception
{
QName serviceName = new QName(targetNS, "Endpoint6ImplService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep6?wsdl");
+ URL wsdlURL = new URL(baseURL + "/ep6?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
11 years
JBossWS SVN: r19168 - in stack/cxf/branches/arquillian/modules/testsuite/shared-tests: src/test/java/org/jboss/test/ws/publish and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-21 11:33:45 -0500 (Sun, 21 Dec 2014)
New Revision: 19168
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java
Log:
arquillian conversion publish test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml 2014-12-20 20:28:51 UTC (rev 19167)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml 2014-12-21 16:33:45 UTC (rev 19168)
@@ -108,7 +108,7 @@
</execution>
</executions>
</plugin>
- <!-- rls
+
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
@@ -151,7 +151,7 @@
</execution>
</executions>
</plugin>
- rls -->
+
<plugin> <!-- This copies jbossws-cxf-factories jar to endorsed dir before the integration-tests are run -->
<artifactId>maven-resources-plugin</artifactId>
<executions>
@@ -178,7 +178,7 @@
</plugins>
</build>
</profile>
- <!-- rls
+
<profile>
<id>build-benchmarks</id>
<build>
@@ -210,7 +210,7 @@
</plugins>
</build>
</profile>
- rls -->
+
<!-- When the 'fast' profile is on, the testsuite runs in parallel mode; Arquillan messes up with containers in such a scenario, unless they're started upfront.
So we start all the containers specified in the arquillan.xml configuration -->
<profile>
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java 2014-12-20 20:28:51 UTC (rev 19167)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java 2014-12-21 16:33:45 UTC (rev 19168)
@@ -26,14 +26,21 @@
import java.util.LinkedList;
import java.util.List;
-import junit.framework.Test;
-
import org.jboss.shrinkwrap.api.asset.StringAsset;
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.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.junit.Test;
+import org.junit.runner.RunWith;
/**
* Test WS endpoint publish api to JBoss AS container
@@ -41,40 +48,39 @@
* @author alessio.soldano(a)jboss.com
* @since 13-Jul-2011
*/
+(a)RunWith(Arquillian.class)
public class EndpointPublishTestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("endpoint-publish.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,"endpoint-publish.war");
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.common\n"))
- .addAsResource("org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl3.xml", "WEB-INF/wsdl/EndpointImpl3.xml")
- .addAsResource("org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl4.xml", "WEB-INF/wsdl/EndpointImpl4.xml")
- .addClass(org.jboss.test.ws.publish.Endpoint.class)
- .addClass(org.jboss.test.ws.publish.EndpointImpl.class)
- .addClass(org.jboss.test.ws.publish.EndpointImpl2.class)
- .addClass(org.jboss.test.ws.publish.EndpointImpl3.class)
- .addClass(org.jboss.test.ws.publish.EndpointImpl4.class)
- .addClass(org.jboss.test.ws.publish.EndpointImpl5.class)
- .addAsResource("org/jboss/test/ws/publish/EndpointImpl5.xml")
- .addClass(org.jboss.test.ws.publish.EndpointPublishServlet.class)
- .addAsResource("org/jboss/test/ws/publish/TestService.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/publish/META-INF/permissions.xml"), "permissions.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/publish/WEB-INF/wsdl/EndpointImpl3.xml"), "wsdl/EndpointImpl3.xml");
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.common\n"))
+ .addAsResource("org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl3.xml", "WEB-INF/wsdl/EndpointImpl3.xml")
+ .addAsResource("org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl4.xml", "WEB-INF/wsdl/EndpointImpl4.xml")
+ .addClass(org.jboss.test.ws.publish.Endpoint.class)
+ .addClass(org.jboss.test.ws.publish.EndpointImpl.class)
+ .addClass(org.jboss.test.ws.publish.EndpointImpl2.class)
+ .addClass(org.jboss.test.ws.publish.EndpointImpl3.class)
+ .addClass(org.jboss.test.ws.publish.EndpointImpl4.class)
+ .addClass(org.jboss.test.ws.publish.EndpointImpl5.class)
+ .addAsResource("org/jboss/test/ws/publish/EndpointImpl5.xml")
+ .addClass(org.jboss.test.ws.publish.EndpointPublishServlet.class)
+ .addAsResource("org/jboss/test/ws/publish/TestService.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/publish/META-INF/permissions.xml"), "permissions.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/publish/WEB-INF/wsdl/EndpointImpl3.xml"), "wsdl/EndpointImpl3.xml");
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(EndpointPublishTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
+ @Test
+ @RunAsClient
public void testEndpointPublish() throws Exception
{
- URL url = new URL("http://" + getServerHost() + ":8080/endpoint-publish");
+ URL url = new URL(baseURL + "/endpoint-publish");
assertEquals("1", IOUtils.readAndCloseStream(url.openStream()));
}
}
11 years
JBossWS SVN: r19167 - stack/cxf/branches/arquillian/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-20 15:28:51 -0500 (Sat, 20 Dec 2014)
New Revision: 19167
Modified:
stack/cxf/branches/arquillian/modules/testsuite/pom.xml
Log:
re-enable cxf-tests
Modified: stack/cxf/branches/arquillian/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/pom.xml 2014-12-20 20:18:59 UTC (rev 19166)
+++ stack/cxf/branches/arquillian/modules/testsuite/pom.xml 2014-12-20 20:28:51 UTC (rev 19167)
@@ -38,7 +38,8 @@
<!-- Modules -->
<modules>
<module>cxf-tests</module>
-<!-- <module>shared-tests</module>-->
+<!-- <module>shared-tests</module> -->
+
</modules>
<!-- Dependencies -->
11 years
JBossWS SVN: r19166 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-20 15:18:59 -0500 (Sat, 20 Dec 2014)
New Revision: 19166
Removed:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ArchiveDeployment.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointImpl.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointWithHandlerImpl.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ExtManagedProcessor.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MyManagedProcessor.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MyManagedProcessorMBean.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/jaxws-handlers-server.xml
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/CustomRecordProcessorTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java
Log:
arquillian conversion recording tests
Deleted: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ArchiveDeployment.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ArchiveDeployment.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ArchiveDeployment.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -1,41 +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.management.recording;
-
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.wsf.test.JBossWSTestHelper;
-
-public final class ArchiveDeployment
-{
- public static final String NAME = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("management-recording-as7.jar") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.logging\n"))
- .addClass(org.jboss.test.ws.management.recording.Endpoint.class)
- .addClass(org.jboss.test.ws.management.recording.EndpointWithConfigImpl.class);
- }
- });
-
- private ArchiveDeployment() {
- //NOOP
- }
-}
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/CustomRecordProcessorTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/CustomRecordProcessorTestCase.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/CustomRecordProcessorTestCase.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -22,15 +22,27 @@
package org.jboss.test.ws.management.recording;
import java.net.URL;
+import java.io.File;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+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.ws.api.monitoring.RecordProcessor;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.runner.RunWith;
+import org.junit.Test;
/**
* This test case shows how to dynamically add a custom record processor
@@ -39,40 +51,37 @@
* @author alessio.soldano(a)jboss.com
* @since 6-Aug-2008
*/
+(a)RunWith(Arquillian.class)
public class CustomRecordProcessorTestCase extends JBossWSTest
{
- private final String endpointURL = "http://" + getServerHost() + ":8080/management-recording/EndpointImpl";
- private final String targetNS = "http://recording.management.ws.test.jboss.org/";
- private String endpointObjectName;
+ private final String endpointObjectName = "jboss.ws:context=management-recording,endpoint=EndpointWithConfigImpl";
- @Override
- protected void setUp() throws Exception
- {
- endpointObjectName = "jboss.ws:context=management-recording,endpoint=EndpointWithConfigImpl";
- JBossWSTestHelper.deploy(ArchiveDeployment.NAME);
- }
+ @ArquillianResource
+ private URL baseURL;
- @Override
- protected void tearDown() throws Exception
- {
- JBossWSTestHelper.undeploy(ArchiveDeployment.NAME);
+ @Deployment(testable = false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "management-recording-as7.jar");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+ .addClass(org.jboss.test.ws.management.recording.Endpoint.class)
+ .addClass(org.jboss.test.ws.management.recording.EndpointWithConfigImpl.class);
+ return archive;
}
+ @Test
+ @RunAsClient
public void testAddCustomProcessor() throws Exception
{
- URL wsdlURL = new URL(endpointURL + "?wsdl");
- QName serviceName = new QName(targetNS, "EndpointService");
+ URL wsdlURL = new URL(baseURL + "/management-recording/EndpointImpl?wsdl");
+ QName serviceName = new QName("http://recording.management.ws.test.jboss.org/", "EndpointService");
Service service = Service.create(wsdlURL, serviceName);
@SuppressWarnings("unused")
Endpoint port = service.getPort(Endpoint.class);
System.out.println("FIXME: [JBWS-3330] RMI class loader disabled / CNFE with remote classloader");//FIXME [JBWS-3330] RMI class loader disabled / CNFE with remote classloader
-// addCustomProcessor();
-// Object retObj = port.echo1("Hello");
-// assertEquals("Hello", retObj);
-// checkCustomProcessorJob();
}
-
+ /**********
@SuppressWarnings("unused")
private void addCustomProcessor() throws Exception
{
@@ -94,4 +103,5 @@
assertEquals(1, server.getAttribute(oname, "Size"));
assertEquals("Attribute value", server.getAttribute(oname, "Attribute"));
}
+ **********/
}
Deleted: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointImpl.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointImpl.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointImpl.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.management.recording;
-
-import javax.ejb.Stateless;
-import javax.jws.WebService;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.annotation.WebContext;
-
-/**
- * author alessio.soldano(a)jboss.org
- * @since 06-Aug-2008
- */
-@Stateless
-@WebService(serviceName="EndpointService", endpointInterface = "org.jboss.test.ws.management.recording.Endpoint")
-@WebContext(contextRoot="/management-recording", urlPattern="/EndpointImpl")
-public class EndpointImpl
-{
- // Provide logging
- private static Logger log = Logger.getLogger(EndpointImpl.class);
-
- public String echo1(String input)
- {
- log.info("echo1: " + input);
- return input;
- }
-
- public String echo2(String input)
- {
- log.info("echo2: " + input);
- return input;
- }
-}
Deleted: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointWithHandlerImpl.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointWithHandlerImpl.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/EndpointWithHandlerImpl.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.management.recording;
-
-import javax.ejb.Stateless;
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.annotation.WebContext;
-
-/**
- * @author alessio.soldano(a)jboss.org
- * @since 06-Aug-2008
- */
-@Stateless
-@WebService(serviceName="EndpointService", endpointInterface = "org.jboss.test.ws.management.recording.Endpoint")
-@HandlerChain(file="jaxws-handlers-server.xml")
-@WebContext(contextRoot="/management-recording", urlPattern="/EndpointImpl")
-public class EndpointWithHandlerImpl
-{
- // Provide logging
- private static Logger log = Logger.getLogger(EndpointWithHandlerImpl.class);
-
- public String echo1(String input)
- {
- log.info("echo1: " + input);
- return input;
- }
-
- public String echo2(String input)
- {
- log.info("echo2: " + input);
- return input;
- }
-}
Deleted: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ExtManagedProcessor.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ExtManagedProcessor.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/ExtManagedProcessor.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.management.recording;
-
-import java.io.Serializable;
-
-public class ExtManagedProcessor extends MyManagedProcessor implements Serializable {
-
- private static final long serialVersionUID = 908532514661675105L;
- private String extAttribute;
-
- public String getExtAttribute() {
- return extAttribute;
- }
-
- public void setExtAttribute(String extAttribute) {
- this.extAttribute = extAttribute;
- }
-}
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -21,10 +21,12 @@
*/
package org.jboss.test.ws.management.recording;
+import java.lang.System;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.io.File;
import javax.management.Attribute;
import javax.management.MBeanServerConnection;
@@ -40,32 +42,45 @@
import org.jboss.ws.common.monitoring.OperationFilter;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+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.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.junit.runner.RunWith;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.junit.Test;
+
/**
* This tests the MemoryBufferRecorder
*
* @author alessio.soldano(a)jboss.com
* @since 7-Aug-2008
*/
+(a)RunWith(Arquillian.class)
public class MemoryBufferRecorderTestCase extends JBossWSTest
{
- private final String endpointURL = "http://" + getServerHost() + ":8080/management-recording/EndpointImpl";
private final String targetNS = "http://recording.management.ws.test.jboss.org/";
- private String endpointObjectName;
-
- @Override
- protected void setUp() throws Exception
- {
- endpointObjectName = "jboss.ws:context=management-recording,endpoint=EndpointWithConfigImpl";
- JBossWSTestHelper.deploy(ArchiveDeployment.NAME);
+ private final String endpointObjectName = "jboss.ws:context=management-recording,endpoint=EndpointWithConfigImpl";
+
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "management-recording-as7.jar");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+ .addClass(org.jboss.test.ws.management.recording.Endpoint.class)
+ .addClass(org.jboss.test.ws.management.recording.EndpointWithConfigImpl.class);
+ return archive;
}
- @Override
- protected void tearDown() throws Exception
- {
- JBossWSTestHelper.undeploy(ArchiveDeployment.NAME);
- }
-
+ @Test
+ @RunAsClient
public void testRecording() throws Exception
{
Endpoint port = getPort();
@@ -82,6 +97,8 @@
assertEquals(3, endSize - startSize);
}
+ @Test
+ @RunAsClient
@SuppressWarnings("unchecked")
public void testGetRecordsByOperation() throws Exception
{
@@ -122,7 +139,8 @@
}
}
-
+ @Test
+ @RunAsClient
@SuppressWarnings("unchecked")
public void testGetRecordsByClientHost() throws Exception
{
@@ -145,7 +163,9 @@
assertTrue("No records for " + host, localhostRecords.size() > 0);
assertTrue("There are records for 72.21.203.1", amazonRecords.size() == 0);
}
-
+
+ @Test
+ @RunAsClient
@SuppressWarnings("unchecked")
public void testGetMatchingRecords() throws Exception
{
@@ -173,6 +193,8 @@
assertEquals(1, stopRecords.keySet().size() - startRecords.keySet().size());
}
+ @Test
+ @RunAsClient
public void testAddRemoveFilter() throws Exception
{
Endpoint port = getPort();
@@ -225,7 +247,7 @@
private Endpoint getPort() throws Exception
{
- URL wsdlURL = new URL(endpointURL + "?wsdl");
+ URL wsdlURL = new URL(baseURL + "/management-recording/EndpointImpl?wsdl");
QName serviceName = new QName(targetNS, "EndpointService");
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/management/recording/MyManagedProcessor.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MyManagedProcessor.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MyManagedProcessor.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.management.recording;
-
-import java.io.Serializable;
-
-import org.jboss.ws.common.monitoring.MemoryBufferRecorder;
-
-public class MyManagedProcessor extends MemoryBufferRecorder implements MyManagedProcessorMBean, Serializable {
-
- private static final long serialVersionUID = 8403680807812334470L;
- private String attribute;
-
- @Override
- public String getAttribute() {
- return attribute;
- }
-
- @Override
- public void setAttribute(String attribute) {
- this.attribute = attribute;
- }
-}
Deleted: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MyManagedProcessorMBean.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MyManagedProcessorMBean.java 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MyManagedProcessorMBean.java 2014-12-20 20:18:59 UTC (rev 19166)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.management.recording;
-
-import org.jboss.ws.common.monitoring.MemoryBufferRecorderMBean;
-
-public interface MyManagedProcessorMBean extends MemoryBufferRecorderMBean
-{
- public String getAttribute();
- public void setAttribute(String attribute);
-
-}
Deleted: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/jaxws-handlers-server.xml
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/jaxws-handlers-server.xml 2014-12-20 20:17:21 UTC (rev 19165)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/jaxws-handlers-server.xml 2014-12-20 20:18:59 UTC (rev 19166)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
-
- <handler-chain>
- <handler>
- <handler-name>Recording Handler</handler-name>
- <handler-class>org.jboss.ws.common.invocation.RecordingServerHandler</handler-class>
- </handler>
- </handler-chain>
-</handler-chains>
\ No newline at end of file
11 years
JBossWS SVN: r19165 - in stack/cxf/branches/arquillian/modules/testsuite/shared-tests: src/test and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-20 15:17:21 -0500 (Sat, 20 Dec 2014)
New Revision: 19165
Added:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/arquillian.xml
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default-config-tests.groovy
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default.groovy
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-ssl-mutual-auth.groovy
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml
Log:
configuration for arquillian conversion
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml 2014-12-19 16:03:19 UTC (rev 19164)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/pom.xml 2014-12-20 20:17:21 UTC (rev 19165)
@@ -51,6 +51,64 @@
</activation>
<build>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>testsuite-default</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>${basedir}/src/test/scripts/jbws-testsuite-default.groovy</source>
+ <properties>
+ <inputFile>${jboss.home}/standalone/configuration/standalone.xml</inputFile>
+ <outputFile>${jboss.home}/standalone/configuration/jbws-testsuite-default.xml</outputFile>
+ <serverLog>jbws-testsuite-default.log</serverLog>
+ <usersPropFile>${project.build.directory}/test-classes/jbossws-users.properties</usersPropFile>
+ <rolesPropFile>${project.build.directory}/test-classes/jbossws-roles.properties</rolesPropFile>
+ <keystorePath>${project.build.directory}/test-classes/test.keystore</keystorePath>
+ <testResourcesDir>${project.build.directory}/test-resources</testResourcesDir>
+ </properties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>testsuite-ssl-mutual-auth</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>${basedir}/src/test/scripts/jbws-testsuite-ssl-mutual-auth.groovy</source>
+ <properties>
+ <inputFile>${jboss.home}/standalone/configuration/standalone.xml</inputFile>
+ <outputFile>${jboss.home}/standalone/configuration/jbws-testsuite-ssl-mutual-auth.xml</outputFile>
+ <serverLog>jbws-testsuite-ssl-mutual-auth.log</serverLog>
+ <keystorePath>${project.build.directory}/test-classes/test.keystore</keystorePath>
+ <truststorePath>${project.build.directory}/test-classes/test.truststore</truststorePath>
+ </properties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>testsuite-default-config-tests</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>${basedir}/src/test/scripts/jbws-testsuite-default-config-tests.groovy</source>
+ <properties>
+ <inputFile>${jboss.home}/standalone/configuration/standalone.xml</inputFile>
+ <outputFile>${jboss.home}/standalone/configuration/jbws-testsuite-default-config-tests.xml</outputFile>
+ <serverLog>jbws-testsuite-default-config-tests.log</serverLog>
+ </properties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- rls
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
@@ -93,6 +151,7 @@
</execution>
</executions>
</plugin>
+ rls -->
<plugin> <!-- This copies jbossws-cxf-factories jar to endorsed dir before the integration-tests are run -->
<artifactId>maven-resources-plugin</artifactId>
<executions>
@@ -119,7 +178,7 @@
</plugins>
</build>
</profile>
-
+ <!-- rls
<profile>
<id>build-benchmarks</id>
<build>
@@ -151,6 +210,61 @@
</plugins>
</build>
</profile>
+ rls -->
+ <!-- When the 'fast' profile is on, the testsuite runs in parallel mode; Arquillan messes up with containers in such a scenario, unless they're started upfront.
+ So we start all the containers specified in the arquillan.xml configuration -->
+ <profile>
+ <id>fast</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.wildfly.plugins</groupId>
+ <artifactId>wildfly-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jboss</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <jvmArgs>-server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m ${additionalJvmArgs}</jvmArgs>
+ <serverConfig>jbws-testsuite-default.xml</serverConfig>
+ <jbossHome>${jboss.home}</jbossHome>
+ <port>9990</port>
+ </configuration>
+ </execution>
+ <execution>
+ <id>ssl-mutual-auth</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <jvmArgs>-server -XX:+UseCompressedOops -Xms48m -Xmx384m -XX:MaxPermSize=192m -Djboss.socket.binding.port-offset=10000 ${additionalJvmArgs}</jvmArgs>
+ <serverConfig>jbws-testsuite-ssl-mutual-auth.xml</serverConfig>
+ <jbossHome>${jboss.home}</jbossHome>
+ <port>19990</port>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-config-tests</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <jvmArgs>-server -XX:+UseCompressedOops -Xms48m -Xmx384m -XX:MaxPermSize=192m -Djboss.socket.binding.port-offset=20000 ${additionalJvmArgs}</jvmArgs>
+ <serverConfig>jbws-testsuite-default-config-tests.xml</serverConfig>
+ <jbossHome>${jboss.home}</jbossHome>
+ <port>29990</port>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
Added: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/arquillian.xml
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/arquillian.xml (rev 0)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/arquillian.xml 2014-12-20 20:17:21 UTC (rev 19165)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+ <group qualifier="shared-tests" default="true">
+ <container qualifier="jboss" default="true">
+ <configuration>
+ <property name="jbossHome">/home/rsearls/j1/jbossws/arquillian/modules/testsuite/shared-tests/target/test-server/jbossws-cxf-dist-5.0.0-SNAPSHOT/wildfly-8.1.0.Final</property>
+ <property name="javaVmArguments">-server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djavax.wsdl.factory.WSDLFactory=com.ibm.wsdl.factory.WSDLFactoryImpl</property>
+ <property name="serverConfig">jbws-testsuite-default.xml</property>
+ <property name="allowConnectingToRunningServer">true</property>
+ <property name="managementPort">${as.managementPort:9990}</property>
+ <!-- AS7-4070 -->
+ <property name="waitForPorts">${as.debug.port:8787} ${as.managementPort:9990}</property>
+ <property name="waitForPortsTimeoutInSeconds">8</property>
+ </configuration>
+ </container>
+ <container qualifier="ssl-mutual-auth" mode="manual">
+ <configuration>
+ <property name="jbossHome">/home/rsearls/j1/jbossws/arquillian/modules/testsuite/shared-tests/target/test-server/jbossws-cxf-dist-5.0.0-SNAPSHOT/wildfly-8.1.0.Final</property>
+ <property name="javaVmArguments">-server -XX:+UseCompressedOops -Xms48m -Xmx384m -XX:MaxPermSize=192m -Djboss.socket.binding.port-offset=10000 -Djavax.wsdl.factory.WSDLFactory=com.ibm.wsdl.factory.WSDLFactoryImpl</property>
+ <property name="serverConfig">jbws-testsuite-ssl-mutual-auth.xml</property>
+ <property name="allowConnectingToRunningServer">true</property>
+ <property name="managementPort">${as.managementPort:19990}</property>
+ <!-- AS7-4070 -->
+ <property name="waitForPorts">${as.debug.port:18787} ${as.managementPort:19990}</property>
+ <property name="waitForPortsTimeoutInSeconds">8</property>
+ </configuration>
+ </container>
+ <container qualifier="default-config-tests" mode="manual">
+ <configuration>
+ <property name="jbossHome">/home/rsearls/j1/jbossws/arquillian/modules/testsuite/shared-tests/target/test-server/jbossws-cxf-dist-5.0.0-SNAPSHOT/wildfly-8.1.0.Final</property>
+ <property name="javaVmArguments">-server -XX:+UseCompressedOops -Xms48m -Xmx384m -XX:MaxPermSize=192m -Djboss.socket.binding.port-offset=20000 -Djavax.wsdl.factory.WSDLFactory=com.ibm.wsdl.factory.WSDLFactoryImpl</property>
+ <property name="serverConfig">jbws-testsuite-default-config-tests.xml</property>
+ <property name="allowConnectingToRunningServer">true</property>
+ <property name="managementPort">${as.managementPort:29990}</property>
+ <!-- AS7-4070 -->
+ <property name="waitForPorts">${as.debug.port:28787} ${as.managementPort:29990}</property>
+ <property name="waitForPortsTimeoutInSeconds">8</property>
+ </configuration>
+ </container>
+ </group>
+</arquillian>
Added: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default-config-tests.groovy
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default-config-tests.groovy (rev 0)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default-config-tests.groovy 2014-12-20 20:17:21 UTC (rev 19165)
@@ -0,0 +1,44 @@
+def root = new XmlParser().parse(project.properties['inputFile'])
+
+/**
+ * Fix logging: remove CONSOLE handler and set a specific log file
+ *
+ */
+def logHandlers = root.profile.subsystem.'root-logger'.handlers[0]
+def consoleHandler = logHandlers.find{it.@name == 'CONSOLE'}
+logHandlers.remove(consoleHandler)
+def file = root.profile.subsystem.'periodic-rotating-file-handler'.file[0]
+file.attributes()['path'] = project.properties['serverLog']
+
+/**
+ * Add a security-domain block like this:
+ *
+ * <security-domain name="JBossWS" cache-type="default">
+ * <authentication>
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-users.properties"/>
+ * <module-option name="unauthenticatedIdentity" value="anonymous"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-roles.properties"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *
+ */
+
+def securityDomains = root.profile.subsystem.'security-domains'[0]
+def securityDomain = securityDomains.appendNode('security-domain', ['name':'JBossWS','cache-type':'default'])
+def authentication = securityDomain.appendNode('authentication')
+def loginModule = authentication.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModule.appendNode('module-option', ['name':'unauthenticatedIdentity','value':'anonymous'])
+loginModule.appendNode('module-option', ['name':'usersProperties','value':project.properties['usersPropFile']])
+loginModule.appendNode('module-option', ['name':'rolesProperties','value':project.properties['rolesPropFile']])
+
+/**
+ * Save the configuration to a new file
+ */
+
+def writer = new StringWriter()
+writer.println('<?xml version="1.0" encoding="UTF-8"?>')
+new XmlNodePrinter(new PrintWriter(writer)).print(root)
+def f = new File(project.properties['outputFile'])
+f.write(writer.toString())
Added: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default.groovy
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default.groovy (rev 0)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-default.groovy 2014-12-20 20:17:21 UTC (rev 19165)
@@ -0,0 +1,225 @@
+def root = new XmlParser().parse(project.properties['inputFile'])
+
+/**
+ * Fix logging: remove CONSOLE handler and set a specific log file
+ *
+ */
+def logHandlers = root.profile.subsystem.'root-logger'.handlers[0]
+def consoleHandler = logHandlers.find{it.@name == 'CONSOLE'}
+logHandlers.remove(consoleHandler)
+def file = root.profile.subsystem.'periodic-rotating-file-handler'.file[0]
+file.attributes()['path'] = project.properties['serverLog']
+
+/**
+ * Add a security-domain block like this:
+ *
+ * <security-domain name="JBossWS" cache-type="default">
+ * <authentication>
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-users.properties"/>
+ * <module-option name="unauthenticatedIdentity" value="anonymous"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-roles.properties"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *
+ */
+
+def securityDomains = root.profile.subsystem.'security-domains'[0]
+def securityDomain = securityDomains.appendNode('security-domain', ['name':'JBossWS','cache-type':'default'])
+def authentication = securityDomain.appendNode('authentication')
+def loginModule = authentication.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModule.appendNode('module-option', ['name':'unauthenticatedIdentity','value':'anonymous'])
+loginModule.appendNode('module-option', ['name':'usersProperties','value':project.properties['usersPropFile']])
+loginModule.appendNode('module-option', ['name':'rolesProperties','value':project.properties['rolesPropFile']])
+
+/**
+ * Add a security-domain block like this:
+ *
+ * <security-domain name="JBossWS-trust-sts" cache-type="default">
+ * <authentication>
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties"/>
+ * <module-option name="unauthenticatedIdentity" value="anonymous"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *
+ */
+
+def securityDomainSts = securityDomains.appendNode('security-domain', ['name':'JBossWS-trust-sts','cache-type':'default'])
+def authenticationSts = securityDomainSts.appendNode('authentication')
+def loginModuleSts = authenticationSts.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModuleSts.appendNode('module-option', ['name':'unauthenticatedIdentity','value':'anonymous'])
+loginModuleSts.appendNode('module-option', ['name':'usersProperties','value':project.properties['testResourcesDir'] + '/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties'])
+loginModuleSts.appendNode('module-option', ['name':'rolesProperties','value':project.properties['testResourcesDir'] + '/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties'])
+
+/**
+ * Add a security-domain block like this:
+ *
+ * <security-domain name="ws-basic-domain" cache-type="default">
+ * <authentication>
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/cxf/httpauth/WEB-INF/ws-users.properties"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/cxf/httpauth/WEB-INF/ws-roles.properties"/>
+ * <module-option name="password-stacking" value="useFirstPass"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *
+ */
+
+def securityDomainBasicAuth = securityDomains.appendNode('security-domain', ['name':'ws-basic-domain','cache-type':'default'])
+def authenticationBasicAuth = securityDomainBasicAuth.appendNode('authentication')
+def loginModuleBasicAuth = authenticationBasicAuth.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModuleBasicAuth.appendNode('module-option', ['name':'usersProperties','value':project.properties['testResourcesDir'] + '/jaxws/cxf/httpauth/WEB-INF/ws-users.properties'])
+loginModuleBasicAuth.appendNode('module-option', ['name':'rolesProperties','value':project.properties['testResourcesDir'] + '/jaxws/cxf/httpauth/WEB-INF/ws-roles.properties'])
+loginModuleBasicAuth.appendNode('module-option', ['name':'password-stacking','value':'useFirstPass'])
+
+/**
+ * Add a security-domain block like this:
+ *
+ * <security-domain name="ws-digest-domain" cache-type="default">
+ * <authentication>
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="hashUserPassword" value="false"/>
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/cxf/httpauth/WEB-INF/ws-users.properties"/>
+ * <module-option name="hashAlgorithm" value="MD5"/>
+ * <module-option name="hashEncoding" value="RFC2617"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/cxf/httpauth/WEB-INF/ws-roles.properties"/>
+ * <module-option name="storeDigestCallback" value="org.jboss.security.auth.callback.RFC2617Digest"/>
+ * <module-option name="hashStorePassword" value="true"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *
+ */
+
+def securityDomainDigestAuth = securityDomains.appendNode('security-domain', ['name':'ws-digest-domain','cache-type':'default'])
+def authenticationDigestAuth = securityDomainDigestAuth.appendNode('authentication')
+def loginModuleDigestAuth = authenticationDigestAuth.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModuleDigestAuth.appendNode('module-option', ['name':'hashUserPassword','value':'false'])
+loginModuleDigestAuth.appendNode('module-option', ['name':'usersProperties','value':project.properties['testResourcesDir'] + '/jaxws/cxf/httpauth/WEB-INF/ws-users.properties'])
+loginModuleDigestAuth.appendNode('module-option', ['name':'hashAlgorithm','value':'MD5'])
+loginModuleDigestAuth.appendNode('module-option', ['name':'hashEncoding','value':'RFC2617'])
+loginModuleDigestAuth.appendNode('module-option', ['name':'rolesProperties','value':project.properties['testResourcesDir'] + '/jaxws/cxf/httpauth/WEB-INF/ws-roles.properties'])
+loginModuleDigestAuth.appendNode('module-option', ['name':'storeDigestCallback','value':'org.jboss.security.auth.callback.RFC2617Digest'])
+loginModuleDigestAuth.appendNode('module-option', ['name':'hashStorePassword','value':'true'])
+
+/**
+ * Add a security-domain block like this:
+ *
+ * <security-domain name="JBossWSDigest" cache-type="default">
+ * <authentication>
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="hashUserPassword" value="false"/>
+ * <module-option name="hashCharset" value="UTF-8"/>
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jbossws-users.properties"/>
+ * <module-option name="hashAlgorithm" value="SHA"/>
+ * <module-option name="unauthenticatedIdentity" value="anonymous"/>
+ * <module-option name="hashEncoding" value="BASE64"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jbossws-roles.properties"/>
+ * <module-option name="storeDigestCallback" value="org.jboss.wsf.stack.cxf.security.authentication.callback.UsernameTokenCallback"/>
+ * <module-option name="hashStorePassword" value="true"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *
+ */
+
+def securityDomainDigest = securityDomains.appendNode('security-domain', ['name':'JBossWSDigest','cache-type':'default'])
+def authenticationDigest = securityDomainDigest.appendNode('authentication')
+def loginModuleDigest = authenticationDigest.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModuleDigest.appendNode('module-option', ['name':'hashUserPassword','value':'false'])
+loginModuleDigest.appendNode('module-option', ['name':'hashCharset','value':'UTF-8'])
+loginModuleDigest.appendNode('module-option', ['name':'hashAlgorithm','value':'SHA'])
+loginModuleDigest.appendNode('module-option', ['name':'hashEncoding','value':'BASE64'])
+loginModuleDigest.appendNode('module-option', ['name':'storeDigestCallback','value':'org.jboss.wsf.stack.cxf.security.authentication.callback.UsernameTokenCallback'])
+loginModuleDigest.appendNode('module-option', ['name':'hashStorePassword','value':'true'])
+loginModuleDigest.appendNode('module-option', ['name':'unauthenticatedIdentity','value':'anonymous'])
+loginModuleDigest.appendNode('module-option', ['name':'usersProperties','value':project.properties['testResourcesDir'] + '/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jbossws-users.properties'])
+loginModuleDigest.appendNode('module-option', ['name':'rolesProperties','value':project.properties['testResourcesDir'] + '/jaxws/samples/wsse/policy/jaas/digest/WEB-INF/jbossws-roles.properties'])
+
+/**
+ * Add two security-domain blocks for JASPI tests as below:
+ *
+ * <security-domain name="jaspi">
+ * <authentication-jaspi>
+ * <login-module-stack name="jaas-lm-stack">
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-users.properties"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-roles.properties"/>
+ * </login-module>
+ * </login-module-stack>
+ * <auth-module code="org.jboss.wsf.stack.cxf.jaspi.module.UsernameTokenServerAuthModule" login-module-stack-ref="jaas-lm-stack"/>
+ * </authentication-jaspi>
+ * </security-domain>
+ * <security-domain name="clientJaspi">
+ * <authentication-jaspi>
+ * <login-module-stack name="jaas-lm-stack">
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="usersProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-users.properties"/>
+ * <module-option name="rolesProperties" value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/jbossws-roles.properties"/>
+ * </login-module>
+ * </login-module-stack>
+ * <auth-module code="org.jboss.wsf.stack.cxf.jaspi.client.module.SOAPClientAuthModule" login-module-stack-ref="jaas-lm-stack"/>
+ * </authentication-jaspi>
+ */
+
+def securityDomainJaspi = securityDomains.appendNode('security-domain', ['name':'jaspi'])
+def authenticationJaspi = securityDomainJaspi.appendNode('authentication-jaspi')
+def loginModuleStack = authenticationJaspi.appendNode('login-module-stack', ['name':'jaas-lm-stack'])
+def loginModuleJaspi = loginModuleStack.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModuleJaspi.appendNode('module-option', ['name':'usersProperties','value':project.properties['usersPropFile']])
+loginModuleJaspi.appendNode('module-option', ['name':'rolesProperties','value':project.properties['rolesPropFile']])
+authenticationJaspi.appendNode('auth-module', ['code':'org.jboss.wsf.stack.cxf.jaspi.module.UsernameTokenServerAuthModule','login-module-stack-ref':'jaas-lm-stack'])
+
+def securityDomainJaspiClient = securityDomains.appendNode('security-domain', ['name':'clientJaspi'])
+def authenticationJaspiClient = securityDomainJaspiClient.appendNode('authentication-jaspi')
+def loginModuleStackClient = authenticationJaspiClient.appendNode('login-module-stack', ['name':'jaas-lm-stack'])
+def loginModuleJaspiClient = loginModuleStackClient.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
+loginModuleJaspiClient.appendNode('module-option', ['name':'usersProperties','value':project.properties['usersPropFile']])
+loginModuleJaspiClient.appendNode('module-option', ['name':'rolesProperties','value':project.properties['rolesPropFile']])
+authenticationJaspiClient.appendNode('auth-module', ['code':'org.jboss.wsf.stack.cxf.jaspi.client.module.SOAPClientAuthModule','login-module-stack-ref':'jaas-lm-stack'])
+
+/**
+ * Add a https connector like this:
+ *
+ * <security-realm name="jbws-test-https-realm">
+ * <server-identities>
+ * <ssl>
+ * <keystore path="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/test.keystore" keystore-password="changeit" alias="tomcat"/>
+ * </ssl>
+ * </server-identities>
+ * </security-realm>
+ *
+ */
+
+def securityRealms = root.management.'security-realms'[0]
+def securityRealm = securityRealms.appendNode('security-realm', ['name':'jbws-test-https-realm'])
+def serverIdentities = securityRealm.appendNode('server-identities')
+def ssl = serverIdentities.appendNode('ssl')
+ssl.appendNode('keystore', ['path':project.properties['keystorePath'],'keystore-password':'changeit','alias':'tomcat'])
+
+def server = root.profile.subsystem.server[0]
+server.appendNode('https-listener', ['name':'jbws-test-https-listener','socket-binding':'https','security-realm':'jbws-test-https-realm'])
+
+
+/**
+ *
+ * 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
+ */
+
+def writer = new StringWriter()
+writer.println('<?xml version="1.0" encoding="UTF-8"?>')
+new XmlNodePrinter(new PrintWriter(writer)).print(root)
+def f = new File(project.properties['outputFile'])
+f.write(writer.toString())
Added: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-ssl-mutual-auth.groovy
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-ssl-mutual-auth.groovy (rev 0)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/scripts/jbws-testsuite-ssl-mutual-auth.groovy 2014-12-20 20:17:21 UTC (rev 19165)
@@ -0,0 +1,52 @@
+def root = new XmlParser().parse(project.properties['inputFile'])
+
+/**
+ * Fix logging: remove CONSOLE handler and set a specific log file
+ *
+ */
+def logHandlers = root.profile.subsystem.'root-logger'.handlers[0]
+def consoleHandler = logHandlers.find{it.@name == 'CONSOLE'}
+logHandlers.remove(consoleHandler)
+def file = root.profile.subsystem.'periodic-rotating-file-handler'.file[0]
+file.attributes()['path'] = project.properties['serverLog']
+
+/**
+ * Add a https connector like this:
+ *
+ * <security-realm name="jbws-test-https-realm">
+ * <server-identities>
+ * <ssl>
+ * <keystore path="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/test.keystore" keystore-password="changeit" alias="tomcat"/>
+ * </ssl>
+ * </server-identities>
+ * <authentication>
+ * <truststore path="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-classes/test.truststore" keystore-password="changeit"/>
+ * </authentication>
+ * </security-realm>
+ *
+ * ...
+ *
+ * <https-listener name="jbws-test-https-listener" socket-binding="https" security-realm="jbws-test-https-realm" verify-client="REQUESTED"/>
+ */
+
+def securityRealms = root.management.'security-realms'[0]
+def securityRealm = securityRealms.appendNode('security-realm', ['name':'jbws-test-https-realm'])
+def serverIdentities = securityRealm.appendNode('server-identities')
+def ssl = serverIdentities.appendNode('ssl')
+ssl.appendNode('keystore', ['path':project.properties['keystorePath'],'keystore-password':'changeit','alias':'tomcat'])
+def authentication = securityRealm.appendNode('authentication')
+authentication.appendNode('truststore', ['path':project.properties['truststorePath'],'keystore-password':'changeit'])
+
+def server = root.profile.subsystem.server[0]
+server.appendNode('https-listener', ['name':'jbws-test-https-listener','socket-binding':'https','security-realm':'jbws-test-https-realm','verify-client':'REQUESTED'])
+
+
+/**
+ * Save the configuration to a new file
+ */
+
+def writer = new StringWriter()
+writer.println('<?xml version="1.0" encoding="UTF-8"?>')
+new XmlNodePrinter(new PrintWriter(writer)).print(root)
+def f = new File(project.properties['outputFile'])
+f.write(writer.toString())
11 years
JBossWS SVN: r19164 - stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-19 11:03:19 -0500 (Fri, 19 Dec 2014)
New Revision: 19164
Added:
stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/DummyDataContentHandler.java
Modified:
stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
Log:
[bz-1104273] add dummy tagging DataContentHandler
Modified: stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java
===================================================================
--- stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java 2014-12-19 15:20:44 UTC (rev 19163)
+++ stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/ContentHandlerRegistry.java 2014-12-19 16:03:19 UTC (rev 19164)
@@ -57,10 +57,9 @@
addRegistryEntry(text_plain.class);
addRegistryEntry(text_html.class);
addRegistryEntry(multipart_mixed.class);
+ addRegistryEntry(DummyDataContentHandler.class);
}
-
- private static boolean isRegistered = false; // bz-1104273 workaround
-
+
private static void addRegistryEntry(Class contentHandler)
{
handlerRegistry.add(contentHandler);
@@ -101,11 +100,16 @@
Iterator i = handlerRegistry.iterator();
while (i.hasNext())
registerContentHandler((Class) i.next());
- isRegistered = true;
}
- public static boolean isRegistered()
- {
- return isRegistered;
+ /**
+ * Determine if the dummy mime type is present, indicating this thread,
+ * classloader has been setup as needed. (bz-1104273 workaround)
+ *
+ * @return
+ */
+ public static boolean isRegistered() {
+ MailcapCommandMap mailcap = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
+ return (mailcap.getAllCommands(DummyDataContentHandler.DUMMY_DATA_FLAVOR).length > 0);
}
}
Added: stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/DummyDataContentHandler.java
===================================================================
--- stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/DummyDataContentHandler.java (rev 0)
+++ stack/native/branches/jbossws-native-4.2.x/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/DummyDataContentHandler.java 2014-12-19 16:03:19 UTC (rev 19164)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ws.core.soap.attachment;
+
+import org.jboss.ws.core.soap.BundleUtils;
+
+import javax.activation.ActivationDataFlavor;
+import javax.activation.DataContentHandler;
+import javax.activation.DataSource;
+import javax.xml.transform.stream.StreamSource;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ResourceBundle;
+
+/**
+ * Dummy DataContentHandler only for tagging MailcapCommandMap objects containing
+ * JBoss specific data handlers. Solution to bz-1104273 issue with JDK1.7.0_55
+ *
+ * Date: 12/15/14
+ */
+public class DummyDataContentHandler implements DataContentHandler
+{
+ public static final String DUMMY_DATA_FLAVOR = "dummyDataFlavor/xml";
+ private static final ResourceBundle bundle = BundleUtils.getBundle(XmlDataContentHandler.class);
+ private DataFlavor[] flavors = new ActivationDataFlavor[]
+ {
+ new ActivationDataFlavor(StreamSource.class, DUMMY_DATA_FLAVOR, "XML")
+ };
+
+ /**
+ * Returns a {@link StreamSource} from the specified
+ * data source.
+ *
+ * @param ds the activation datasource
+ * @return an XML stream source
+ */
+ @Override
+ public Object getContent(DataSource ds) throws IOException
+ {
+ return null;
+ }
+
+ /**
+ * Returns a {@link StreamSource} from the specified
+ * data source. The flavor must be one of the ones returned by {@link #getTransferDataFlavors()}.
+ *
+ * @param df the flavor specifiying the mime type of ds
+ * @param ds the activation data source
+ * @return an XML stream source
+ */
+ @Override
+ public Object getTransferData(DataFlavor df, DataSource ds) throws UnsupportedFlavorException, IOException
+ {
+ return null;
+ }
+
+ /**
+ * Returns the acceptable data flavors that this content handler supports.
+ *
+ * @return array of <code>ActivationDataHandlers</code>
+ */
+ @Override
+ public DataFlavor[] getTransferDataFlavors()
+ {
+ return flavors;
+ }
+
+ /**
+ * Writes the passed in {@link StreamSource} object using the specified
+ * mime type to the specified output stream. The mime type must be text/xml.
+ *
+ * @param obj an XML stream source
+ * @param mimeType the string "text/xml"
+ * @param os the output stream to write this xml stream to
+ */
+ @Override
+ public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException
+ {
+ // take no action
+ }
+}
11 years