Search in sources :

Example 6 with EchoInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInputBuilder in project openflowplugin by opendaylight.

the class EchoServiceTest method testBuildRequest.

@Test
public void testBuildRequest() throws Exception {
    EchoInputBuilder sendEchoInput = new EchoInputBuilder().setData(DUMMY_DATA);
    final OfHeader request = this.echoService.buildRequest(new Xid(DUMMY_XID_VALUE), sendEchoInput);
    assertEquals(DUMMY_XID_VALUE, request.getXid());
    assertTrue(request instanceof EchoInput);
    final byte[] data = ((EchoInput) request).getData();
    assertArrayEquals(DUMMY_DATA, data);
    assertEquals(OFConstants.OFP_VERSION_1_3, request.getVersion().shortValue());
}
Also used : Xid(org.opendaylight.openflowplugin.api.openflow.device.Xid) EchoInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInput) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) EchoInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInputBuilder) Test(org.junit.Test)

Aggregations

EchoInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInputBuilder)6 Test (org.junit.Test)5 EchoInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInput)4 ByteBuf (io.netty.buffer.ByteBuf)3 InetSocketAddress (java.net.InetSocketAddress)1 Date (java.util.Date)1 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)1 EchoOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutput)1 FeaturesReply (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply)1 OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)1 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)1