use of org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput in project openflowplugin by opendaylight.
the class SetConfigMessageFactoryTest method testSetConfigMessageV13.
/**
* Testing of {@link SetConfigMessageFactory} for correct translation from POJO.
*/
@Test
public void testSetConfigMessageV13() throws Exception {
SetConfigInputBuilder builder = new SetConfigInputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
SwitchConfigFlag flag = SwitchConfigFlag.FRAGNORMAL;
builder.setFlags(flag);
builder.setMissSendLen(10);
SetConfigInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
setConfigFactory.serialize(message, out);
BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH);
Assert.assertEquals("Wrong flags", SwitchConfigFlag.FRAGNORMAL.getIntValue(), out.readUnsignedShort());
Assert.assertEquals("Wrong missSendLen", 10, out.readUnsignedShort());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput in project openflowplugin by opendaylight.
the class NodeConfigServiceImplTest method testBuildRequest.
@Test
public void testBuildRequest() throws Exception {
nodeConfigService = new NodeConfigServiceImpl(mockedRequestContextStack, mockedDeviceContext);
final OfHeader request = nodeConfigService.buildRequest(new Xid(DUMMY_XID_VALUE), dummyConfigInput());
assertTrue(request instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput);
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput setConfigInput = (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput) request;
assertEquals(DUMMY_FLAG, setConfigInput.getFlags());
assertEquals(DUMMY_MISS_SEARCH_LENGTH, setConfigInput.getMissSendLen());
assertEquals(DUMMY_XID_VALUE, setConfigInput.getXid());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput in project openflowplugin by opendaylight.
the class NodeConfigServiceImplTest method dummyConfigInput.
private SetConfigInput dummyConfigInput() {
SetConfigInputBuilder setConfigInputBuilder = new SetConfigInputBuilder();
setConfigInputBuilder.setFlag(DUMMY_FLAG_STR);
setConfigInputBuilder.setMissSearchLength(DUMMY_MISS_SEARCH_LENGTH);
return setConfigInputBuilder.build();
}
Aggregations