Search in sources :

Example 6 with SetConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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());
}
Also used : SetConfigInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput) SwitchConfigFlag(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag) SetConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInputBuilder) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 7 with SetConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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());
}
Also used : Xid(org.opendaylight.openflowplugin.api.openflow.device.Xid) SetConfigInput(org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) Test(org.junit.Test)

Example 8 with SetConfigInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.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();
}
Also used : SetConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInputBuilder)

Aggregations

Test (org.junit.Test)5 SetConfigInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInputBuilder)4 ByteBuf (io.netty.buffer.ByteBuf)3 SwitchConfigFlag (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag)3 SetConfigInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput)3 SetConfigInput (org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput)2 DefaultDeserializerFactoryTest (org.opendaylight.openflowjava.protocol.impl.util.DefaultDeserializerFactoryTest)1 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)1 SetConfigInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInputBuilder)1 OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)1