Search in sources :

Example 1 with ServiceLocationEnumeration

use of ch.ethz.iks.slp.ServiceLocationEnumeration in project ecf by eclipse.

the class SelfDiscoveryTest method testService.

/**
 * Test method for
 * {@link ch.ethz.iks.slp.Locator}.
 */
public void testService() throws Exception {
    int count = 0;
    for (ServiceLocationEnumeration services = TestActivator.locator.findServices(new ServiceType("service:osgi"), null, null); services.hasMoreElements(); ) {
        assertEquals(services.next().toString(), "service:osgi://" + HOST_AND_PORT);
        count++;
    }
    assertEquals(1, count);
}
Also used : ServiceType(ch.ethz.iks.slp.ServiceType) ServiceLocationEnumeration(ch.ethz.iks.slp.ServiceLocationEnumeration)

Example 2 with ServiceLocationEnumeration

use of ch.ethz.iks.slp.ServiceLocationEnumeration in project ecf by eclipse.

the class SelfDiscoveryTest method testFilter.

/**
 * Test method for
 * {@link ch.ethz.iks.slp.Locator}.
 */
public void testFilter() throws Exception {
    int count = 0;
    for (ServiceLocationEnumeration services = TestActivator.locator.findServices(new ServiceType("service:osgi"), null, "(attr=false)"); services.hasMoreElements(); ) {
        assertEquals(services.next().toString(), "service:osgi://" + HOST_AND_PORT);
        count++;
    }
    assertEquals(1, count);
}
Also used : ServiceType(ch.ethz.iks.slp.ServiceType) ServiceLocationEnumeration(ch.ethz.iks.slp.ServiceLocationEnumeration)

Example 3 with ServiceLocationEnumeration

use of ch.ethz.iks.slp.ServiceLocationEnumeration in project ecf by eclipse.

the class SelfDiscoveryTest method testFilterWithWildcard.

/**
 * Test method for
 * {@link ch.ethz.iks.slp.Locator}.
 */
public void testFilterWithWildcard() throws Exception {
    int count = 0;
    for (ServiceLocationEnumeration services = TestActivator.locator.findServices(new ServiceType("service:osgi"), null, "(attr=*)"); services.hasMoreElements(); ) {
        assertEquals(services.next().toString(), "service:osgi://" + HOST_AND_PORT);
        count++;
    }
    assertEquals(1, count);
}
Also used : ServiceType(ch.ethz.iks.slp.ServiceType) ServiceLocationEnumeration(ch.ethz.iks.slp.ServiceLocationEnumeration)

Aggregations

ServiceLocationEnumeration (ch.ethz.iks.slp.ServiceLocationEnumeration)3 ServiceType (ch.ethz.iks.slp.ServiceType)3