use of org.onosproject.net.DefaultPort in project trellis-control by opennetworkinglab.
the class RoutingRulePopulatorTest method testNoMoreEnabledPortCase3.
// Disable port 1 and 3
@Test
public void testNoMoreEnabledPortCase3() throws Exception {
Port port1 = new DefaultPort(dev1, p1, false);
Port port2 = new DefaultPort(dev1, p2, true);
Port port3 = new DefaultPort(dev1, p3, false);
Port port4 = new DefaultPort(dev1, p4, true);
Port port5 = new DefaultPort(dev1, p5, true);
List<Port> ports = Lists.newArrayList(port1, port2, port3, port4, port5);
expect(deviceService.getPorts(anyObject(DeviceId.class))).andReturn(ports).anyTimes();
replay(deviceService);
assertFalse(rrp.noMoreEnabledPort(devId1, v10));
assertTrue(rrp.noMoreEnabledPort(devId1, v20));
assertFalse(rrp.noMoreEnabledPort(devId1, vInt));
}
use of org.onosproject.net.DefaultPort in project trellis-control by opennetworkinglab.
the class RoutingRulePopulatorTest method testNoMoreEnabledPortCase2.
// Disable port 1
@Test
public void testNoMoreEnabledPortCase2() throws Exception {
Port port1 = new DefaultPort(dev1, p1, false);
Port port2 = new DefaultPort(dev1, p2, true);
Port port3 = new DefaultPort(dev1, p3, true);
Port port4 = new DefaultPort(dev1, p4, true);
Port port5 = new DefaultPort(dev1, p5, true);
List<Port> ports = Lists.newArrayList(port1, port2, port3, port4, port5);
expect(deviceService.getPorts(anyObject(DeviceId.class))).andReturn(ports).anyTimes();
replay(deviceService);
assertFalse(rrp.noMoreEnabledPort(devId1, v10));
assertFalse(rrp.noMoreEnabledPort(devId1, v20));
assertFalse(rrp.noMoreEnabledPort(devId1, vInt));
}
use of org.onosproject.net.DefaultPort in project trellis-control by opennetworkinglab.
the class RoutingRulePopulatorTest method testNoMoreEnabledPortCase5.
// Disable port 1 to 4
@Test
public void testNoMoreEnabledPortCase5() throws Exception {
Port port1 = new DefaultPort(dev1, p1, false);
Port port2 = new DefaultPort(dev1, p2, false);
Port port3 = new DefaultPort(dev1, p3, false);
Port port4 = new DefaultPort(dev1, p4, false);
Port port5 = new DefaultPort(dev1, p5, true);
List<Port> ports = Lists.newArrayList(port1, port2, port3, port4, port5);
expect(deviceService.getPorts(anyObject(DeviceId.class))).andReturn(ports).anyTimes();
replay(deviceService);
assertTrue(rrp.noMoreEnabledPort(devId1, v10));
assertTrue(rrp.noMoreEnabledPort(devId1, v20));
assertFalse(rrp.noMoreEnabledPort(devId1, vInt));
}
Aggregations