Author: jim.ma
Date: 2015-01-09 03:10:17 -0500 (Fri, 09 Jan 2015)
New Revision: 19352
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java
Log:
Fix JBWS1178TestCaseForked
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java 2015-01-09
07:28:51 UTC (rev 19351)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCaseForked.java 2015-01-09
08:10:17 UTC (rev 19352)
@@ -33,6 +33,7 @@
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
@@ -42,6 +43,8 @@
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -54,13 +57,19 @@
*/
@RunWith(Arquillian.class)
public class JBWS1178TestCaseForked extends JBossWSTest
-{
+{
@ArquillianResource
- private URL baseURL;
+ private Deployer deployer;
+
+ private static final String WAR_DEPLOYMENT = "jaxws-jbws1178.war";
+ private final ObjectName objectName =
ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+ private String webServiceHost;
+ //TODO:Look at how to fix this issue
+ private String baseURL = "http://localhost:8080/jaxws-jbws1178";
- @Deployment(testable = false)
+ @Deployment(name = WAR_DEPLOYMENT, testable = false, managed=false)
public static WebArchive createDeployments() {
- WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws1178.war");
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, WAR_DEPLOYMENT);
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws1178.EndpointImpl.class)
@@ -68,27 +77,30 @@
return archive;
}
- private final ObjectName objectName =
ObjectNameFactory.create("jboss.ws:service=ServerConfig");
- private String webServiceHost;
+
+
+ @Before
public void setUp() throws Exception {
// Setting the WebServiceHost to an empty string, causes the request host to be
used.
// This must be done before deploy time.
webServiceHost = (String) getServer().getAttribute(objectName,
"WebServiceHost");
getServer().setAttribute(objectName, new Attribute("WebServiceHost",
""));
super.setUp();
+ deployer.deploy(WAR_DEPLOYMENT);
}
-
+ @After
public void tearDown() throws Exception {
super.tearDown();
+ deployer.undeploy(WAR_DEPLOYMENT);
getServer().setAttribute(objectName, new Attribute("WebServiceHost",
webServiceHost));
+
}
@Test
@RunAsClient
public void testHostAddress() throws Exception
{
- setUp();
InetAddress inetAddr = InetAddress.getByName(getServerHost());
String hostAddress = inetAddr instanceof Inet6Address ? "[" +
inetAddr.getHostAddress() + "]" : inetAddr.getHostAddress();
URL wsdlURL = new URL(baseURL + "/testpattern?wsdl");
@@ -100,14 +112,12 @@
URL epURL = new
URL((String)reqCtx.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
assertEquals(wsdlURL.getHost(), epURL.getHost());
- tearDown();
}
@Test
@RunAsClient
public void testHostName() throws Exception
{
- setUp();
InetAddress inetAddr = InetAddress.getByName(getServerHost());
URL wsdlURL = new URL(baseURL + "/testpattern?wsdl");
@@ -116,8 +126,6 @@
Endpoint port = service.getPort(Endpoint.class);
Map<String, Object> reqCtx = ((BindingProvider)port).getRequestContext();
URL epURL = new
URL((String)reqCtx.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
-
assertEquals(wsdlURL.getHost(), epURL.getHost());
- tearDown();
}
}
Show replies by date