use of org.onosproject.net.intent.IntentEvent in project onos by opennetworkinglab.
the class IntentCleanupTestMock method corruptEventThreshold.
/**
* Intent should not be retried because threshold is reached.
*/
@Test
public void corruptEventThreshold() {
IntentStoreDelegate mockDelegate = new IntentStoreDelegate() {
@Override
public void process(IntentData intentData) {
intentData.setState(CORRUPT);
intentData.setErrorCount(cleanup.retryThreshold);
store.write(intentData);
}
@Override
public void notify(IntentEvent event) {
cleanup.event(event);
}
};
store.setDelegate(mockDelegate);
Intent intent = new MockIntent(1L);
IntentData data = new IntentData(intent, INSTALL_REQ, null);
replay(service);
store.addPending(data);
verify(service);
reset(service);
}
use of org.onosproject.net.intent.IntentEvent in project onos by opennetworkinglab.
the class IntentEventsListCommand method doExecute.
@Override
protected void doExecute() {
IntentMetricsService service = get(IntentMetricsService.class);
if (outputJson()) {
print("%s", json(service.getEvents()));
} else {
for (IntentEvent event : service.getEvents()) {
print(FORMAT_EVENT, event);
// Extra empty line for clarity
print("");
}
}
}
Aggregations