Package org.eclipse.ecf.provider.discovery

Examples of org.eclipse.ecf.provider.discovery.CompositeServiceContainerEvent


    assertNotNull("Test listener didn't receive any discovery events.", events);
    assertEquals("Test listener received unexpected amount of discovery events: \n\t" + Arrays.asList(events), eventsToExpect, events.length);
   
    final List origContainers = new ArrayList();
    for (int i = 0; i < events.length; i++) {
      final CompositeServiceContainerEvent event = (CompositeServiceContainerEvent) events[i];

      // check if the local container is hidden correctly
      final ID localContainerId = event.getLocalContainerID();
      final ID connectedId = container.getConnectedID();
      assertEquals(localContainerId, connectedId);
     
      // check the IServiceInfo for correct fields/properties
      final IServiceInfo serviceInfo2 = ((IServiceEvent) event).getServiceInfo();
      assertTrue("IServiceInfo should match, expected:\n\t" + serviceInfo + " but was \n\t" + serviceInfo2, comparator.compare(serviceInfo2, serviceInfo) == 0);
     
      // add the underlying discovery container the the result set
      origContainers.add(event.getOriginalLocalContainerID());
    }
    // check that all underlying containers fired an event
    assertEquals("A nested container didn't send an event, but another multiple.", eventsToExpect, origContainers.size());
  }
View Full Code Here


  protected Collection getContainerIds(IContainerEvent[] events) {
    final Collection originalIds = new ArrayList();
    for (int i = 0; i < events.length; i++) {
      final IContainerEvent iContainerEvent = events[i];
      if (iContainerEvent instanceof CompositeServiceContainerEvent) {
        final CompositeServiceContainerEvent csce = (CompositeServiceContainerEvent) iContainerEvent;
        originalIds.add(csce.getOriginalLocalContainerID());
      } else {
        System.err.println("WARNING: Skipping non CompositeServiceContainerEvent in CompositeDiscoveryServiceContainerTest#getContainerIds(IContainerEvent[])");
        //originalIds.add(iContainerEvent.getLocalContainerID());
      }
    }
View Full Code Here

    assertNotNull("Test listener didn't receive any discovery events.", events);
    assertEquals("Test listener received unexpected amount of discovery events: \n\t" + Arrays.asList(events), eventsToExpect, events.length);
   
    final List origContainers = new ArrayList();
    for (int i = 0; i < events.length; i++) {
      final CompositeServiceContainerEvent event = (CompositeServiceContainerEvent) events[i];

      // check if the local container is hidden correctly
      final ID localContainerId = event.getLocalContainerID();
      final ID connectedId = container.getConnectedID();
      assertEquals(localContainerId, connectedId);
     
      // check the IServiceInfo for correct fields/properties
      final IServiceInfo serviceInfo2 = ((IServiceEvent) event).getServiceInfo();
      assertTrue("IServiceInfo should match, expected:\n\t" + serviceInfo + " but was \n\t" + serviceInfo2, comparator.compare(serviceInfo2, serviceInfo) == 0);
     
      // add the underlying discovery container the the result set
      origContainers.add(event.getOriginalLocalContainerID());
    }
    // check that all underlying containers fired an event
    assertEquals("A nested container didn't send an event, but another multiple.", eventsToExpect, origContainers.size());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.provider.discovery.CompositeServiceContainerEvent

Copyright © 2018 www.massapicom. 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.