use of org.eclipse.ecf.remoteservice.IRemoteServiceReference 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.IRemoteServiceReference in project ecf by eclipse.
the class AbstractConcatConsumerTestCase method testGetRemoteServiceIDs.
public void testGetRemoteServiceIDs() throws Exception {
final IRemoteServiceReference[] refs = getRemoteServiceReferences(targetID, getRemoteServiceClass().getName(), getRemoteServiceFilter());
assertTrue(refs != null);
assertTrue(refs.length > 0);
for (int i = 0; i < refs.length; i++) {
IRemoteServiceID rsid = refs[i].getID();
assertNotNull(rsid);
}
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceReference in project ecf by eclipse.
the class AbstractConcatConsumerTestCase method testGetRemoteServiceWithLocallyRegisteredService.
public void testGetRemoteServiceWithLocallyRegisteredService() throws Exception {
String classname = getRemoteServiceClass().getName();
// Register service locally
registerLocalService(classname, createRemoteService(), createRemoteServiceProperties());
// Now get remote service
final IRemoteService service = getRemoteService(targetID, getRemoteServiceClass().getName(), getRemoteServiceFilter());
assertNotNull(service);
// Now get both
IRemoteServiceReference[] references = getRemoteServiceReferences(new ID[] { rsContainer.getContainer().getID(), targetID }, classname, getRemoteServiceFilter());
assertNotNull(references);
assertTrue(references.length == 2);
Thread.sleep(ASYNC_WAITTIME);
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceReference in project ecf by eclipse.
the class AbstractConcatConsumerTestCase method testGetRemoteServiceReferenceServiceID.
public void testGetRemoteServiceReferenceServiceID() throws Exception {
final IRemoteServiceReference[] refs = getRemoteServiceReferences(targetID, getRemoteServiceClass().getName(), getRemoteServiceFilter());
assertTrue(refs != null);
assertTrue(refs.length > 0);
for (int i = 0; i < refs.length; i++) {
IRemoteServiceID rsid = refs[i].getID();
Long sid = (Long) refs[i].getProperty(org.eclipse.ecf.remoteservice.Constants.SERVICE_ID);
assertNotNull(sid);
assertTrue(sid.longValue() > -1);
assertTrue(sid.longValue() == rsid.getContainerRelativeID());
}
}
use of org.eclipse.ecf.remoteservice.IRemoteServiceReference 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();
}
Aggregations