+ "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "\r
+ "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "\r
+ "00 00 00 02 00 00 00 03 00 04 00 05 00 06 00 00 00 00 00 00 "\r
- + "00 01 02 03 04 05 06 07 00 01 02 03 04 05 06 07 00 00 00 00 00 00 00 20 "\r
+ + "FF 01 02 03 04 05 06 07 FF 01 02 03 04 05 06 07 FF 00 00 00 00 00 00 20 "\r
+ "00 00 00 08 00 01 00 02 00 01 00 08 00 03 00 00");\r
\r
MultipartReplyMessage builtByFactory = \r
Assert.assertEquals("Wrong idleTimeOut", 5, message.getFlowStats().get(0).getIdleTimeout().intValue());\r
Assert.assertEquals("Wrong hardTimeOut", 6, message.getFlowStats().get(0).getHardTimeout().intValue());\r
Assert.assertEquals("Wrong cookie",\r
- new BigInteger(new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), \r
message.getFlowStats().get(0).getCookie());\r
Assert.assertEquals("Wrong packetCount",\r
- new BigInteger(new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), \r
message.getFlowStats().get(0).getPacketCount());\r
Assert.assertEquals("Wrong byteCount",\r
- new BigInteger(new byte[]{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), \r
message.getFlowStats().get(0).getByteCount());\r
Action action1 = message.getFlowStats().get(0).getActionsList().get(0).getAction();\r
Assert.assertEquals("Wrong action type", Output.class, action1.getType());\r
@Test\r
public void testAggregate() {\r
ByteBuf bb = BufferHelper.buildBuffer("00 02 00 01 "\r
- + "00 01 02 03 04 05 06 07 00 00 00 00 00 00 00 20 00 00 00 30 00 00 00 00");\r
+ + "FF 01 02 03 04 05 06 07 FF 00 00 00 00 00 00 20 00 00 00 30 00 00 00 00");\r
\r
MultipartReplyMessage builtByFactory = \r
BufferHelper.decodeV10(OF10StatsReplyMessageFactory.getInstance(), bb);\r
MultipartReplyAggregateCase messageCase = (MultipartReplyAggregateCase) builtByFactory.getMultipartReplyBody();\r
MultipartReplyAggregate message = messageCase.getMultipartReplyAggregate();\r
Assert.assertEquals("Wrong packet-count",\r
- new BigInteger(new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), \r
message.getPacketCount());\r
Assert.assertEquals("Wrong byte-count",\r
- new BigInteger(new byte[]{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), \r
message.getByteCount());\r
Assert.assertEquals("Wrong flow-count", 48, message.getFlowCount().intValue());\r
Assert.assertTrue("Unread data", bb.readableBytes() == 0);\r
ByteBuf bb = BufferHelper.buildBuffer("00 03 00 01 "\r
+ "08 00 00 00 4A 41 4D 45 53 20 42 4F 4E 44 00 00 00 00 00 00 00 00 00 "\r
+ "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "\r
- + "00 00 00 30 00 00 00 10 00 01 01 01 01 01 01 01 02 01 01 01 01 01 01 00");\r
+ + "00 00 00 30 00 00 00 10 FF 01 01 01 01 01 01 01 FF 01 01 01 01 01 01 00");\r
\r
MultipartReplyMessage builtByFactory = BufferHelper.decodeV10(OF10StatsReplyMessageFactory.getInstance(), bb);\r
\r
Assert.assertEquals("Wrong max-entries", 48, message.getTableStats().get(0).getMaxEntries().longValue());\r
Assert.assertEquals("Wrong activeCount", 16, message.getTableStats().get(0).getActiveCount().longValue());\r
Assert.assertEquals("Wrong lookupCount", \r
- new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), \r
message.getTableStats().get(0).getLookupCount());\r
Assert.assertEquals("Wrong matchedCount", \r
- new BigInteger(new byte[]{0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00}), \r
message.getTableStats().get(0).getMatchedCount());\r
Assert.assertTrue("Unread data", bb.readableBytes() == 0);\r
}\r
public void testPort() {\r
ByteBuf bb = BufferHelper.buildBuffer("00 04 00 01 "\r
+ "00 FF 00 00 00 00 00 00 "\r
- + "00 01 01 01 01 01 01 01 00 02 02 02 02 02 02 02 "\r
- + "00 02 03 02 03 02 03 02 00 02 03 02 03 02 03 02 "\r
- + "00 02 03 02 03 02 03 02 00 02 03 02 03 02 03 02 "\r
- + "00 02 03 02 03 02 03 02 00 02 03 02 03 02 03 02 "\r
- + "00 02 03 02 03 02 03 02 00 02 03 02 03 02 03 02 00 02 03 02 03 02 03 02 "\r
- + "00 02 03 02 03 02 03 02 ");\r
+ + "FF 01 01 01 01 01 01 01 FF 02 02 02 02 02 02 02 "\r
+ + "FF 02 03 02 03 02 03 02 FF 02 03 02 03 02 03 02 "\r
+ + "FF 02 03 02 03 02 03 02 FF 02 03 02 03 02 03 02 "\r
+ + "FF 02 03 02 03 02 03 02 FF 02 03 02 03 02 03 02 "\r
+ + "FF 02 03 02 03 02 03 02 FF 02 03 02 03 02 03 02 FF 02 03 02 03 02 03 02 "\r
+ + "FF 02 03 02 03 02 03 02 ");\r
\r
MultipartReplyMessage builtByFactory = BufferHelper.decodeV10(OF10StatsReplyMessageFactory.getInstance(), bb);\r
\r
MultipartReplyPortStats message = messageCase.getMultipartReplyPortStats();\r
Assert.assertEquals("Wrong portNo", 255, message.getPortStats().get(0).getPortNo().intValue());\r
Assert.assertEquals("Wrong rxPackets", \r
- new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), \r
message.getPortStats().get(0).getRxPackets());\r
Assert.assertEquals("Wrong txPackets", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), \r
message.getPortStats().get(0).getTxPackets());\r
Assert.assertEquals("Wrong rxBytes", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getRxBytes());\r
Assert.assertEquals("Wrong txBytes", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getTxBytes());\r
Assert.assertEquals("Wrong rxDropped", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getRxDropped());\r
Assert.assertEquals("Wrong txDropped", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getTxDropped());\r
Assert.assertEquals("Wrong rxErrors", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getRxErrors());\r
Assert.assertEquals("Wrong txErrors", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getTxErrors());\r
Assert.assertEquals("Wrong rxFrameErr", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getRxFrameErr());\r
Assert.assertEquals("Wrong rxOverErr", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getRxOverErr());\r
Assert.assertEquals("Wrong rxCrcErr", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getRxCrcErr());\r
Assert.assertEquals("Wrong collisions", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getPortStats().get(0).getCollisions());\r
Assert.assertTrue("Unread data", bb.readableBytes() == 0);\r
}\r
public void testQueue() {\r
ByteBuf bb = BufferHelper.buildBuffer("00 05 00 00 "\r
+ "00 FF 00 00 00 00 00 10 "\r
- + "00 02 03 02 03 02 03 02 "\r
- + "00 02 02 02 02 02 02 02 "\r
- + "00 02 03 02 03 02 03 02 ");\r
+ + "FF 02 03 02 03 02 03 02 "\r
+ + "FF 02 02 02 02 02 02 02 "\r
+ + "FF 02 03 02 03 02 03 02 ");\r
\r
MultipartReplyMessage builtByFactory = BufferHelper.decodeV10(OF10StatsReplyMessageFactory.getInstance(), bb);\r
\r
Assert.assertEquals("Wrong portNo", 255, message.getQueueStats().get(0).getPortNo().intValue());\r
Assert.assertEquals("Wrong queueId", 16, message.getQueueStats().get(0).getQueueId().intValue());\r
Assert.assertEquals("Wrong txBytes", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getQueueStats().get(0).getTxBytes());\r
Assert.assertEquals("Wrong txPackets", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), \r
message.getQueueStats().get(0).getTxPackets());\r
Assert.assertEquals("Wrong txErrors", \r
- new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
+ new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), \r
message.getQueueStats().get(0).getTxErrors());\r
Assert.assertTrue("Unread data", bb.readableBytes() == 0);\r
}\r