use of org.onosproject.net.behaviour.inbandtelemetry.IntProgrammable in project onos by opennetworkinglab.
the class TestCodecService method getMockIntProgrammable.
private IntProgrammable getMockIntProgrammable(boolean supportSource, boolean supportTransit, boolean supportSink, boolean supportPostcard) {
IntProgrammable intProg = createNiceMock(IntProgrammable.class);
if (supportSource) {
expect(intProg.supportsFunctionality(SOURCE)).andReturn(true).anyTimes();
}
if (supportTransit) {
expect(intProg.supportsFunctionality(TRANSIT)).andReturn(true).anyTimes();
}
if (supportSink) {
expect(intProg.supportsFunctionality(SINK)).andReturn(true).anyTimes();
}
if (supportPostcard) {
expect(intProg.supportsFunctionality(POSTCARD)).andReturn(true).anyTimes();
}
expect(intProg.init()).andReturn(true).anyTimes();
return intProg;
}
use of org.onosproject.net.behaviour.inbandtelemetry.IntProgrammable in project onos by opennetworkinglab.
the class TestCodecService method testConfigPostcardOnlyDevice.
@Test
public void testConfigPostcardOnlyDevice() {
reset(deviceService, hostService);
Device device = getMockDevice(true, DEVICE_ID);
IntProgrammable intProg = getMockIntProgrammable(false, false, false, true);
setUpDeviceTest(device, intProg, true, true);
IntObjective intObj = IntObjective.builder().withSelector(FLOW_SELECTOR1).build();
expect(intProg.addIntObjective(eq(intObj))).andReturn(true).once();
replay(deviceService, hostService, device, intProg);
installTestIntents();
assertTrue(manager.configDevice(DEVICE_ID));
verify(intProg);
}
Aggregations