Author: rsearls
Date: 2015-01-02 12:12:00 -0500 (Fri, 02 Jan 2015)
New Revision: 19308
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
Log:
arquillian migration jbws2150 test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2015-01-02
14:24:30 UTC (rev 19307)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2015-01-02
17:12:00 UTC (rev 19308)
@@ -42,7 +42,18 @@
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceFeature;
-import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSTestHelper;
+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.arquillian.container.test.api.OperateOnDeployment;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.wsf.spi.management.ServerConfig;
@@ -67,15 +78,26 @@
* @author richard.opalka(a)jboss.com
* @author alessio.soldano(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2150TestCaseForked extends JBossWSTest
{
private static final ObjectName SERVER_CONFIG_OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServerConfig");
private static final String NAMESPACE =
"http://test.jboss.org/addressrewrite";
private static final String NAMESPACE_IMP =
"http://test.jboss.org/addressrewrite/wsdlimp";
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2150.war") { {
+ protected static Boolean modifySOAPAddress;
+ protected static String webServiceHost;
+ protected static int webServicePort;
+ protected static int webServiceSecurePort;
+ protected static String webServicePath;
+ protected static String webServiceUriScheme;
+
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(testable = false, name="dep-jaxws-jbws2150", managed = false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws2150.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2150.InvalidSecureService.class)
@@ -86,16 +108,22 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2150/WEB-INF/wsdl/Service.wsdl"), "wsdl/Service.wsdl")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2150/WEB-INF/wsdl/inner.wsdl"), "wsdl/inner.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2150/WEB-INF/web.xml"));
- }
- });
- list.add(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2150-codefirst.war") { {
+ return archive;
+ }
+
+ @Deployment(testable = false, name="dep-jaxws-jbws2150-codefirst", managed =
false)
+ public static WebArchive createDeployment2() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws2150-codefirst.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2150.CodeFirstService.class)
.addClass(org.jboss.test.ws.jaxws.jbws2150.ServiceIface.class);
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2150-sec.war") {
{
+ return archive;
+ }
+
+ @Deployment(testable = false, name="dep-jaxws-jbws2150-sec", managed =
false)
+ public static WebArchive createDeployment3() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws2150-sec.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2150.InvalidSecureService.class)
@@ -106,63 +134,37 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2150/WEB-INF/wsdl/Service.wsdl"), "wsdl/Service.wsdl")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2150/WEB-INF/wsdl/inner.wsdl"), "wsdl/inner.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2150/WEB-INF/web-sec.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- static {
- JBossWSTestHelper.writeToFile(createDeployments());
- }
- protected static class JBWS2150TestSetup extends JBossWSTestSetup {
-
- protected static Boolean modifySOAPAddress;
- protected static String webServiceHost;
- protected static int webServicePort;
- protected static int webServiceSecurePort;
- protected static String webServicePath;
- protected static String webServiceUriScheme;
-
- public JBWS2150TestSetup() {
- super(JBWS2150TestCaseForked.class, null);
- }
-
- public void setUp() throws Exception
- {
- modifySOAPAddress = (Boolean)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"ModifySOAPAddress");
- webServiceHost = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServiceHost");
- webServicePort = (Integer)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServicePort");
- webServiceSecurePort =
(Integer)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServiceSecurePort");
- webServicePath = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServicePathRewriteRule");
- webServiceUriScheme =
(String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServiceUriScheme");
- super.setUp();
- }
+ public void setUp() throws Exception {
+ modifySOAPAddress = (Boolean) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"ModifySOAPAddress");
+ webServiceHost = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServiceHost");
+ webServicePort = (Integer) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServicePort");
+ webServiceSecurePort = (Integer)
getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceSecurePort");
+ webServicePath = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServicePathRewriteRule");
+ webServiceUriScheme = (String) getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME,
"WebServiceUriScheme");
+ super.setUp();
}
- public static Test suite()
- {
- return new JBWS2150TestSetup();
- }
-
public void tearDown() throws Exception
{
- Attribute attr = new Attribute("ModifySOAPAddress",
JBWS2150TestSetup.modifySOAPAddress);
+ Attribute attr = new Attribute("ModifySOAPAddress", modifySOAPAddress);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServiceHost",
JBWS2150TestSetup.webServiceHost);
+ attr = new Attribute("WebServiceHost", webServiceHost);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServicePort",
JBWS2150TestSetup.webServicePort);
+ attr = new Attribute("WebServicePort", webServicePort);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServiceSecurePort",
JBWS2150TestSetup.webServiceSecurePort);
+ attr = new Attribute("WebServiceSecurePort", webServiceSecurePort);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServicePathRewriteRule",
JBWS2150TestSetup.webServicePath);
+ attr = new Attribute("WebServicePathRewriteRule", webServicePath);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- attr = new Attribute("WebServiceUriScheme",
JBWS2150TestSetup.webServiceUriScheme);
+ attr = new Attribute("WebServiceUriScheme", webServiceUriScheme);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
}
private String getWebServiceHost() {
- return JBWS2150TestSetup.webServiceHost;
+ return webServiceHost;
}
/**
@@ -170,10 +172,13 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -230,7 +235,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -239,12 +245,16 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancer() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150.war");
+ //deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -292,7 +302,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -301,11 +312,14 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -352,7 +366,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -361,10 +376,13 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testSecureRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
- deploy("jaxws-jbws2150-sec.war");
+ deployer.deploy("dep-jaxws-jbws2150-sec");
try
{
final Map<String, String> wsdlLocationsSecMap = new HashMap<String,
String>();
@@ -412,21 +430,25 @@
}
finally
{
- undeploy("jaxws-jbws2150-sec.war");
+ deployer.undeploy("dep-jaxws-jbws2150-sec");
+ tearDown();
}
}
-
+
/**
* [JBWS-454] Test soap:address URL rewrite according to transport guarantee
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testSecureRewriteLoadBalancer() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150-sec.war");
+ deployer.deploy("dep-jaxws-jbws2150-sec");
try
{
final Map<String, String> wsdlLocationsSecMap = new HashMap<String,
String>();
@@ -474,7 +496,8 @@
}
finally
{
- undeploy("jaxws-jbws2150-sec.war");
+ deployer.undeploy("dep-jaxws-jbws2150-sec");
+ tearDown();
}
}
@@ -483,10 +506,13 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testNoRewrite() throws Exception
{
+ setUp();
setModifySOAPAddress(false);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -534,19 +560,23 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine is on (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), getWebServiceHost(),
false);
@@ -556,19 +586,23 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite when the rewrite engine is off (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testNoRewriteCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(false);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), getWebServiceHost(),
false);
@@ -578,21 +612,25 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on and the webServiceHost set to a
(fake) load balancer host (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancerCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), testWebServiceHost, true);
@@ -602,23 +640,27 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on , the webServiceHost set to a
(fake) load balancer host (code-first endpoint) and forced https scheme
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancerCodeFirstForceHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
setWebServiceSecurePort(443);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
Definition definition = getWSDLDefinition("http://" + getServerHost()
+ ":8080/jaxws-jbws2150-codefirst/CodeFirstService?wsdl");
@@ -627,22 +669,26 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Basically the same as testRewriteLoadBalancerCodeFirst; even if rewrite is off, we
still get the loadbalancer address in the wsdl
* for code-first endpoint, as there's no user provided wsdl with a different
address in it.
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testNoRewriteLoadBalancerCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(false);
final String testWebServiceHost = "myloadbalancer2.com";
setWebServiceHost(testWebServiceHost);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), testWebServiceHost, true);
@@ -652,20 +698,24 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on and the webServiceHost set to
jbossws.undefined.host (code-first endpoint)
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteCodeFirst() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
checkWsdlAndInvokeCodeFirstEndpoint(getServerHost(), getServerHost(), true);
@@ -675,22 +725,26 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite when a path rewrite rule is specified.
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteWithPathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
setWebServicePathRewriteRule(sedCmd);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final String serverHost = getServerHost();
@@ -727,7 +781,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -736,13 +791,16 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteCodeFirstPathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd =
"s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
setWebServicePathRewriteRule(sedCmd);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
final String serverHost = getServerHost();
@@ -754,7 +812,8 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
@@ -764,14 +823,17 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteCodeFirstPathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd =
"s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
String serverHost = getServerHost();
@@ -788,7 +850,8 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
}
@@ -797,14 +860,17 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewritePathRule() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -853,21 +919,25 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on and forced https scheme and secure
port
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteForceHttpsSchemeAndPorts() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceUriScheme("https");
setWebServiceSecurePort(8192);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -916,22 +986,26 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite with rewrite engine on, the webServiceHost set to a
(fake) load balancer host and forced https uri scheme
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteLoadBalancerForceHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -979,7 +1053,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -988,11 +1063,14 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteForceHttp() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
@@ -1039,7 +1117,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -1048,12 +1127,15 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testSecureRewriteOverriddenByForcedHttp() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
setWebServiceUriScheme("http");
setWebServicePort(80);
- deploy("jaxws-jbws2150-sec.war");
+ deployer.deploy("dep-jaxws-jbws2150-sec");
try
{
final Map<String, String> wsdlLocationsSecMap = new HashMap<String,
String>();
@@ -1101,23 +1183,27 @@
}
finally
{
- undeploy("jaxws-jbws2150-sec.war");
+ deployer.undeploy("dep-jaxws-jbws2150-sec");
+ tearDown();
}
}
-
+
/**
* Test soap:address rewrite when a path rewrite rule is specified and https scheme is
forced.
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testRewriteWithPathRuleAndForcedHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150.war");
+ deployer.deploy("dep-jaxws-jbws2150");
try
{
final String serverHost = getServerHost();
@@ -1154,7 +1240,8 @@
}
finally
{
- undeploy("jaxws-jbws2150.war");
+ deployer.undeploy("dep-jaxws-jbws2150");
+ tearDown();
}
}
@@ -1164,15 +1251,18 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
public void testAutoRewriteCodeFirstPathRuleAndForcedHttps() throws Exception
{
+ setUp();
setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd =
"s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
setWebServiceUriScheme("https");
- deploy("jaxws-jbws2150-codefirst.war");
+ deployer.deploy("dep-jaxws-jbws2150-codefirst");
try
{
String serverHost = getServerHost();
@@ -1189,10 +1279,12 @@
}
finally
{
- undeploy("jaxws-jbws2150-codefirst.war");
+ deployer.undeploy("dep-jaxws-jbws2150-codefirst");
+ tearDown();
}
+
}
-
+
private void checkWsdlAndInvokeCodeFirstEndpoint(String testHost, String
expectedWsdlHost, boolean setTargetAddress) throws Exception {
final String addr = "http://" + testHost +
":8080/jaxws-jbws2150-codefirst/CodeFirstService";
final String wsdlLocation = addr + "?wsdl";