Search in sources :

Example 1 with PacketProcessor

use of org.onosproject.net.packet.PacketProcessor in project onos by opennetworkinglab.

the class VirtualNetworkPacketManagerTest method removeProcessorTest.

/**
 * Tests the correct usage of addProcessor() for a outbound packet.
 */
@Test
public void removeProcessorTest() {
    PacketProcessor testProcessor = new TestProcessor();
    packetManager1.addProcessor(testProcessor, PROCESSOR_PRIORITY);
    assertEquals("1 processor expected", 1, packetManager1.getProcessors().size());
    assertEquals("0 processor expected", 0, packetManager2.getProcessors().size());
    packetManager1.removeProcessor(testProcessor);
    assertEquals("0 processor expected", 0, packetManager1.getProcessors().size());
    assertEquals("0 processor expected", 0, packetManager2.getProcessors().size());
}
Also used : PacketProcessor(org.onosproject.net.packet.PacketProcessor) Test(org.junit.Test)

Example 2 with PacketProcessor

use of org.onosproject.net.packet.PacketProcessor in project onos by opennetworkinglab.

the class VirtualNetworkPacketManagerTest method addProcessorTest.

/**
 * Tests the correct usage of addProcessor() for a outbound packet.
 */
@Test
public void addProcessorTest() {
    PacketProcessor testProcessor = new TestProcessor();
    packetManager1.addProcessor(testProcessor, PROCESSOR_PRIORITY);
    assertEquals("1 processor expected", 1, packetManager1.getProcessors().size());
    assertEquals("0 processor expected", 0, packetManager2.getProcessors().size());
    assertEquals("not equal packet processor", testProcessor, packetManager1.getProcessors().get(0).processor());
    assertEquals("not equal packet processor priority", PROCESSOR_PRIORITY, packetManager1.getProcessors().get(0).priority());
}
Also used : PacketProcessor(org.onosproject.net.packet.PacketProcessor) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 PacketProcessor (org.onosproject.net.packet.PacketProcessor)2