Search in sources :

Example 1 with IRemoteServiceID

use of org.eclipse.ecf.remoteservice.IRemoteServiceID in project ecf by eclipse.

the class AbstractRemoteServiceTest method testRegisterService.

public void testRegisterService() throws Exception {
    final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters();
    // adapter [0] is the service 'server'
    final IRemoteServiceRegistration reg = registerService(adapters[0], IConcatService.class.getName(), createService(), customizeProperties(null), 0);
    assertNotNull(reg);
    IRemoteServiceID remoteServiceID = reg.getID();
    assertNotNull(remoteServiceID);
    assertNotNull(remoteServiceID.getContainerID());
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteServiceContainerAdapter(org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter) IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Example 2 with IRemoteServiceID

use of org.eclipse.ecf.remoteservice.IRemoteServiceID in project ecf by eclipse.

the class RpcRemoteServiceAdapterTest method testGetRemoteServiceID.

public void testGetRemoteServiceID() {
    IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
    long containerRelativeID = registration.getID().getContainerRelativeID();
    IRemoteServiceID remoteServiceID = getRemoteServiceClientContainerAdapter().getRemoteServiceID(container.getID(), containerRelativeID);
    assertEquals(registration.getID(), remoteServiceID);
}
Also used : IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Example 3 with IRemoteServiceID

use of org.eclipse.ecf.remoteservice.IRemoteServiceID 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);
    }
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID)

Example 4 with IRemoteServiceID

use of org.eclipse.ecf.remoteservice.IRemoteServiceID 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());
    }
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID)

Example 5 with IRemoteServiceID

use of org.eclipse.ecf.remoteservice.IRemoteServiceID 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);
}
Also used : IRemoteServiceID(org.eclipse.ecf.remoteservice.IRemoteServiceID) IRemoteServiceRegistration(org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)

Aggregations

IRemoteServiceID (org.eclipse.ecf.remoteservice.IRemoteServiceID)6 IRemoteServiceRegistration (org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)3 IRemoteServiceReference (org.eclipse.ecf.remoteservice.IRemoteServiceReference)2 IRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter)1