Author: asoldano
Date: 2014-05-23 12:31:34 -0400 (Fri, 23 May 2014)
New Revision: 18690
Modified:
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
Log:
Enriching testcase
Modified:
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
===================================================================
---
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2014-05-22
20:49:08 UTC (rev 18689)
+++
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2014-05-23
16:31:34 UTC (rev 18690)
@@ -576,6 +576,7 @@
/**
* Test soap:address rewrite. The new address contains the webServicePath setting.
+ *
* @throws Exception
*/
public void testRewriteCodeFirstContext() throws Exception
@@ -586,14 +587,12 @@
deploy("jaxws-jbws2150-codefirst.war");
try
{
- final String testHost = getServerHost();
- final String expectedWsdlHost = getServerHost();
- final String addr = "http://" + testHost +
":8080/jaxws-jbws2150-codefirst/CodeFirstService";
- final String wsdlLocation = addr + "?wsdl";
+ final String serverHost = getServerHost();
+ final String wsdlLocation = "http://" + serverHost +
":8080/jaxws-jbws2150-codefirst/CodeFirstService?wsdl";
Definition definition = getWSDLDefinition(wsdlLocation);
String address = getPortAddress(definition, "CodeFirstService",
"CodeFirstPort");
- assertEquals("http://" + expectedWsdlHost + ":8080/" +
addContext +"/CodeFirstService", address);
+ assertEquals("http://" + serverHost + ":8080/" + addContext
+"/CodeFirstService", address);
}
finally
{
@@ -602,8 +601,8 @@
}
/**
- * Test soap:address rewrite. The address does not change because of the
- * webServiceHost setting.
+ * Test soap:address rewrite with code-first endpoint and context set
+ *
* @throws Exception
*/
public void testAutoRewriteCodeFirstContext() throws Exception
@@ -615,15 +614,18 @@
deploy("jaxws-jbws2150-codefirst.war");
try
{
- final String testHost = getServerHost();
- final String expectedWsdlHost = getServerHost();
- final String addr = "http://" + testHost +
":8080/jaxws-jbws2150-codefirst/CodeFirstService";
- final String wsdlLocation = addr + "?wsdl";
+ String serverHost = getServerHost();
+ final String wsdlLocation = "http://" + serverHost +
":8080/jaxws-jbws2150-codefirst/CodeFirstService?wsdl";
Definition definition = getWSDLDefinition(wsdlLocation);
String address = getPortAddress(definition, "CodeFirstService",
"CodeFirstPort");
- assertEquals("http://" + expectedWsdlHost + ":8080/" +
addContext +"/CodeFirstService", address);
-
+ assertEquals("http://" + serverHost + ":8080/" + addContext
+"/CodeFirstService", address);
+
+ if (isTestsuiteServerHostLocalhost()) {
+ definition =
getWSDLDefinition("http://127.0.0.1:8080/jaxws-jbws2150-codefirst/CodeFirstService?wsdl");
+ address = getPortAddress(definition, "CodeFirstService",
"CodeFirstPort");
+ assertEquals("http://127.0.0.1:8080/" + addContext
+"/CodeFirstService", address);
+ }
}
finally
{
@@ -632,8 +634,8 @@
}
/**
- * Test soap:address rewrite. The addresses should not be rewritten because
- * of the webServiceHost setting.
+ * Test soap:address rewrite with host configured to ServerConfig.UNDEFINED_HOSTNAME
and context set
+ *
* (see MetadataBuilder#processAddressRewrite)
*
* @throws Exception
@@ -647,29 +649,35 @@
deploy("jaxws-jbws2150.war");
try
{
+ final Map<String, String> wsdlLocationsMap = new HashMap<String,
String>();
final String serverHost = getServerHost();
- final List<String> wsdlLocations = new LinkedList<String>();
- wsdlLocations.add("http://" + serverHost +
":8080/jaxws-jbws2150/ValidURL?wsdl");
- wsdlLocations.add("http://" + serverHost +
":8080/jaxws-jbws2150/InvalidURL?wsdl");
- wsdlLocations.add("http://" + serverHost +
":8080/jaxws-jbws2150/ValidSecureURL?wsdl");
- wsdlLocations.add("http://" + serverHost +
":8080/jaxws-jbws2150/InvalidSecureURL?wsdl");
-
- // the addresses should not be rewritten because of the webServiceHost setting.
- for (final String wsdlLocation : wsdlLocations)
- {
+ wsdlLocationsMap.put("http://" + serverHost +
":8080/jaxws-jbws2150/ValidURL?wsdl", serverHost);
+ wsdlLocationsMap.put("http://" + serverHost +
":8080/jaxws-jbws2150/InvalidURL?wsdl", serverHost);
+ wsdlLocationsMap.put("http://" + serverHost +
":8080/jaxws-jbws2150/ValidSecureURL?wsdl", serverHost);
+ wsdlLocationsMap.put("http://" + serverHost +
":8080/jaxws-jbws2150/InvalidSecureURL?wsdl", serverHost);
+ if (isTestsuiteServerHostLocalhost()) {
+
wsdlLocationsMap.put("http://127.0.0.1:8080/jaxws-jbws2150/ValidURL?wsdl",
"127.0.0.1");
+
wsdlLocationsMap.put("http://127.0.0.1:8080/jaxws-jbws2150/InvalidURL?wsdl",
"127.0.0.1");
+
wsdlLocationsMap.put("http://127.0.0.1:8080/jaxws-jbws2150/ValidSecureURL?wsdl",
"127.0.0.1");
+
wsdlLocationsMap.put("http://127.0.0.1:8080/jaxws-jbws2150/InvalidSecureURL?wsdl",
"127.0.0.1");
+ }
+
+ for (Entry<String, String> entry : wsdlLocationsMap.entrySet()) {
+ String wsdlLocation = entry.getKey();
+ String host = entry.getValue();
Definition definition = getWSDLDefinition(wsdlLocation);
String address = getPortAddress(definition, "ValidURLService",
"ValidURLPort");
- assertEquals("http://" + serverHost + ":8080/" +
addContext + "/ValidURL", address);
+ assertEquals("http://" + host + ":8080/" + addContext +
"/ValidURL", address);
address = getPortAddress(definition, "InvalidURLService",
"InvalidURLPort");
- assertEquals("http://" + serverHost + ":8080/" +
addContext + "/InvalidURL", address);
+ assertEquals("http://" + host + ":8080/" + addContext +
"/InvalidURL", address);
address = getPortAddress(definition, "ValidSecureURLService",
"ValidSecureURLPort");
- assertEquals("http://" + serverHost + ":8080/" +
addContext + "/ValidSecureURL", address);
+ assertEquals("http://" + host + ":8080/" + addContext +
"/ValidSecureURL", address);
address = getPortAddress(definition, "InvalidSecureURLService",
"InvalidSecureURLPort");
- assertEquals("http://" + serverHost + ":8080/" +
addContext + "/InvalidSecureURL", address);
+ assertEquals("http://" + host + ":8080/" + addContext +
"/InvalidSecureURL", address);
//check wsdl import (which is bound to the endpoint currently serving the
wsdl)
assertTrue(getWsdlImportAddress(definition).contains(addContext));