Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2009-02-14 04:23:00 -0500
committermkuppe2009-02-14 04:23:00 -0500
commitf07c210f6320ff3558dfef8146d89c7122e1503b (patch)
treecea6f30631102a88eb92578d5608b1dd3d86eb09 /tests/bundles/org.eclipse.ecf.tests.provider.jslp
parent107ce7f6080ac62150f2ee10cbf179fb394c55ff (diff)
downloadorg.eclipse.ecf-f07c210f6320ff3558dfef8146d89c7122e1503b.tar.gz
org.eclipse.ecf-f07c210f6320ff3558dfef8146d89c7122e1503b.tar.xz
org.eclipse.ecf-f07c210f6320ff3558dfef8146d89c7122e1503b.zip
NEW - bug 259263: [Discovery][SLP] jSLP doesn't translate default scope, protocols and naming authority to internal and vice versa
https://bugs.eclipse.org/bugs/show_bug.cgi?id=259263
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/identity/JSLPServiceIDTest.java20
1 files changed, 15 insertions, 5 deletions
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 76304ed75..249f7c600 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
@@ -62,7 +62,7 @@ public class JSLPServiceIDTest extends ServiceIDTest {
final IServiceID sid = (IServiceID) createIDFromString(SERVICE_TYPE);
final JSLPServiceTypeID stid = (JSLPServiceTypeID) sid.getServiceTypeID();
- assertEquals("service:" + SERVICES[0] + ":" + SERVICES[1] + ":" + SERVICES[2], stid.getInternal());
+ assertEquals("service:" + SERVICES[0] + ":" + SERVICES[1] + "." + NAMINGAUTHORITY + ":" + SERVICES[2], stid.getInternal());
assertEquals(SERVICE_TYPE, stid.getName());
assertEquals(NAMINGAUTHORITY, stid.getNamingAuthority());
@@ -150,18 +150,28 @@ public class JSLPServiceIDTest extends ServiceIDTest {
assertTrue(Arrays.equals(PROTOCOLS, stid.getProtocols()));
String internal = stid.getInternal();
- assertEquals("service:ecf:foo:bar", internal);
+ assertEquals("service:" + SERVICES[0] + ":" + SERVICES[1] + ":" + SERVICES[2], internal);
}
public void testjSLPDefaultsToECF() {
String expected = "some Name";
- fail();
+ Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
+ IServiceID aServiceID = ServiceIDFactory.getDefault().createServiceID(namespaceByName, SERVICES, new String[]{SCOPE}, PROTOCOLS, NAMINGAUTHORITY, expected);
+ assertNotNull(aServiceID);
+
+ IServiceTypeID stid = aServiceID.getServiceTypeID();
+ assertEquals(NAMINGAUTHORITY, stid.getNamingAuthority());
+ assertEquals("_ecf._junit._tests._someProtocol." + SCOPE + "._" + NAMINGAUTHORITY + "@" + expected, aServiceID.getName());
+ }
+
+ public void testjSLPDefaultsToECF2() {
+ String expected = "some Name";
Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
IServiceID aServiceID = ServiceIDFactory.getDefault().createServiceID(namespaceByName, SERVICES, PROTOCOLS, expected);
assertNotNull(aServiceID);
IServiceTypeID stid = aServiceID.getServiceTypeID();
- String internal = stid.getInternal();
- assertEquals("service:ecf:foo:bar", internal);
+ assertEquals(IServiceTypeID.DEFAULT_NA, stid.getNamingAuthority());
+ assertEquals("_ecf._junit._tests._someProtocol." + IServiceTypeID.DEFAULT_SCOPE[0] + "._" + IServiceTypeID.DEFAULT_NA + "@" + expected, aServiceID.getName());
}
}

Back to the top