Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2008-06-03 06:42:05 -0400
committermkuppe2008-06-03 06:42:05 -0400
commit195fa5896afd7d8592906a1f5e7cc3e8b2bbd69a (patch)
treedb613ee2cc77e43426127fff3194ade204f95fc4 /tests/bundles/org.eclipse.ecf.tests.provider.jslp
parent28594ec2cda19f9f703f7d47b76a00533b0effcc (diff)
downloadorg.eclipse.ecf-195fa5896afd7d8592906a1f5e7cc3e8b2bbd69a.tar.gz
org.eclipse.ecf-195fa5896afd7d8592906a1f5e7cc3e8b2bbd69a.tar.xz
org.eclipse.ecf-195fa5896afd7d8592906a1f5e7cc3e8b2bbd69a.zip
RESOLVED - bug 235115: [Discovery][SLP] JSLPDiscoveryContainer.getServiceInfo(IServiceID) does not fully honor IServiceID.getServiceName()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=235115 FORWARD PORT from Revision_2_0
Diffstat (limited to 'tests/bundles/org.eclipse.ecf.tests.provider.jslp')
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java b/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java
index 9989685ba..a92e2848e 100755
--- a/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java
@@ -10,13 +10,13 @@
******************************************************************************/
package org.eclipse.ecf.tests.provider.jslp;
-import java.net.InetAddress;
import java.net.URI;
import java.util.Arrays;
import java.util.Comparator;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.discovery.IServiceInfo;
+import org.eclipse.ecf.discovery.identity.IServiceID;
import org.eclipse.ecf.discovery.identity.IServiceTypeID;
import org.eclipse.ecf.provider.jslp.identity.JSLPServiceID;
@@ -34,19 +34,19 @@ public class JSLPTestComparator implements Comparator {
IServiceInfo first = (IServiceInfo) arg0;
IServiceInfo second = (IServiceInfo) arg1;
- //TODO-mkuppe No prio, weight and protocol atm in the JSLP testcase
- JSLPServiceID firstID = (JSLPServiceID) first.getServiceID();
- JSLPServiceID secondID = (JSLPServiceID) second.getServiceID();
+ IServiceID firstID = (JSLPServiceID) first.getServiceID();
+ IServiceID secondID = (JSLPServiceID) second.getServiceID();
IServiceTypeID firstTypeID = firstID.getServiceTypeID();
IServiceTypeID secondTypeID = secondID.getServiceTypeID();
+ //TODO-mkuppe No prio, weight and protocol atm in the JSLP testcase
boolean protocolsSame = Arrays.equals(firstTypeID.getProtocols(), secondTypeID.getProtocols());
boolean weightSame = first.getWeight() == second.getWeight();
boolean prioSame = first.getPriority() == second.getPriority();
-
- InetAddress firstAddress = firstID.getAddress();
- InetAddress secondAddress = secondID.getAddress();
- boolean addressSame = firstAddress.equals(secondAddress);
+
+ String firstName = firstID.getName();
+ String secondName = secondID.getName();
+ boolean nameSame = firstName.equals(secondName);
String[] firstServices = firstTypeID.getServices();
String[] secondServices = secondTypeID.getServices();
boolean serviceSame = Arrays.equals(firstServices, secondServices);
@@ -61,7 +61,7 @@ public class JSLPTestComparator implements Comparator {
boolean locationSame = firstLocation.equals(secondLocation);
boolean scopesSame = Arrays.equals(firstTypeID.getScopes(), secondTypeID.getScopes());
boolean propertySame = first.getServiceProperties().equals(second.getServiceProperties());
- boolean result = addressSame && namespaceSame && serviceSame && naSame && locationSame && scopesSame && propertySame;
+ boolean result = nameSame && namespaceSame && serviceSame && naSame && locationSame && scopesSame && propertySame;
if(result == true) {
return 0;
}

Back to the top