Search in sources :

Example 1 with IEcho

use of org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho in project ecf by eclipse.

the class RpcRemoteServiceTest method testCallViaProxy2.

public void testCallViaProxy2() {
    IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationEchoProxy.getReference());
    try {
        IEcho echo = (IEcho) rpcClientService.getProxy();
        assertNotNull(echo);
        Object result = echo.echo(ECHO_TEST_DATA);
        assertNotNull(result);
        assertEquals(result, ECHO_TEST_DATA);
    } catch (ECFException e) {
        e.printStackTrace();
        fail("Could not contact the service");
    }
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) IEcho(org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 2 with IEcho

use of org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho in project ecf by eclipse.

the class RpcRemoteServiceTest method testCallViaProxy.

public void testCallViaProxy() {
    IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationEchoProxy.getReference());
    try {
        IEcho echo = (IEcho) rpcClientService.getProxy(Activator.class.getClassLoader(), new Class[] { IEcho.class });
        assertNotNull(echo);
        Object result = echo.echo(ECHO_TEST_DATA);
        assertNotNull(result);
        assertEquals(result, ECHO_TEST_DATA);
    } catch (ECFException e) {
        e.printStackTrace();
        fail("Could not contact the service");
    }
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) IEcho(org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Aggregations

ECFException (org.eclipse.ecf.core.util.ECFException)2 IRemoteService (org.eclipse.ecf.remoteservice.IRemoteService)2 IEcho (org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho)2