import org.junit.Assert;\r
import org.junit.Test;\r
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueueProperty;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueuePropertyBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;\r
* Testing of {@link QueueGetConfigReplyMessageFactory} for correct\r
* translation into POJO\r
*/\r
- //@Test\r
- // TODO - fix test\r
+ @Test\r
public void test() {\r
ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 " + // port\r
"00 00 00 00 " + // padding\r
"00 00 00 01 " + // queueId\r
"00 00 00 01 " + // port\r
- "00 00 00 00 00 00 00 00 " + // pad\r
- "00 01 " + // property\r
+ "00 20 " + // length\r
+ "00 00 00 00 00 00 " + // pad\r
+ "00 02 " + // property\r
+ "00 10 " + // length\r
+ "00 00 00 00 " + // pad\r
+ "00 05 " + // rate\r
"00 00 00 00 00 00 " + // pad\r
"00 00 00 02 " + // queueId\r
"00 00 00 02 " + // port\r
- "00 00 00 00 00 00 00 00 " + // pad\r
- "00 01 " + // property\r
+ "00 20 " + // length\r
"00 00 00 00 00 00 " + // pad\r
- "00 00 00 03 " + // queueId\r
- "00 00 00 03 " + // port\r
- "00 00 00 00 00 00 00 00 " + // pad\r
- "00 01 " + // property\r
- "00 00 00 00 00 00" // pad\r
+ "00 02 " + // property\r
+ "00 10 " + // length\r
+ "00 00 00 00 " + // pad\r
+ "00 05 " + // rate\r
+ "00 00 00 00 00 00 " // pad\r
);\r
\r
GetQueueConfigOutput builtByFactory = BufferHelper.decodeV13(\r
\r
BufferHelper.checkHeaderV13(builtByFactory);\r
Assert.assertEquals("Wrong port", 66051L, builtByFactory.getPort().getValue().longValue());\r
- Assert.assertEquals("Wrong queues", builtByFactory.getQueues(),\r
- createQueuesList());\r
+ Assert.assertEquals("Wrong queues", createQueuesList(), builtByFactory.getQueues());\r
}\r
\r
private static List<Queues> createQueuesList() {\r
List<Queues> queuesList = new ArrayList<>();\r
- QueuesBuilder qb = new QueuesBuilder();\r
- for (int i = 1; i <= 3; i++) {\r
+ for (int i = 1; i < 3; i++) {\r
+ QueuesBuilder qb = new QueuesBuilder();\r
qb.setQueueId(new QueueId((long) i));\r
qb.setPort(new PortNumber((long) i));\r
qb.setQueueProperty(createPropertiesList());\r
private static List<QueueProperty> createPropertiesList() {\r
List<QueueProperty> propertiesList = new ArrayList<>();\r
QueuePropertyBuilder pb = new QueuePropertyBuilder();\r
- pb.setProperty(QueueProperties.forValue(1));\r
+ pb.setProperty(QueueProperties.forValue(2));\r
+ RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();\r
+ rateBuilder.setRate(5);\r
+ pb.addAugmentation(RateQueueProperty.class, rateBuilder.build());\r
propertiesList.add(pb.build());\r
return propertiesList;\r
}\r