use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class TopologyEventsListCommand method doExecute.
@Override
protected void doExecute() {
TopologyMetricsService service = get(TopologyMetricsService.class);
if (outputJson()) {
print("%s", json(service.getEvents()));
} else {
for (Event event : service.getEvents()) {
print(FORMAT_EVENT, event);
if (event instanceof TopologyEvent) {
TopologyEvent topologyEvent = (TopologyEvent) event;
for (Event reason : topologyEvent.reasons()) {
print(FORMAT_REASON, reason);
}
}
// Extra empty line for clarity
print("");
}
}
}
use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class HostManagerTest method validateEvents.
private void validateEvents(Enum... types) {
TestTools.assertAfter(100, () -> {
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 KubevirtApiConfigManagerTest 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 OpenstackSecurityGroupManagerTest method validateEvents.
private void validateEvents(Enum... types) {
int i = 0;
assertEquals("Number of events did not match", types.length, testOpenstackSecurityGroupListener.events.size());
for (Event event : testOpenstackSecurityGroupListener.events) {
assertEquals("Incorrect event received", types[i], event.type());
i++;
}
testOpenstackSecurityGroupListener.events.clear();
}
use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class InstancePortManagerTest method validateEvents.
private void validateEvents(Enum... types) {
int i = 0;
assertEquals("Number of events did not match", types.length, testInstancePortListener.events.size());
for (Event event : testInstancePortListener.events) {
assertEquals("Incorrect event received", types[i], event.type());
i++;
}
testInstancePortListener.events.clear();
}
Aggregations