Search in sources :

Example 36 with IRemoteService

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

the class AbstractRemoteServiceTest method testCallAsynch.

public void testCallAsynch() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    if (service == null)
        return;
    traceCallStart("callAsynch");
    service.callAsync(createRemoteConcat("ECF ", "is cool"), createRemoteCallListener());
    traceCallEnd("callAsynch");
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 37 with IRemoteService

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

the class AbstractRemoteServiceTest method testBadCallSynch.

public void testBadCallSynch() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    if (service == null)
        return;
    // exist
    try {
        service.callSync(createRemoteCall("concat1", new Object[] { "first", "second" }));
        fail();
    } catch (final ECFException e) {
    // Exception should occur
    }
    // concat
    try {
        service.callSync(createRemoteCall("concat", new Object[] { "first" }));
        fail();
    } catch (final ECFException e) {
    // Exception should occur
    }
    Thread.sleep(SLEEPTIME);
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 38 with IRemoteService

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

the class AbstractRemoteServiceTest method testGetProxyNoRemoteServiceProxy.

public void testGetProxyNoRemoteServiceProxy() throws Exception {
    final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters();
    Properties props = new Properties();
    props.put(Constants.SERVICE_PREVENT_RSPROXY, "true");
    final IRemoteService service = registerAndGetRemoteService(adapters[0], adapters[1], getClient(0).getConnectedID(), getIDFilter(), IConcatService.class.getName(), customizeProperties(props), SLEEPTIME);
    assertNotNull(service);
    Object proxy = service.getProxy();
    assertTrue(!(proxy instanceof IRemoteServiceProxy));
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteServiceContainerAdapter(org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter) IRemoteServiceProxy(org.eclipse.ecf.remoteservice.IRemoteServiceProxy) Properties(java.util.Properties) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 39 with IRemoteService

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

the class AbstractRemoteServiceTest method testCallSynch.

public void testCallSynch() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    if (service == null)
        return;
    traceCallStart("callSynch");
    final Object result = service.callSync(createRemoteConcat("Eclipse ", "is cool"));
    traceCallEnd("callSynch", result);
    assertNotNull(result);
    assertTrue(result.equals("Eclipse ".concat("is cool")));
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 40 with IRemoteService

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

the class AbstractRemoteServiceTest method testFireAsynch.

public void testFireAsynch() throws Exception {
    final IRemoteService service = registerAndGetRemoteService();
    if (service == null)
        return;
    traceCallStart("fireAsynch");
    service.fireAsync(createRemoteConcat("Eclipse ", "sucks"));
    traceCallEnd("fireAsynch");
    Thread.sleep(SLEEPTIME);
}
Also used : IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Aggregations

IRemoteService (org.eclipse.ecf.remoteservice.IRemoteService)64 ServiceReference (org.osgi.framework.ServiceReference)11 IFuture (org.eclipse.equinox.concurrent.future.IFuture)10 ECFException (org.eclipse.ecf.core.util.ECFException)9 IRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter)9 IRemoteServiceReference (org.eclipse.ecf.remoteservice.IRemoteServiceReference)8 IRemoteCallListener (org.eclipse.ecf.remoteservice.IRemoteCallListener)6 IRemoteCallCompleteEvent (org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent)6 IRemoteCallEvent (org.eclipse.ecf.remoteservice.events.IRemoteCallEvent)6 IConcatService (org.eclipse.ecf.tests.remoteservice.IConcatService)6 Dictionary (java.util.Dictionary)5 IRemoteServiceProxy (org.eclipse.ecf.remoteservice.IRemoteServiceProxy)5 JSONObject (org.json.JSONObject)5 Hashtable (java.util.Hashtable)4 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)4 RemoteServiceTracker (org.eclipse.ecf.remoteservice.util.tracker.RemoteServiceTracker)4 IRemoteServiceRegistration (org.eclipse.ecf.remoteservice.IRemoteServiceRegistration)3 ExecutionException (java.util.concurrent.ExecutionException)2 ExecutionException (org.eclipse.core.commands.ExecutionException)2 IContainerManager (org.eclipse.ecf.core.IContainerManager)2