public class OutputPortRoundRobinIteratorTest {
@Test
public void t() {
OutputPorts ports = mock(OutputPorts.class);
OutputPort port1 = mock(OutputPort.class);
OutputPort port2 = mock(OutputPort.class);
Packet packet1 = mock(Packet.class);
Packet packet2 = mock(Packet.class);
Packet packet3 = mock(Packet.class);
Packet packet4 = mock(Packet.class);
when(ports.size()).thenReturn(2);
when(ports.port(0)).thenReturn(port1);
when(ports.port(1)).thenReturn(port2);
Iterator<OutputPort> outs = new OutputPortRoundRobinIterator(ports);
Assert.assertTrue(outs.hasNext());
outs.next().send(packet1);
Assert.assertTrue(outs.hasNext());
outs.next().send(packet2);