import org.junit.Test;\r
import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.HelloMessageFactoryTest;\r
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfig;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInputBuilder;\r
TableModInputBuilder builder = new TableModInputBuilder();\r
BufferHelper.setupHeader(builder);\r
builder.setTableId(new TableId(9L));\r
- builder.setConfig(new PortConfig(true, false, true, false));\r
+ builder.setConfig(new TableConfig(true));\r
TableModInput message = builder.build();\r
\r
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();\r
factory.messageToBuffer(HelloMessageFactoryTest.VERSION_YET_SUPPORTED, out, message);\r
\r
BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, 16);\r
- Assert.assertEquals("Wrong TableID", message.getTableId().getValue().intValue(), out.readByte());\r
+ Assert.assertEquals("Wrong TableID", message.getTableId().getValue().intValue(), out.readUnsignedByte());\r
out.skipBytes(PADDING_IN_TABLE_MOD_MESSAGE);\r
- Assert.assertEquals("Wrong PortConfig", message.getConfig(), createPortConfig(out.readInt()));\r
+ Assert.assertEquals("Wrong TableConfig", 8, out.readUnsignedInt());\r
}\r
\r
- private static PortConfig createPortConfig(long input){\r
- final Boolean _portDown = ((input) & (1<<0)) > 0;\r
- final Boolean _noRecv = ((input) & (1<<2)) > 0;\r
- final Boolean _noFwd = ((input) & (1<<5)) > 0;\r
- final Boolean _noPacketIn = ((input) & (1<<6)) > 0;\r
- return new PortConfig(_noFwd, _noPacketIn, _noRecv, _portDown);\r
- }\r
}\r