use of org.eclipse.ecf.remoteservice.IRemoteServiceRegistration in project ecf by eclipse.
the class RpcRemoteServiceAdapterTest method testGetRemoteServiceReference.
public void testGetRemoteServiceReference() {
IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
IRemoteServiceReference remoteServiceReference = getRemoteServiceClientContainerAdapter().getRemoteServiceReference(registration.getID());
assertEquals(registration.getReference(), remoteServiceReference);
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceRegistration in project ecf by eclipse.
the class AbstractLocalRemoteServiceTest method testGetAllLocalRemoteServiceReference.
public void testGetAllLocalRemoteServiceReference() throws Exception {
// First register some service locally
IRemoteServiceRegistration registration = containerAdapter.registerRemoteService(new String[] { IConcatService.class.getName() }, createConcatService(), null);
// Now lookup all references
IRemoteServiceReference[] allRefs = containerAdapter.getAllRemoteServiceReferences(null, null);
assertNotNull(allRefs);
assertTrue(allRefs.length == 1);
// Unregister
registration.unregister();
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceRegistration in project ecf by eclipse.
the class AbstractRemoteServiceTest method testUnregisterService.
public void testUnregisterService() throws Exception {
final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters();
// adapter [0] is the service 'server'
final IRemoteServiceRegistration reg = registerService(adapters[0], IConcatService.class.getName(), createService(), customizeProperties(null), SLEEPTIME);
assertNotNull(reg);
assertNotNull(reg.getContainerID());
reg.unregister();
Thread.sleep(SLEEPTIME);
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceRegistration in project ecf by eclipse.
the class AbstractRemoteServiceTest method registerService.
protected IRemoteServiceRegistration registerService(IRemoteServiceContainerAdapter adapter, String serviceInterface, Object service, Dictionary serviceProperties, int sleepTime) {
final IRemoteServiceRegistration result = adapter.registerRemoteService(new String[] { serviceInterface }, service, serviceProperties);
sleep(sleepTime);
return result;
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceRegistration in project ecf by eclipse.
the class RestRemoteServiceAdapterTest method testGetRemoteServiceID.
public void testGetRemoteServiceID() {
IRemoteServiceRegistration registration = createRestRegistration("resourcePath");
long containerRelativeID = registration.getID().getContainerRelativeID();
IRemoteServiceID remoteServiceID = getRemoteServiceClientContainerAdapter().getRemoteServiceID(container.getID(), containerRelativeID);
assertEquals(registration.getID(), remoteServiceID);
}
Aggregations