Examples of IServiceInfo


Examples of org.eclipse.ecf.discovery.IServiceInfo

    addListenerRegisterAndWait(serviceListener, serviceInfo);
    discoveryLocator.removeServiceListener(serviceListener);
    IContainerEvent[] event = serviceListener.getEvent();
    assertNotNull("Test listener didn't receive any discovery event", event);
    assertEquals("Test listener received unexpected amount of discovery events: \n\t" + Arrays.asList(event), eventsToExpect, event.length);
    IServiceInfo serviceInfo2 = ((IServiceEvent) event[eventsToExpect - 1]).getServiceInfo();
    assertTrue("IServiceInfo should match, expected:\n\t" + serviceInfo + " but was \n\t" + serviceInfo2, comparator.compare(serviceInfo2, serviceInfo) == 0);
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

   * {@link org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#getServiceInfo(org.eclipse.ecf.discovery.identity.IServiceID)}.
   * @throws ContainerConnectException
   */
  public void testGetServiceInfo() throws ContainerConnectException {
    registerService();
    final IServiceInfo info = discoveryLocator.getServiceInfo(serviceInfo.getServiceID());
    assertTrue("IServiceInfo should match, expected:\n\t" + serviceInfo + " but:\n\t" + info, comparator.compare(info, serviceInfo) == 0);
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

  public void testGetServices() throws ContainerConnectException {
    registerService();
    final IServiceInfo[] services = discoveryLocator.getServices();
    assertTrue("IServiceInfo[] is empty", services.length >= 1);
    for (int i = 0; i < services.length; i++) {
      IServiceInfo iServiceInfo = services[i];
      if(comparator.compare(iServiceInfo, serviceInfo) == 0) {
        return;
      }
    }
    fail("Self registered service not found");
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

   * {@link org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#getServices(org.eclipse.ecf.discovery.identity.IServiceTypeID)}.
   * @throws ContainerConnectException
   */
  public void testGetServicesIServiceTypeID() throws ContainerConnectException {
    registerService();
    final IServiceInfo serviceInfos[] = discoveryLocator.getServices(serviceInfo.getServiceID().getServiceTypeID());
    assertTrue("IServiceInfo[] is empty", serviceInfos.length >= 1);
    for (int i = 0; i < serviceInfos.length; i++) {
      IServiceInfo iServiceInfo = serviceInfos[i];
      if(comparator.compare(iServiceInfo, serviceInfo) == 0) {
        return;
      }
    }
    fail("Self registered service not found");
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

  public void testRegisterService() throws ContainerConnectException {
    registerService();
    final IServiceInfo[] services = discoveryLocator.getServices();
    assertTrue("IServiceInfo[] is empty", services.length >= 1);
    for (int i = 0; i < services.length; i++) {
      final IServiceInfo service = services[i];
      if (comparator.compare(service, serviceInfo) == 0) {
        return;
      }
    }
    fail("Self registered service not found");
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

  public void testUnregisterService() throws ContainerConnectException {
    testRegisterService();
    unregisterService();
    final IServiceInfo[] services = discoveryLocator.getServices();
    for (int i = 0; i < services.length; i++) {
      final IServiceInfo service = services[i];
      if (comparator.compare(service, serviceInfo) == 0) {
        fail("Expected service to be not registered anymore");
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

    discoveryLocator.removeServiceListener(serviceInfo.getServiceID().getServiceTypeID(), tsl);
   
    IContainerEvent[] event = tsl.getEvent();
    assertNotNull("Test listener didn't receive discovery", event);
    assertEquals("Test listener received unexpected amount of discovery events: \n\t" + Arrays.asList(event), eventsToExpect, event.length);
    IServiceInfo serviceInfo2 = ((IServiceEvent) event[eventsToExpect - 1]).getServiceInfo();
    assertTrue("IServiceInfo should match, expected:\n\t" + serviceInfo + " but:\n\t" + serviceInfo2, comparator.compare(serviceInfo2, serviceInfo) == 0);
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

  public void testGetAsyncServiceInfo() throws OperationCanceledException, InterruptedException, ContainerConnectException {
    registerService();
    final IFuture aFuture = discoveryLocator.getAsyncServiceInfo(serviceInfo.getServiceID());
    final Object object = aFuture.get();
    assertTrue(object instanceof IServiceInfo);
    final IServiceInfo info = (IServiceInfo) object;
    assertTrue("IServiceInfo should match, expected:\n\t" + serviceInfo + " but:\n\t" + info, comparator.compare(info, serviceInfo) == 0);
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

    final Object object = aFuture.get();
    assertTrue(object instanceof IServiceInfo[]);
    final IServiceInfo[] services = (IServiceInfo[]) object;
    assertTrue("Found: " + services.length + Arrays.asList(services), services.length == eventsToExpect);
    for (int i = 0; i < services.length; i++) {
      IServiceInfo iServiceInfo = services[i];
      if(comparator.compare(iServiceInfo, serviceInfo) == 0) {
        return;
      }
    }
    fail("Self registered service not found");
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceInfo

    final Object object = aFuture.get();
    assertTrue(object instanceof IServiceInfo[]);
    final IServiceInfo[] services = (IServiceInfo[]) object;
    assertTrue("Found: " + services.length + Arrays.asList(services), services.length == eventsToExpect);
    for (int i = 0; i < services.length; i++) {
      IServiceInfo iServiceInfo = services[i];
      if(comparator.compare(iServiceInfo, serviceInfo) == 0) {
        return;
      }
    }
    fail("Self registered service not found");
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.