use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class OpenstackNetworkManagerTest method validateEvents.
private void validateEvents(Enum... types) {
int i = 0;
assertEquals("Number of events did not match", types.length, testListener.events.size());
for (Event event : testListener.events) {
assertEquals("Incorrect event received", types[i], event.type());
i++;
}
testListener.events.clear();
}
use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class VirtualNetworkDeviceManagerTest method validateEvents.
/**
* Method to validate that the actual versus expected virtual network events were
* received correctly.
*
* @param types expected virtual network events.
*/
private void validateEvents(Enum... types) {
TestTools.assertAfter(100, () -> {
int i = 0;
assertEquals("wrong events received", types.length, testListener.events.size());
for (Event event : testListener.events) {
assertEquals("incorrect event type", types[i], event.type());
i++;
}
testListener.events.clear();
});
}
use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class VirtualListenerRegistryManager method getRegistry.
public ListenerRegistry getRegistry(NetworkId networkId, Class<? extends Event> eventClass) {
Map<Class<? extends Event>, ListenerRegistry> listenerMapByEvent = listenerMapByNetwork.get(networkId);
if (listenerMapByEvent == null) {
listenerMapByEvent = Maps.newConcurrentMap();
listenerMapByNetwork.putIfAbsent(networkId, listenerMapByEvent);
}
ListenerRegistry listenerRegistry = listenerMapByEvent.get(eventClass);
if (listenerRegistry == null) {
listenerRegistry = new ListenerRegistry();
listenerMapByEvent.putIfAbsent(eventClass, listenerRegistry);
}
return listenerRegistry;
}
use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class DeviceManagerTest method validateEvents.
protected void validateEvents(Enum... types) {
int i = 0;
assertEquals("wrong events received", types.length, listener.events.size());
for (Event event : listener.events) {
assertEquals("incorrect event type", types[i], event.type());
i++;
}
listener.events.clear();
}
use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class LinkManagerTest method validateEvents.
protected void validateEvents(Enum... types) {
int i = 0;
assertEquals("wrong events received", types.length, listener.events.size());
for (Event event : listener.events) {
assertEquals("incorrect event type", types[i], event.type());
i++;
}
listener.events.clear();
}
Aggregations