use of org.eclipse.equinox.concurrent.future.IFuture in project ecf by eclipse.
the class DiscoveryTest method testGetAsyncServiceTypes.
/**
* Test method for
* {@link org.eclipse.ecf.discovery.IDiscoveryLocator#getAsyncServiceTypes()}.
* @throws ContainerConnectException
* @throws InterruptedException
* @throws OperationCanceledException
*/
public void testGetAsyncServiceTypes() throws ContainerConnectException, OperationCanceledException, InterruptedException {
registerService();
final IFuture aFuture = discoveryLocator.getAsyncServiceTypes();
final Object object = aFuture.get();
assertTrue(object instanceof IServiceTypeID[]);
final IServiceTypeID[] services = (IServiceTypeID[]) object;
// just expect one event as the implementation filters dupes
assertTrue("Found: " + services.length + Arrays.asList(services), services.length == 1);
for (int i = 0; i < services.length; i++) {
IServiceTypeID iServiceTypeId = services[i];
if (serviceInfo.getServiceID().getServiceTypeID().equals(iServiceTypeId)) {
return;
}
}
fail("Self registered service not found");
}
Aggregations