use of org.opendaylight.openflowjava.protocol.impl.clients.OFClient in project openflowplugin by opendaylight.
the class IntegrationTest method testInitiateConnection.
@Test
public void testInitiateConnection() throws Exception {
setUp(TransportProtocol.TCP);
final Deque<ClientEvent> scenario = ScenarioFactory.createHandshakeScenario();
final ScenarioHandler handler = new ScenarioHandler(scenario);
final List<OFClient> clients = createAndStartClient(1, handler, TransportProtocol.TCP, ClientType.LISTENING);
final OFClient ofClient = clients.get(0);
ofClient.getIsOnlineFuture().get(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS);
final int listeningClientPort = ((ListeningSimpleClient) ofClient).getPort();
mockPlugin.initiateConnection(switchConnectionProvider, "localhost", listeningClientPort);
ofClient.getScenarioDone().get();
LOGGER.debug("testInitiateConnection() Finished");
}
use of org.opendaylight.openflowjava.protocol.impl.clients.OFClient in project openflowplugin by opendaylight.
the class IntegrationTest method testHandshake.
/**
* Library integration and communication test with handshake.
*/
@Test
public void testHandshake() throws Exception {
setUp(TransportProtocol.TCP);
final int amountOfCLients = 1;
final Deque<ClientEvent> scenario = ScenarioFactory.createHandshakeScenario();
final ScenarioHandler handler = new ScenarioHandler(scenario);
final List<OFClient> clients = createAndStartClient(amountOfCLients, handler, TransportProtocol.TCP, ClientType.SIMPLE);
final OFClient firstClient = clients.get(0);
firstClient.getScenarioDone().get();
Thread.sleep(1000);
LOGGER.debug("testHandshake() Finished");
}
Aggregations