Package org.bladerunnerjs.utility

Examples of org.bladerunnerjs.utility.ObserverList


  public void notifiesObserversListeningForEventsWhenNodeDeployedEventEmitted()
  {
    Class<? extends Event> listenForEvent = Event.class;
    Event theEvent = new NodeReadyEvent();

    ObserverList observers = new ObserverList();
    Node node = mock(Node.class);       
    EventObserver eventObserver = mock(EventObserver.class);
    observers.add(listenForEvent, eventObserver);
   
    observers.eventEmitted( theEvent, node);
   
    verify(eventObserver).onEventEmitted(theEvent, node);
  }
View Full Code Here


  public void notifiesObserversListeningForAppDeployedEventsWhenAppDeployedEventEmitted()
  {
    Class<? extends Event> listenForEvent = AppDeployedEvent.class;
    Event theEvent = new AppDeployedEvent();

    ObserverList observers = new ObserverList();
    Node node = mock(Node.class);       
    EventObserver eventObserver = mock(EventObserver.class);
    observers.add(listenForEvent, eventObserver);
   
    observers.eventEmitted( theEvent, node);
   
    verify(eventObserver).onEventEmitted(theEvent, node);
  }
View Full Code Here

  public void doesntNotifyObserversListeningforNodeDeployedWhenNodeReadyEmitted()
  {
    Class<? extends Event> listenForEvent = AppDeployedEvent.class;
    Event theEvent = new NodeReadyEvent();
   
    ObserverList observers = new ObserverList();
    Node node = mock(Node.class);       
    EventObserver eventObserver = mock(EventObserver.class);
    observers.add(listenForEvent, eventObserver);
   
    observers.eventEmitted( theEvent, node);
   
    verifyNoMoreInteractions(eventObserver);
  }
View Full Code Here

  public void doesntNotifyObserversListeningforNodeDeployedWhenEventEmitted()
  {
    Class<? extends Event> listenForEvent = AppDeployedEvent.class;
    Event theEvent = new Event(){};
   
    ObserverList observers = new ObserverList();
    Node node = mock(Node.class);       
    EventObserver eventObserver = mock(EventObserver.class);
    observers.add(listenForEvent, eventObserver);
   
    observers.eventEmitted( theEvent, node);
   
    verifyNoMoreInteractions(eventObserver);
  }
View Full Code Here

    if (node == null)
    {
      return;
    }
   
    ObserverList observers = node.getObservers();
    if (observers != null) { observers.eventEmitted(event, notifyForNode); }
    notifyObservers(event, notifyForNode, node.parentNode());
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.utility.ObserverList

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.