use of org.onosproject.net.intent.IntentStoreDelegate in project onos by opennetworkinglab.
the class IntentCleanupTestMock method pendingPoll.
/**
* Trigger resubmit of intent in INSTALL_REQ for too long.
*/
@Test
public void pendingPoll() {
IntentStoreDelegate mockDelegate = new IntentStoreDelegate() {
@Override
public void process(IntentData intentData) {
}
@Override
public void notify(IntentEvent event) {
cleanup.event(event);
}
};
store.setDelegate(mockDelegate);
Intent intent = new MockIntent(1L);
Timestamp version = new SystemClockTimestamp(1L);
IntentData data = new IntentData(intent, INSTALL_REQ, version);
store.addPending(data);
service.addPending(isA(IntentData.class));
expectLastCall().once();
replay(service);
cleanup.run();
verify(service);
reset(service);
}
use of org.onosproject.net.intent.IntentStoreDelegate 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);
}
Aggregations