Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormkuppe2008-06-02 11:40:05 +0000
committermkuppe2008-06-02 11:40:05 +0000
commita355b3cfda8679d2650693f3434c6b47379d6dc1 (patch)
treee3cb5201379163843e950b42375aacb1bc3e9c20 /tests
parent793f3e8252b5405d19a43be326208d2220b92cd0 (diff)
downloadorg.eclipse.ecf-a355b3cfda8679d2650693f3434c6b47379d6dc1.tar.gz
org.eclipse.ecf-a355b3cfda8679d2650693f3434c6b47379d6dc1.tar.xz
org.eclipse.ecf-a355b3cfda8679d2650693f3434c6b47379d6dc1.zip
RESOLVED - bug 218310: [Discovery][jSLP] ServiceType in jSLP always starts with "_service."
https://bugs.eclipse.org/bugs/show_bug.cgi?id=218310 FORWARD PORT from Revision_2_0
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/AbstractDiscoveryTest.java2
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/identity/ServiceIDTest.java17
2 files changed, 9 insertions, 10 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/AbstractDiscoveryTest.java b/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/AbstractDiscoveryTest.java
index b511d20de..b0737380f 100755
--- a/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/AbstractDiscoveryTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/AbstractDiscoveryTest.java
@@ -28,7 +28,7 @@ public abstract class AbstractDiscoveryTest extends TestCase {
protected final static String QUERY = "someQuery";
protected final static String FRAGMENT = "aFragment";
- protected final static String[] SERVICES = new String[] {"service", "ecf", "tests"};
+ protected final static String[] SERVICES = new String[] {"ecf", "junit", "tests"};
protected final static String SERVICE_TYPE = "_" + SERVICES[0] + "._" + SERVICES[1] + "._" + SERVICES[2] + "._" + PROTOCOL + "." + SCOPE + "._" + NAMINGAUTHORITY;
public URI createDefaultURI() {
diff --git a/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/identity/ServiceIDTest.java b/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/identity/ServiceIDTest.java
index ba165e097..4cb55b755 100755
--- a/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/identity/ServiceIDTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests.discovery/src/org/eclipse/ecf/tests/discovery/identity/ServiceIDTest.java
@@ -12,7 +12,6 @@ package org.eclipse.ecf.tests.discovery.identity;
import java.util.Arrays;
-import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDCreateException;
import org.eclipse.ecf.core.identity.IDFactory;
import org.eclipse.ecf.core.identity.Namespace;
@@ -80,7 +79,7 @@ public abstract class ServiceIDTest extends AbstractDiscoveryTest {
/*
* use case: consumer instantiates a IServiceTypeID with the generic (ECF) String
*/
- public void testServiceTypeIDWithString() {
+ public void testServiceTypeIDWithECFGenericString() {
final IServiceID sid = createIDFromString(SERVICE_TYPE);
final IServiceTypeID stid = sid.getServiceTypeID();
assertEquals(stid.getName(), SERVICE_TYPE);
@@ -93,7 +92,7 @@ public abstract class ServiceIDTest extends AbstractDiscoveryTest {
/*
* use case: consumer instantiates a IServiceTypeID with the generic (ECF) String
*/
- public void testServiceTypeIDWithString2() {
+ public void testServiceTypeIDWithECFGenericString2() {
final String serviceType = "_service._dns-srv._udp.ecf.eclipse.org._IANA";
final IServiceID sid = createIDFromString(serviceType);
final IServiceTypeID stid = sid.getServiceTypeID();
@@ -107,7 +106,7 @@ public abstract class ServiceIDTest extends AbstractDiscoveryTest {
/*
* use case: consumer instantiates a IServiceTypeID with the generic (ECF) String
*/
- public void testServiceTypeIDWithString3() {
+ public void testServiceTypeIDWithECFGenericString3() {
final String serviceType = "_service._dns-srv._udp.ecf.eclipse.org._ECLIPSE";
final IServiceID sid = createIDFromString(serviceType);
final IServiceTypeID stid = sid.getServiceTypeID();
@@ -127,8 +126,7 @@ public abstract class ServiceIDTest extends AbstractDiscoveryTest {
final IServiceID sid = createIDFromServiceTypeID(aServiceTypeID);
final IServiceTypeID stid = sid.getServiceTypeID();
- // these are the only differences
- assertNotSame(aServiceTypeID.getNamespace(), stid.getNamespace());
+ // this is the only differences
assertNotSame(aServiceTypeID.getInternal(), stid.getInternal());
// members should be the same
@@ -155,12 +153,13 @@ public abstract class ServiceIDTest extends AbstractDiscoveryTest {
private void createFromAnother(IServiceTypeID aServiceTypeID, IServiceTypeID stid) {
final String name = aServiceTypeID.getName();
final Namespace namespace2 = stid.getNamespace();
- ID instance = null;
+ IServiceID sid = null;
try {
- instance = namespace2.createInstance(new Object[] {name, null});
+ sid = (IServiceID) namespace2.createInstance(new Object[] {name, null});
} catch (final IDCreateException e) {
fail("it should have been possible to create a new instance of " + stid.getClass().getName() + " from the string rep of " + aServiceTypeID.getClass().getName());
}
+ IServiceTypeID instance = sid.getServiceTypeID();
assertTrue(instance.hashCode() == stid.hashCode());
//TODO-mkuppe decide if equality should be handled by the namespace for IServiceTypeIDs?
assertEquals(instance, stid);
@@ -174,5 +173,5 @@ public abstract class ServiceIDTest extends AbstractDiscoveryTest {
* use case: creates the IServiceTypeID from the internal representation of the discovery provider
* to be implemented by subclasses
*/
- public abstract void testCreateServiceTypeIDFromInternalString();
+ public abstract void testCreateServiceTypeIDWithProviderSpecificString();
}

Back to the top