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);
}
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);
}
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);
}
Aggregations