Author: asoldano
Date: 2015-01-19 12:49:53 -0500 (Mon, 19 Jan 2015)
New Revision: 19388
Removed:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/log4j.xml
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
Log:
Actually use the separate server instance that has been created for this scenario...
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/log4j.xml
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/log4j.xml 2015-01-19
16:41:21 UTC (rev 19387)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/etc/log4j.xml 2015-01-19
17:49:53 UTC (rev 19388)
@@ -52,6 +52,9 @@
<priority value="DEBUG"/>
</category>
+ <category name="org.jboss.as.controller">
+ <priority value="TRACE"/>
+ </category>
<category name="org.jboss.test.ws">
<priority value="TRACE"/>
</category>
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2015-01-19
16:41:21 UTC (rev 19387)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2015-01-19
17:49:53 UTC (rev 19388)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2015, 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.
*
@@ -24,9 +24,12 @@
import java.io.File;
import java.net.URL;
+import org.jboss.arquillian.container.test.api.ContainerController;
+import org.jboss.arquillian.container.test.api.Deployer;
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.container.test.api.TargetsContainer;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -36,6 +39,7 @@
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.WrapThreadContextClassLoader;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,12 +52,22 @@
@RunWith(Arquillian.class)
public class ClientConfigurationTestCase extends JBossWSTest
{
+ private static final String DEFAULT_CONFIG_TESTS_SERVER =
"default-config-tests";
+ private static final String SERVER_DEPLOYMENT = "jaxws-clientConfig";
+ private static final String IN_CONTAINER_CLIENT_DEPLOYMENT =
"jaxws-clientConfig-inContainer-client";
+
+ private final String baseURL = "http://" + getServerHost() + ":" +
getServerPort(SHARED_TESTS_GROUP_QUALIFIER, DEFAULT_CONFIG_TESTS_SERVER);
+
@ArquillianResource
- private URL baseURL;
+ private Deployer deployer;
- @Deployment(name = "jaxws-clientConfig-inContainer-client", order = 1,
testable = false)
+ @ArquillianResource
+ private ContainerController containerController;
+
+ @Deployment(name = IN_CONTAINER_CLIENT_DEPLOYMENT, order = 1, testable = false,
managed = false)
+ @TargetsContainer(DEFAULT_CONFIG_TESTS_SERVER)
public static WebArchive createDeployment() {
- WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-clientConfig-inContainer-client.war");
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
IN_CONTAINER_CLIENT_DEPLOYMENT + ".war");
archive
.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.jboss.ws.common\n"))
@@ -73,15 +87,25 @@
return archive;
}
- @Deployment(name = "jaxws-clientConfig", order = 2, testable = false)
+ @Deployment(name = SERVER_DEPLOYMENT, order = 2, testable = false, managed = false)
+ @TargetsContainer(DEFAULT_CONFIG_TESTS_SERVER)
public static WebArchive createDeployment2() {
- WebArchive archive =
ShrinkWrap.create(WebArchive.class,"jaxws-clientConfig.war");
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, SERVER_DEPLOYMENT +
".war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.EndpointImpl.class);
return archive;
}
+
+ @Before
+ public void startContainerAndDeploy() throws Exception {
+ if (!containerController.isStarted(DEFAULT_CONFIG_TESTS_SERVER)) {
+ containerController.start(DEFAULT_CONFIG_TESTS_SERVER);
+ deployer.deploy(SERVER_DEPLOYMENT);
+ deployer.deploy(IN_CONTAINER_CLIENT_DEPLOYMENT);
+ }
+ }
@Test
@RunAsClient
@@ -201,7 +225,89 @@
public void testConfigurationChangeOnDispatchInContainer() throws Exception {
assertEquals("1",
runTestInContainer("testConfigurationChangeOnDispatch"));
}
+
+ // -------------- default conf tests -------------------
+
+ /**
+ * Verifies the default client configuration from AS model is used
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testDefaultClientConfigurationInContainer() throws Exception {
+ assertEquals("1",
runTestInContainer("testDefaultClientConfiguration"));
+ }
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ assertEquals("1",
runTestInContainer("testDefaultClientConfigurationOnDispatch"));
+ }
+
+ /**
+ * Verifies the SEI class FQN default client configuration from AS model is used
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testSEIClassDefaultClientConfigurationInContainer() throws Exception {
+ assertEquals("1",
runTestInContainer("testSEIClassDefaultClientConfiguration"));
+ }
+ //no corresponding test on Dispatch, as that has no SEI
+
+ /**
+ * Verifies the SEI class FQN client configuration from default conf file
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testSEIClassDefaultFileClientConfigurationInContainer() throws Exception
{
+ assertEquals("1",
runTestInContainer("testSEIClassDefaultFileClientConfiguration"));
+ }
+ //no corresponding test on Dispatch, as that has no SEI
+
+ /**
+ * Verifies a client configuration from AS model can be set
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testCustomClientConfigurationInContainer() throws Exception {
+ assertEquals("1",
runTestInContainer("testCustomClientConfiguration"));
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testCustomClientConfigurationOnDispatchInContainer() throws Exception {
+ assertEquals("1",
runTestInContainer("testCustomClientConfigurationOnDispatch"));
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
+ assertEquals("1",
runTestInContainer("testCustomClientConfigurationUsingFeature"));
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
+ public void testCustomClientConfigurationOnDispatchUsingFeatureInContainer() throws
Exception {
+ assertEquals("1",
runTestInContainer("testCustomClientConfigurationOnDispatchUsingFeature"));
+ }
+
+ // -----------------------------------
+
@Override
protected String getClientJarPaths() {
return JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-clientConfig-client.jar") { {
@@ -215,14 +321,14 @@
private Helper getHelper() {
Helper helper = new Helper();
- helper.setTargetEndpoint(baseURL + "/EndpointImpl");
+ helper.setTargetEndpoint(baseURL + "/jaxws-clientConfig/EndpointImpl");
return helper;
}
private String runTestInContainer(String test) throws Exception
{
URL url = new URL(baseURL
- + "?path=/jaxws-clientConfig/EndpointImpl&method=" + test
+ +
"/jaxws-clientConfig-inContainer-client?path=/jaxws-clientConfig/EndpointImpl&method="
+ test
+ "&helper=" + Helper.class.getName());
return IOUtils.readAndCloseStream(url.openStream());
}
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2015-01-19
16:41:21 UTC (rev 19387)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2015-01-19
17:49:53 UTC (rev 19388)
@@ -1,172 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2013, 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.clientConfig;
-
-import java.io.File;
-import java.net.URL;
-
-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.WebArchive;
-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;
-
-/**
- * Verifies client configuration setup (in-container tests, relying on AS model)
- *
- * @author alessio.soldano(a)jboss.com
- * @since 31-May-2012
- */
-(a)RunWith(Arquillian.class)
-public class ClientConfigurationTestCaseForked extends JBossWSTest
-{
- @ArquillianResource
- private URL baseURL;
-
- @Deployment(name="jaxws-clientConfig-inContainer-client", testable = false)
- public static WebArchive createDeployment() {
- WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-clientConfig-inContainer-client.war");
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.common\n"))
- .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/clientConfig/META-INF/jaxws-client-config.xml"),
"META-INF/jaxws-client-config.xml")
- .addClass(org.jboss.test.helper.ClientHelper.class)
- .addClass(org.jboss.test.helper.TestServlet.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.CustomHandler.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint2.class)
-
.addAsResource("org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml",
"jaxws-client-config.xml")
- .addClass(org.jboss.test.ws.jaxws.clientConfig.Helper.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.LogHandler.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.RoutingHandler.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.TestUtils.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.UserHandler.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/clientConfig/META-INF/permissions.xml"), "permissions.xml");
- return archive;
- }
-
- @Deployment(name = "jaxws-clientConfig", testable = false)
- public static WebArchive createDeployment1() {
- WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-clientConfig.war");
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.clientConfig.EndpointImpl.class);
- return archive;
- }
-
- /**
- * Verifies the default client configuration from AS model is used
- *
- * @throws Exception
- */
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testDefaultClientConfigurationInContainer() throws Exception {
- assertEquals("1",
runTestInContainer("testDefaultClientConfiguration"));
- }
-
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
- assertEquals("1",
runTestInContainer("testDefaultClientConfigurationOnDispatch"));
- }
-
- /**
- * Verifies the SEI class FQN default client configuration from AS model is used
- *
- * @throws Exception
- */
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testSEIClassDefaultClientConfigurationInContainer() throws Exception {
- assertEquals("1",
runTestInContainer("testSEIClassDefaultClientConfiguration"));
- }
- //no corresponding test on Dispatch, as that has no SEI
-
- /**
- * Verifies the SEI class FQN client configuration from default conf file
- *
- * @throws Exception
- */
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testSEIClassDefaultFileClientConfigurationInContainer() throws Exception
{
- assertEquals("1",
runTestInContainer("testSEIClassDefaultFileClientConfiguration"));
- }
- //no corresponding test on Dispatch, as that has no SEI
-
- /**
- * Verifies a client configuration from AS model can be set
- *
- * @throws Exception
- */
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testCustomClientConfigurationInContainer() throws Exception {
- assertEquals("1",
runTestInContainer("testCustomClientConfiguration"));
- }
-
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testCustomClientConfigurationOnDispatchInContainer() throws Exception {
- assertEquals("1",
runTestInContainer("testCustomClientConfigurationOnDispatch"));
- }
-
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
- assertEquals("1",
runTestInContainer("testCustomClientConfigurationUsingFeature"));
- }
-
- @Test
- @RunAsClient
- @OperateOnDeployment("jaxws-clientConfig-inContainer-client")
- public void testCustomClientConfigurationOnDispatchUsingFeatureInContainer() throws
Exception {
- assertEquals("1",
runTestInContainer("testCustomClientConfigurationOnDispatchUsingFeature"));
- }
-
- // -------------------------
-
- private String runTestInContainer(String test) throws Exception
- {
- URL url = new URL(baseURL
- + "?path=/jaxws-clientConfig/EndpointImpl&method=" + test
- + "&helper=" + Helper.class.getName());
- return IOUtils.readAndCloseStream(url.openStream());
- }
-}