Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2008-11-14 08:16:43 -0500
committermkuppe2008-11-14 08:16:43 -0500
commite8b7a432507375b32a2c93793a4f57894fef21c3 (patch)
tree7ef6068cff25e69da7ab0b5a733a31739b822fbe /tests/bundles/org.eclipse.ecf.tests.provider.jslp
parentbdd3ee1d2b9994a749fcd8cdb7ad577509c5ae0a (diff)
downloadorg.eclipse.ecf-e8b7a432507375b32a2c93793a4f57894fef21c3.tar.gz
org.eclipse.ecf-e8b7a432507375b32a2c93793a4f57894fef21c3.tar.xz
org.eclipse.ecf-e8b7a432507375b32a2c93793a4f57894fef21c3.zip
NEW - bug 230182: [Discovery][jSLP] priority, weight and protocol unset
https://bugs.eclipse.org/bugs/show_bug.cgi?id=230182 NEW - bug 255347: [Discovery][SLP] (optional) IServiceID.getServiceName isn't set on service discovery nor registration https://bugs.eclipse.org/bugs/show_bug.cgi?id=255347
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.java4
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/identity/JSLPServiceIDTest.java13
2 files changed, 12 insertions, 5 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 a92e2848e..96e3fc18f 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
@@ -39,11 +39,9 @@ public class JSLPTestComparator implements Comparator {
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();
-
String firstName = firstID.getName();
String secondName = secondID.getName();
boolean nameSame = firstName.equals(secondName);
@@ -61,7 +59,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 = nameSame && namespaceSame && serviceSame && naSame && locationSame && scopesSame && propertySame;
+ boolean result = protocolsSame && weightSame && prioSame && nameSame && namespaceSame && serviceSame && naSame && locationSame && scopesSame && propertySame;
if(result == true) {
return 0;
}
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/identity/JSLPServiceIDTest.java b/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/identity/JSLPServiceIDTest.java
index 59839a8b9..91da21a10 100755
--- a/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/identity/JSLPServiceIDTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/identity/JSLPServiceIDTest.java
@@ -28,6 +28,9 @@ import ch.ethz.iks.slp.ServiceURL;
public class JSLPServiceIDTest extends ServiceIDTest {
+ private static final int WEIGHT = 43;
+ private static final int PRIORITY = 42;
+ private static final String ASERVICENAME = "aServicename";
private static final String IANA = "iana";
public JSLPServiceIDTest() {
@@ -79,8 +82,11 @@ public class JSLPServiceIDTest extends ServiceIDTest {
final String internalRep = "service:foo.eclipse:bar";
final ServiceURL sUrl = new ServiceURL(internalRep + "://localhost:1234/a/path/to/something", ServiceURL.LIFETIME_PERMANENT);
- final IServiceInfo serviceInfo = new JSLPServiceInfo(new ServiceURLAdapter(sUrl), -1, -1, new ServicePropertiesAdapter(new ArrayList()));
+ final IServiceInfo serviceInfo = new JSLPServiceInfo(new ServiceURLAdapter(sUrl, "aServiceNameString"), PRIORITY, WEIGHT, new ServicePropertiesAdapter(new ArrayList()));
+ assertEquals(serviceInfo.getPriority(), PRIORITY);
+ assertEquals(serviceInfo.getWeight(), WEIGHT);
final IServiceID sid = serviceInfo.getServiceID();
+ assertEquals(sid.getServiceName(), ASERVICENAME);
final IServiceTypeID stid = sid.getServiceTypeID();
String internal = stid.getInternal();
@@ -102,8 +108,11 @@ public class JSLPServiceIDTest extends ServiceIDTest {
final String internalRep = "service:service:foo.eclipse:bar";
final ServiceURL sUrl = new ServiceURL(internalRep + "://localhost:1234/a/path/to/something", ServiceURL.LIFETIME_PERMANENT);
- final IServiceInfo serviceInfo = new JSLPServiceInfo(new ServiceURLAdapter(sUrl), -1, -1, new ServicePropertiesAdapter(new ArrayList()));
+ final IServiceInfo serviceInfo = new JSLPServiceInfo(new ServiceURLAdapter(sUrl, ASERVICENAME), PRIORITY, WEIGHT, new ServicePropertiesAdapter(new ArrayList()));
+ assertEquals(serviceInfo.getPriority(), PRIORITY);
+ assertEquals(serviceInfo.getWeight(), WEIGHT);
final IServiceID sid = serviceInfo.getServiceID();
+ assertEquals(sid.getServiceName(), ASERVICENAME);
final IServiceTypeID stid = sid.getServiceTypeID();
assertEquals(internalRep, stid.getInternal());

Back to the top