use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput in project openflowplugin by opendaylight.
the class MessageFactoryTest method testCreateHelloInputWoElements.
@Test
public void testCreateHelloInputWoElements() {
short highestVersion = (short) 0x04;
long xid = 42L;
HelloInput helloMsg = MessageFactory.createHelloInput(highestVersion, xid);
Assert.assertEquals(highestVersion, helloMsg.getVersion().shortValue());
Assert.assertEquals(xid, helloMsg.getXid().longValue());
Assert.assertNull(helloMsg.getElements());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput in project openflowplugin by opendaylight.
the class MessageFactoryTest method testCreateHelloInputWithElements.
@Test
public void testCreateHelloInputWithElements() {
short highestVersion = (short) 0x04;
long xid = 42L;
Boolean[] expectedVersionBitmap = new Boolean[] { false, true, false, false, true };
HelloInput helloMsg = MessageFactory.createHelloInput(highestVersion, xid, OFConstants.VERSION_ORDER);
Assert.assertEquals(highestVersion, helloMsg.getVersion().shortValue());
Assert.assertEquals(xid, helloMsg.getXid().longValue());
Assert.assertEquals(1, helloMsg.getElements().size());
Elements actualElement = helloMsg.getElements().get(0);
Assert.assertEquals(HelloElementType.VERSIONBITMAP, actualElement.getType());
Assert.assertArrayEquals(expectedVersionBitmap, actualElement.getVersionBitmap().toArray(new Boolean[0]));
}
Aggregations