Package org.eclipse.ecf.remoteservice

Examples of org.eclipse.ecf.remoteservice.IRemoteService.callAsync()


    }
  }

  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


    }
  }

  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

  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

  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

  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

  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

  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

  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

  public void testCallAsynch() throws Exception {
    final IRemoteService service = getRemoteService(targetID,
        getRemoteServiceClass().getName(), getRemoteServiceFilter());
    assertNotNull(service);
    traceCallStart("callAsynch");
    service.callAsync(createRemoteConcat("ECF ", "is cool"),
        createRemoteCallListener());
    traceCallEnd("callAsynch");
    Thread.sleep(ASYNC_WAITTIME);
  }
View Full Code Here

  public void testAsyncResult() throws Exception {
    final IRemoteService service = getRemoteService(targetID,
        getRemoteServiceClass().getName(), getRemoteServiceFilter());
    assertNotNull(service);
    traceCallStart("callAsynchResult");
    final IFuture result = service.callAsync(createRemoteConcat(
        "ECF AsynchResults ", "are cool"));
    Thread.sleep(ASYNC_WAITTIME);
    traceCallEnd("callAsynchResult", result);
    assertNotNull(result);
  }
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.