use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class SingleLayerPortServiceTest method buildRequest.
@Test
public void buildRequest() throws Exception {
final Port input = new PortBuilder().setPortNumber(new PortNumberUni(PORT_ID)).build();
final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
assertEquals(PortMessage.class, ofHeader.getImplementedInterface());
final PortMessage result = PortMessage.class.cast(ofHeader);
assertEquals(PORT_ID, result.getPortNumber().getUint32().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader 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());
}
Aggregations