use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class OFAgentManagerTest method validateEvents.
private void validateEvents(Enum... types) {
int i = 0;
assertEquals("Number of events does 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 WorkFlowEngine method post.
@Override
protected void post(WorkflowDataEvent event) {
if (event.subject() == null || !isRelevant(event.subject())) {
log.debug("ignore event {}", event);
return;
}
// trigger next worklet selection
WorkflowData dataModelContainer = event.subject();
switch(event.type()) {
case INSERT:
case UPDATE:
if (dataModelContainer.triggerNext()) {
log.debug("workflowAccumulator.add: {}", dataModelContainer);
workflowAccumulator.add(dataModelContainer);
} else {
log.debug("pass-workflowAccumulator.add: {}", dataModelContainer);
}
break;
case REMOVE:
break;
default:
}
// trigger EventTask for WorkflowDataEvent
eventMapTriggerExecutor.submit(() -> eventMapTrigger(event, // event hint supplier
(ev) -> {
if (ev == null || ev.subject() == null) {
return null;
}
if (ev.subject() instanceof WorkflowData) {
return ((WorkflowData) ev.subject()).name();
} else {
return null;
}
}));
}
use of org.onosproject.event.Event in project onos by opennetworkinglab.
the class DeviceKeyManagerTest method validateEvents.
/**
* Method to validate that actual versus expected device key events were
* received correctly.
*
* @param types expected device key events.
*/
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 K8sIngressManagerTest 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 K8sNamespaceManagerTest 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();
}
Aggregations