Examples of IRemoteService


Examples of org.eclipse.ecf.remoteservice.IRemoteService

      fail("Could not contact the service");
    }
  }

  public void testAsyncCall() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    IFuture future = restClientService.callAsync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses"));
    try {
      Object response = future.get();
      assertTrue(response instanceof IUserStatus[]);
    } catch (OperationCanceledException e) {
      fail(e.getMessage());
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      fail(e.getMessage());
    }
  }

  public void testAsyncCallWithListener() throws Exception {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    restClientService.callAsync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses"), new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
          Object response = cce.getResponse();
          assertTrue(response instanceof IUserStatus[]);
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

    });
    syncWaitForNotify(10000);
  }

  public void testProxyCall() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    try {
      IUserTimeline userTimeline = (IUserTimeline) restClientService.getProxy();
      IUserStatus[] statuses = userTimeline.getUserStatuses();
      assertNotNull(statuses);
    } catch (ECFException e) {
      fail("Could not contact the service");
    }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

    sleep(3000);

    final RemoteServiceTracker st = new RemoteServiceTracker(adapters[1], null, IConcatService.class.getName(), null);
    assertNotNull(st);
    st.open();
    IRemoteService rs = st.getRemoteService();
    final IConcatService concatService = (IConcatService) rs.getProxy();
    assertNotNull(concatService);
    // test for proxy implementing IRemoteServiceProxy
    if (concatService instanceof IRemoteServiceProxy) {
      IRemoteService remoteService = ((IRemoteServiceProxy) concatService).getRemoteService();
      assertNotNull(remoteService);
      IRemoteServiceReference remoteServiceReference = ((IRemoteServiceProxy) concatService).getRemoteServiceReference();
      assertNotNull(remoteServiceReference);
      System.out.println("remote service reference found from proxy="+remoteServiceReference);
      System.out.println("remoteserviceproxy call start");
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

    server = null;
  }
 
  public void testSimpleClientAndServerWithProxy() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use proxy
    String result = ((IConcatService) remoteService.getProxy()).concat(TEST_STRING_1,TEST_STRING_2);
    assertTrue(result != null && result.equals(TEST_STRING_1+TEST_STRING_2));
   
  }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

      }};
  }
 
  public void testSimpleClientAndServerWithCallSync() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    String result = (String) remoteService.callSync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
    assertTrue(result != null && result.equals(TEST_STRING_2+TEST_STRING_1));
   
  }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

   
  }

  public void testSimpleClientAndServerWithFireAsync() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.fireAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
   
    Thread.sleep(1000);
   
  }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

   
  }

  public void testSimpleClientAndServerWithCallAsync() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
   
    Thread.sleep(1000);
   
  }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

  String result = null;
 
  public void testSimpleClientAndServerWithCallAsyncListener() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1),new IRemoteCallListener(){
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          result = (String) ((IRemoteCallCompleteEvent) event).getResponse();
        }
      }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService

   
  }

  public void testSimpleClientAndServerWithFuture() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    IFuture future = remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
    assertNotNull(future);
    String result = (String) future.get();
    assertTrue(result.equals(TEST_STRING_2+TEST_STRING_1));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.