Search in sources :

Example 1 with OpenFlowSwitchListenerAdapter

use of org.onosproject.openflow.OpenFlowSwitchListenerAdapter in project onos by opennetworkinglab.

the class OpenFlowControllerImplPacketsTest method setUp.

/**
 * Sets up switches to use as data, mocks and launches a controller instance.
 */
@Before
public void setUp() {
    try {
        switch1 = new OpenflowSwitchDriverAdapter();
        dpid1 = Dpid.dpid(new URI("of:0000000000000111"));
    } catch (URISyntaxException ex) {
        // Does not happen
        fail();
    }
    controller = new OpenFlowControllerImpl();
    agent = controller.agent;
    switchListener = new OpenFlowSwitchListenerAdapter();
    controller.addListener(switchListener);
    packetListener = new TestPacketListener();
    controller.addPacketListener(100, packetListener);
    statsExecutorService = new TestExecutorService();
    errorMsgExecutorService = new TestExecutorService();
    controller.executorMsgs = statsExecutorService;
    controller.executorErrorMsgs = errorMsgExecutorService;
}
Also used : OpenFlowSwitchListenerAdapter(org.onosproject.openflow.OpenFlowSwitchListenerAdapter) OpenflowSwitchDriverAdapter(org.onosproject.openflow.OpenflowSwitchDriverAdapter) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) Before(org.junit.Before)

Aggregations

URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 Before (org.junit.Before)1 OpenFlowSwitchListenerAdapter (org.onosproject.openflow.OpenFlowSwitchListenerAdapter)1 OpenflowSwitchDriverAdapter (org.onosproject.openflow.OpenflowSwitchDriverAdapter)1