Author: asoldano
Date: 2015-04-13 06:11:22 -0400 (Mon, 13 Apr 2015)
New Revision: 19629
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java
Log:
Applying test patch from Jan Bliznak
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2015-04-13
10:11:22 UTC (rev 19629)
@@ -447,6 +447,7 @@
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/STSCallbackHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.class"/>
</classes>
<webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF">
<include name="wsdl/ws-trust*"/>
@@ -550,6 +551,7 @@
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/STSBearerCallbackHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.class"/>
</classes>
<webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF">
<include name="wsdl/bearer-ws-trust*"/>
@@ -592,6 +594,7 @@
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/STSHolderOfKeyCallbackHandler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.class"/>
</classes>
<webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF">
<include name="wsdl/holderofkey-ws-trust*"/>
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsdd/WSDiscoveryTestCase.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -66,20 +66,27 @@
ProbeType pt = new ProbeType();
ScopesType scopes = new ScopesType();
pt.setScopes(scopes);
- List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt,
TIMEOUT).getProbeMatch(), getServerHost());
-
+
+ String serverHost = getServerHost().replace("127.0.0.1",
"localhost");
+ List<ProbeMatchType> pmts = client.probe(pt, TIMEOUT).getProbeMatch();
+ assertFalse("There must be some services discovered, check that you have
allowed UDP broadcast on port 3072", pmts.isEmpty());
+
+ List<ProbeMatchType> pmtsForHost = filterProbeMatchesForHost(pmts,
serverHost);
+ assertFalse("There must be some services discovered for server host "
+ serverHost
+ + ", found only: " + dbgProbeMatchTypeList(pmts),
pmtsForHost.isEmpty());
+
List<ResolveMatchType> rmts = new LinkedList<ResolveMatchType>();
- for (ProbeMatchType pmt : pmts) {
+ for (ProbeMatchType pmt : pmtsForHost) {
W3CEndpointReference epr = pmt.getEndpointReference();
ResolveMatchType rmt = client.resolve(epr, TIMEOUT);
assertNotNull("Could not resolve (timeout = " + TIMEOUT + "
ms) reference: " + epr, rmt);
rmts.add(rmt);
}
-
+
final QName typeName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wsdd",
"ServiceIface");
- checkResolveMatches(rmts, "http://" + getServerHost() +
":8080/jaxws-samples-wsdd/WSDDService", typeName);
- checkResolveMatches(rmts, "http://" + getServerHost() +
":8080/jaxws-samples-wsdd2/WSDDService", typeName);
- checkResolveMatches(rmts, "http://" + getServerHost() +
":8080/jaxws-samples-wsdd2/AnotherWSDDService", typeName);
+ checkResolveMatches(rmts, "http://" + serverHost +
":8080/jaxws-samples-wsdd/WSDDService", typeName);
+ checkResolveMatches(rmts, "http://" + serverHost +
":8080/jaxws-samples-wsdd2/WSDDService", typeName);
+ checkResolveMatches(rmts, "http://" + serverHost +
":8080/jaxws-samples-wsdd2/AnotherWSDDService", typeName);
client.close();
} finally {
bus.shutdown(true);
@@ -124,7 +131,7 @@
ProbeType pt = new ProbeType();
ScopesType scopes = new ScopesType();
pt.setScopes(scopes);
- List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt,
TIMEOUT).getProbeMatch(), getServerHost());
+ List<ProbeMatchType> pmts = filterProbeMatchesForHost(client.probe(pt,
TIMEOUT).getProbeMatch(), getServerHost().replace("127.0.0.1",
"localhost"));
List<ResolveMatchType> rmts = new LinkedList<ResolveMatchType>();
for (ProbeMatchType pmt : pmts) {
@@ -162,20 +169,35 @@
private String dbgDumpList(List<ResolveMatchType> rmtList){
StringBuilder dbgStr = new StringBuilder().append("\n");
- if(rmtList.size() > 1){
- for(ResolveMatchType rmt: rmtList){
- String tmpStr = rmt.getEndpointReference().toString();
- int start = tmpStr.indexOf("<Address>");
- int end = tmpStr.indexOf("</Address>");
- if (start > -1 && end > -1){
- String uuidStr = tmpStr.substring(start+9, end);
- dbgStr.append(rmt.getXAddrs().get(0) +" " + uuidStr +
"\n");
- }
+ for(ResolveMatchType rmt: rmtList){
+ String tmpStr = rmt.getEndpointReference().toString();
+ int start = tmpStr.indexOf("<Address>");
+ int end = tmpStr.indexOf("</Address>");
+ if (start > -1 && end > -1){
+ String uuidStr = tmpStr.substring(start+9, end);
+ dbgStr.append(rmt.getXAddrs().get(0) +" " + uuidStr +
"\n");
}
}
return dbgStr.toString();
}
+ // tmp method for debugging jenkins runs.
+ // report uuid of the endpoint
+ private String dbgProbeMatchTypeList(List<ProbeMatchType> pmtList){
+ StringBuilder dbgStr = new StringBuilder().append("\n");
+
+ for(ProbeMatchType rmt: pmtList){
+ String tmpStr = rmt.getEndpointReference().toString();
+ int start = tmpStr.indexOf("<Address>");
+ int end = tmpStr.indexOf("</Address>");
+ if (start > -1 && end > -1){
+ String uuidStr = tmpStr.substring(start + 9, end);
+ dbgStr.append(rmt.getXAddrs().get(0) +" " + uuidStr +
"\n");
+ }
+ }
+ return dbgStr.toString();
+ }
+
private List<ResolveMatchType> getByAddress(List<ResolveMatchType> rmts,
String address)
{
List<ResolveMatchType> list = new LinkedList<ResolveMatchType>();
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/sts/SampleSTS.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -40,6 +40,7 @@
import org.apache.cxf.sts.token.validator.SAMLTokenValidator;
import org.apache.cxf.sts.token.validator.UsernameTokenValidator;
import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils;
@WebServiceProvider(serviceName = "SecurityTokenService",
portName = "UT_Port",
@@ -67,18 +68,11 @@
List<ServiceMBean> services = new LinkedList<ServiceMBean>();
StaticService service = new StaticService();
+ String serverHostRegexp = WSTrustAppUtils.getServerHost().replace("[",
"\\[").replace("]", "\\]").replace("127.0.0.1",
"localhost");
service.setEndpoints(Arrays.asList(
-
"http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
-
"http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
-
"http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
-
-
"http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
-
"http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
-
"http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
-
-
"http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService",
-
"http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService",
-
"http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService"
+ "http://" + serverHostRegexp +
":(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+ "http://" + serverHostRegexp +
":(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
+ "http://" + serverHostRegexp +
":(\\d)*/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService"
));
services.add(service);
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsbearer/SampleSTSBearer.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -29,6 +29,7 @@
import org.apache.cxf.sts.service.StaticService;
import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils;
import javax.xml.ws.WebServiceProvider;
import java.util.Arrays;
@@ -62,10 +63,9 @@
List<ServiceMBean> services = new LinkedList<ServiceMBean>();
StaticService service = new StaticService();
+ String serverHostRegexp = WSTrustAppUtils.getServerHost().replace("[",
"\\[").replace("]", "\\]").replace("127.0.0.1",
"localhost");
service.setEndpoints(Arrays.asList(
-
"https://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-bearer/BearerService",
-
"https://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-bearer/BearerService",
-
"https://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-bearer/BearerService"
+ "https://" + serverHostRegexp +
":(\\d)*/jaxws-samples-wsse-policy-trust-bearer/BearerService"
));
services.add(service);
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/stsholderofkey/SampleSTSHolderOfKey.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -29,6 +29,7 @@
import org.apache.cxf.sts.service.StaticService;
import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils;
import javax.xml.ws.WebServiceProvider;
import java.util.Arrays;
@@ -65,10 +66,9 @@
List<ServiceMBean> services = new LinkedList<ServiceMBean>();
StaticService service = new StaticService();
+ String serverHostRegexp = WSTrustAppUtils.getServerHost().replace("[",
"\\[").replace("]", "\\]").replace("127.0.0.1",
"localhost");
service.setEndpoints(Arrays.asList(
-
"https://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService",
-
"https://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService",
-
"https://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService"
+ "https://" + serverHostRegexp +
":(\\d)*/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService"
));
services.add(service);
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -86,14 +86,8 @@
transport = soapBinding.getTransportURI();
}
}
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-2531] Wrong \"transport\"
attribute in soap12:binding");
- }
- else
- {
- assertEquals("Invalid transport uri",
"http://schemas.xmlsoap.org/soap/http", transport);
- }
+
+ assertEquals("Invalid transport uri",
"http://schemas.xmlsoap.org/soap/http", transport);
}
public void testClientAccess() throws Exception
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -69,7 +69,9 @@
assertEquals(500, c.getResponseCode());
String error = IOUtils.readAndCloseStream(c.getErrorStream());
c.disconnect();
- assertTrue(error.contains("Could not instantiate ClientServlet2") ||
error.contains("Error instantiating servlet class
org.jboss.test.ws.jaxws.jbws2307.ClientServlet2"));
+ if (error.contains("error-text-div")) { //the actual error exception
does not seem to be always returned by web layer
+ assertTrue(error.contains("Could not instantiate ClientServlet2")
|| error.contains("Error instantiating servlet class
org.jboss.test.ws.jaxws.jbws2307.ClientServlet2"));
+ }
} finally {
JBossWSTestHelper.undeploy(DeploymentArchives.CLIENT_2);
}
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3736/JBWS3736TestCase.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -61,9 +61,11 @@
public void testAddressRewrite() throws Exception
{
String wsdl = IOUtils.readAndCloseStream(new URL(TARGET_ENDPOINT_ADDRESS +
"?wsdl").openStream());
+
+ String serverHost = getServerHost().replace("127.0.0.1",
"localhost"); //because
https://issues.jboss.org/browse/CTS-11
//we expect the published wsdl to have the https protocol in the soap:address
because the original wsdl provided
//in the deployment has that. This shows that the reference to the wsdl in endpoint
interface has been processed
//when rewriting the soap:address. If we got http protocol here, the fix won't
be in place.
- assertTrue(wsdl.contains("https://" + getServerHost() +
":8443/jaxws-jbws3736"));
+ assertTrue(wsdl, wsdl.contains("https://" + serverHost + ":"
+"8443/jaxws-jbws3736"));
}
}
Modified:
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java 2015-04-13
10:03:50 UTC (rev 19628)
+++
stack/cxf/branches/jbossws-cxf-4.3.x/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java 2015-04-13
10:11:22 UTC (rev 19629)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.management.recording;
+import java.net.InetAddress;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
@@ -132,16 +133,14 @@
setRecording(true);
port.echo1("Test getRecordsByClientHost");
-
- //We have client and server on the same host here...
- String host = "localhost".equals(getServerHost()) ? "127.0.0.1"
: getServerHost();
- if ("[::1]".equals(host)) host = "0:0:0:0:0:0:0:1"; // IPv6
hack
-
+
+ // MemoryBufferRecorder stores source host as InetAddress IP format, eg. [::1] will
be considered 0:0:0:0:0:0:0:1
+ String host = InetAddress.getByName(getServerHost()).getHostAddress();
+
Map<String, List<Record>> localhostRecords = (Map<String,
List<Record>>)server.invoke(oname, "getRecordsByClientHost", new
Object[] { host },
new String[] { "java.lang.String" });
Map<String, List<Record>> amazonRecords = (Map<String,
List<Record>>)server.invoke(oname, "getRecordsByClientHost", new
Object[] { "72.21.203.1" },
new String[] { "java.lang.String" });
-
assertTrue("No records for " + host, localhostRecords.size() > 0);
assertTrue("There are records for 72.21.203.1", amazonRecords.size() ==
0);
}
@@ -156,10 +155,7 @@
OperationFilter operationFilter = new OperationFilter(new QName(targetNS,
"echo1"));
LinkedList<String> l = new LinkedList<String>();
- l.add("localhost");
- l.add("127.0.0.1");
- l.add("[::1]");
- l.add("[0:0:0:0:0:0:0:1]");
+ l.add(getServerHost().replace("127.0.0.1", "localhost"));
HostFilter hostFilter = new HostFilter(l,false); //destination
RecordFilter[] filters = new RecordFilter[] {operationFilter, hostFilter};
@@ -170,7 +166,10 @@
Map<String, List<Record>> stopRecords = (Map<String,
List<Record>>)server.invoke(oname, "getMatchingRecords", new Object[] {
filters }, new String[] { filters.getClass().getName() });
- assertEquals(1, stopRecords.keySet().size() - startRecords.keySet().size());
+ Map<String, List<Record>> allRecords = (Map<String,
List<Record>>) server.invoke(oname, "getMatchingRecords", new
Object[]{new RecordFilter[]{operationFilter}}, new
String[]{filters.getClass().getName()});
+
+ assertTrue("No records for hosts " + l + ", all records found:
" + dumpInboundRecordsInfo(allRecords), stopRecords.size() > 0);
+ assertEquals("There must be only 1 record for echo1 operation", 1,
stopRecords.keySet().size() - startRecords.keySet().size());
}
public void testAddRemoveFilter() throws Exception
@@ -230,4 +229,20 @@
Service service = Service.create(wsdlURL, serviceName);
return service.getPort(Endpoint.class);
}
+
+ private String dumpInboundRecordsInfo(Map<String, List<Record>> records)
{
+ StringBuilder sb = new StringBuilder();
+ for (String key : records.keySet()) {
+ sb.append(records.get(key)).append("\n");
+ for (Record record : records.get(key)) {
+ if(record.getMessageType() == Record.MessageType.INBOUND) {
+ sb.append("
").append(record.getGroupID()).append("\n");
+ sb.append(" Source host:
").append(record.getSourceHost()).append("\n");
+ sb.append(" Destination host:
").append(record.getDestinationHost()).append("\n");
+ }
+ }
+ }
+ return sb.toString();
+ }
+
}