Merge "Removed System.out.println()"
authorAdam Brcek <adam.brcek@pantheon.sk>
Tue, 14 Jan 2014 07:26:56 +0000 (07:26 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 14 Jan 2014 07:26:56 +0000 (07:26 +0000)
15 files changed:
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FeaturesReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FlowRemovedMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FlowRemovedMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketInMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/RoleReplyMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializer.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsReplyMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartRequestInputFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactoryTest.java
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java

index c9cef55a0cce89594bd8e63ef11ea418ca1964c2..388a6e772c609d0b8616f14c88d1d306241efeec 100644 (file)
@@ -13,6 +13,7 @@ import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Capabilities;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
@@ -47,9 +48,9 @@ public class FeaturesReplyMessageFactory implements OFDeserializer<GetFeaturesOu
         GetFeaturesOutputBuilder builder = new GetFeaturesOutputBuilder();
         builder.setVersion(version);
         builder.setXid(rawMessage.readUnsignedInt());
-        byte[] datapathId = new byte[Long.SIZE/Byte.SIZE];
+        byte[] datapathId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(datapathId);
-        builder.setDatapathId(new BigInteger(datapathId));
+        builder.setDatapathId(new BigInteger(1, datapathId));
         builder.setBuffers(rawMessage.readUnsignedInt());
         builder.setTables(rawMessage.readUnsignedByte());
         builder.setAuxiliaryId(rawMessage.readUnsignedByte());
index 7df6835cd902277a9512f8f7547c54e2cb817fd2..69d71d8d58e954ed7713ad5d4dbd5f29ef9e50c4 100644 (file)
@@ -13,6 +13,7 @@ import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.MatchDeserializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
@@ -47,9 +48,9 @@ public class FlowRemovedMessageFactory implements OFDeserializer<FlowRemovedMess
         FlowRemovedMessageBuilder builder = new FlowRemovedMessageBuilder();
         builder.setVersion(version);
         builder.setXid(rawMessage.readUnsignedInt());
-        byte[] cookie = new byte[Long.SIZE/Byte.SIZE];
+        byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(cookie);
-        builder.setCookie(new BigInteger(cookie));
+        builder.setCookie(new BigInteger(1, cookie));
         builder.setPriority(rawMessage.readUnsignedShort());
         builder.setReason(FlowRemovedReason.forValue(rawMessage.readUnsignedByte()));
         builder.setTableId(new TableId((long)rawMessage.readUnsignedByte()));
@@ -57,12 +58,12 @@ public class FlowRemovedMessageFactory implements OFDeserializer<FlowRemovedMess
         builder.setDurationNsec(rawMessage.readUnsignedInt());
         builder.setIdleTimeout(rawMessage.readUnsignedShort());
         builder.setHardTimeout(rawMessage.readUnsignedShort());
-        byte[] packet_count = new byte[Long.SIZE/Byte.SIZE];
+        byte[] packet_count = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(packet_count);
-        builder.setPacketCount(new BigInteger(packet_count));
-        byte[] byte_count = new byte[Long.SIZE/Byte.SIZE];
+        builder.setPacketCount(new BigInteger(1, packet_count));
+        byte[] byte_count = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(byte_count);
-        builder.setByteCount(new BigInteger(byte_count));
+        builder.setByteCount(new BigInteger(1, byte_count));
         builder.setMatch(MatchDeserializer.createMatch(rawMessage));
         return builder.build();
     }
index 15e9f77cb8e4c3c0f78605115e083049502b8181..628d388d5bd588359296d6f02e2538a8ec3d1e30 100644 (file)
@@ -281,15 +281,15 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             flowStatsBuilder.setHardTimeout(input.readUnsignedShort());
             flowStatsBuilder.setFlags(createFlowModFlagsFromBitmap(input.readShort()));
             input.skipBytes(PADDING_IN_FLOW_STATS_HEADER_02);
-            byte[] cookie = new byte[Long.SIZE/Byte.SIZE];
+            byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(cookie);
-            flowStatsBuilder.setCookie(new BigInteger(cookie));
-            byte[] packetCount = new byte[Long.SIZE/Byte.SIZE];
+            flowStatsBuilder.setCookie(new BigInteger(1, cookie));
+            byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(packetCount);
-            flowStatsBuilder.setPacketCount(new BigInteger(packetCount));
-            byte[] byteCount = new byte[Long.SIZE/Byte.SIZE];
+            flowStatsBuilder.setPacketCount(new BigInteger(1, packetCount));
+            byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(byteCount);
-            flowStatsBuilder.setByteCount(new BigInteger(byteCount));
+            flowStatsBuilder.setByteCount(new BigInteger(1, byteCount));
             flowStatsBuilder.setMatch(MatchDeserializer.createMatch(input));
             flowStatsBuilder.setInstructions(InstructionsDeserializer.createInstructions(input, input.readableBytes()));
             flowStatsList.add(flowStatsBuilder.build());
@@ -311,12 +311,12 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
     private static MultipartReplyAggregateCase setAggregate(ByteBuf input) {
         MultipartReplyAggregateCaseBuilder caseBuilder = new MultipartReplyAggregateCaseBuilder();
         MultipartReplyAggregateBuilder builder = new MultipartReplyAggregateBuilder();
-        byte[] packetCount = new byte[Long.SIZE/Byte.SIZE];
+        byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         input.readBytes(packetCount);
-        builder.setPacketCount(new BigInteger(packetCount));
-        byte[] byteCount = new byte[Long.SIZE/Byte.SIZE];
+        builder.setPacketCount(new BigInteger(1, packetCount));
+        byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         input.readBytes(byteCount);
-        builder.setByteCount(new BigInteger(byteCount));
+        builder.setByteCount(new BigInteger(1, byteCount));
         builder.setFlowCount(input.readUnsignedInt());
         input.skipBytes(PADDING_IN_AGGREGATE_HEADER);
         caseBuilder.setMultipartReplyAggregate(builder.build());
@@ -332,12 +332,12 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             tableStatsBuilder.setTableId(input.readUnsignedByte());
             input.skipBytes(PADDING_IN_TABLE_HEADER);
             tableStatsBuilder.setActiveCount(input.readUnsignedInt());
-            byte[] lookupCount = new byte[Long.SIZE/Byte.SIZE];
+            byte[] lookupCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(lookupCount);
-            tableStatsBuilder.setLookupCount(new BigInteger(lookupCount));
-            byte[] matchedCount = new byte[Long.SIZE/Byte.SIZE];
+            tableStatsBuilder.setLookupCount(new BigInteger(1, lookupCount));
+            byte[] matchedCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(matchedCount);
-            tableStatsBuilder.setMatchedCount(new BigInteger(matchedCount));
+            tableStatsBuilder.setMatchedCount(new BigInteger(1, matchedCount));
             tableStatsList.add(tableStatsBuilder.build());
         }
         builder.setTableStats(tableStatsList);
@@ -444,42 +444,42 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             PortStatsBuilder portStatsBuilder = new PortStatsBuilder();
             portStatsBuilder.setPortNo(input.readUnsignedInt());
             input.skipBytes(PADDING_IN_PORT_STATS_HEADER);
-            byte[] rxPackets = new byte[Long.SIZE/Byte.SIZE];
+            byte[] rxPackets = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxPackets);
-            portStatsBuilder.setRxPackets(new BigInteger(rxPackets));
-            byte[] txPackets = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxPackets(new BigInteger(1, rxPackets));
+            byte[] txPackets = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txPackets);
-            portStatsBuilder.setTxPackets(new BigInteger(txPackets));
-            byte[] rxBytes = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxPackets(new BigInteger(1, txPackets));
+            byte[] rxBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxBytes);
-            portStatsBuilder.setRxBytes(new BigInteger(rxBytes));
-            byte[] txBytes = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxBytes(new BigInteger(1, rxBytes));
+            byte[] txBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txBytes);
-            portStatsBuilder.setTxBytes(new BigInteger(txBytes));
-            byte[] rxDropped = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxBytes(new BigInteger(1, txBytes));
+            byte[] rxDropped = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxDropped);
-            portStatsBuilder.setRxDropped(new BigInteger(rxDropped));
-            byte[] txDropped = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxDropped(new BigInteger(1, rxDropped));
+            byte[] txDropped = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txDropped);
-            portStatsBuilder.setTxDropped(new BigInteger(txDropped));
-            byte[] rxErrors = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxDropped(new BigInteger(1, txDropped));
+            byte[] rxErrors = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxErrors);
-            portStatsBuilder.setRxErrors(new BigInteger(rxErrors));
-            byte[] txErrors = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxErrors(new BigInteger(1, rxErrors));
+            byte[] txErrors = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txErrors);
-            portStatsBuilder.setTxErrors(new BigInteger(txErrors));
-            byte[] rxFrameErr = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxErrors(new BigInteger(1, txErrors));
+            byte[] rxFrameErr = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxFrameErr);
-            portStatsBuilder.setRxFrameErr(new BigInteger(rxFrameErr));
-            byte[] rxOverErr = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxFrameErr(new BigInteger(1, rxFrameErr));
+            byte[] rxOverErr = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxOverErr);
-            portStatsBuilder.setRxOverErr(new BigInteger(rxOverErr));
-            byte[] rxCrcErr = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxOverErr(new BigInteger(1, rxOverErr));
+            byte[] rxCrcErr = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxCrcErr);
-            portStatsBuilder.setRxCrcErr(new BigInteger(rxCrcErr));
-            byte[] collisions = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxCrcErr(new BigInteger(1, rxCrcErr));
+            byte[] collisions = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(collisions);
-            portStatsBuilder.setCollisions(new BigInteger(collisions));
+            portStatsBuilder.setCollisions(new BigInteger(1, collisions));
             portStatsBuilder.setDurationSec(input.readUnsignedInt());
             portStatsBuilder.setDurationNsec(input.readUnsignedInt());
             portStatsList.add(portStatsBuilder.build());
@@ -497,15 +497,15 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             QueueStatsBuilder queueStatsBuilder = new QueueStatsBuilder();
             queueStatsBuilder.setPortNo(input.readUnsignedInt());
             queueStatsBuilder.setQueueId(input.readUnsignedInt());
-            byte[] txBytes = new byte[Long.SIZE/Byte.SIZE];
+            byte[] txBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txBytes);
-            queueStatsBuilder.setTxBytes(new BigInteger(txBytes));
-            byte[] txPackets = new byte[Long.SIZE/Byte.SIZE];
+            queueStatsBuilder.setTxBytes(new BigInteger(1, txBytes));
+            byte[] txPackets = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txPackets);
-            queueStatsBuilder.setTxPackets(new BigInteger(txPackets));
-            byte[] txErrors = new byte[Long.SIZE/Byte.SIZE];
+            queueStatsBuilder.setTxPackets(new BigInteger(1, txPackets));
+            byte[] txErrors = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txErrors);
-            queueStatsBuilder.setTxErrors(new BigInteger(txErrors));
+            queueStatsBuilder.setTxErrors(new BigInteger(1, txErrors));
             queueStatsBuilder.setDurationSec(input.readUnsignedInt());
             queueStatsBuilder.setDurationNsec(input.readUnsignedInt());
             queueStatsList.add(queueStatsBuilder.build());
@@ -526,24 +526,24 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             groupStatsBuilder.setGroupId(new GroupId(input.readUnsignedInt()));
             groupStatsBuilder.setRefCount(input.readUnsignedInt());
             input.skipBytes(PADDING_IN_GROUP_HEADER_02);
-            byte[] packetCount = new byte[Long.SIZE/Byte.SIZE];
+            byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(packetCount);
-            groupStatsBuilder.setPacketCount(new BigInteger(packetCount));
-            byte[] byteCount = new byte[Long.SIZE/Byte.SIZE];
+            groupStatsBuilder.setPacketCount(new BigInteger(1, packetCount));
+            byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(byteCount);
-            groupStatsBuilder.setByteCount(new BigInteger(byteCount));
+            groupStatsBuilder.setByteCount(new BigInteger(1, byteCount));
             groupStatsBuilder.setDurationSec(input.readUnsignedInt());
             groupStatsBuilder.setDurationNsec(input.readUnsignedInt());
             int actualLength = GROUP_BODY_LENGTH;
             List<BucketStats> bucketStatsList = new ArrayList<>();
             while (actualLength < bodyLength) {
                 BucketStatsBuilder bucketStatsBuilder = new BucketStatsBuilder();
-                byte[] packetCountBucket = new byte[Long.SIZE/Byte.SIZE];
+                byte[] packetCountBucket = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
                 input.readBytes(packetCountBucket);
-                bucketStatsBuilder.setPacketCount(new BigInteger(packetCountBucket));
-                byte[] byteCountBucket = new byte[Long.SIZE/Byte.SIZE];
+                bucketStatsBuilder.setPacketCount(new BigInteger(1, packetCountBucket));
+                byte[] byteCountBucket = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
                 input.readBytes(byteCountBucket);
-                bucketStatsBuilder.setByteCount(new BigInteger(byteCountBucket));
+                bucketStatsBuilder.setByteCount(new BigInteger(1, byteCountBucket));
                 bucketStatsList.add(bucketStatsBuilder.build());
                 actualLength += BUCKET_COUNTER_LENGTH;
             } 
@@ -592,24 +592,24 @@ public class MultipartReplyMessageFactory implements OFDeserializer<MultipartRep
             int meterStatsBodyLength = input.readUnsignedShort();
             input.skipBytes(PADDING_IN_METER_STATS_HEADER);
             meterStatsBuilder.setFlowCount(input.readUnsignedInt());
-            byte[] packetInCount = new byte[Long.SIZE/Byte.SIZE];
+            byte[] packetInCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(packetInCount);
-            meterStatsBuilder.setPacketInCount(new BigInteger(packetInCount));
-            byte[] byteInCount = new byte[Long.SIZE/Byte.SIZE];
+            meterStatsBuilder.setPacketInCount(new BigInteger(1, packetInCount));
+            byte[] byteInCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(byteInCount);
-            meterStatsBuilder.setByteInCount(new BigInteger(byteInCount));
+            meterStatsBuilder.setByteInCount(new BigInteger(1, byteInCount));
             meterStatsBuilder.setDurationSec(input.readUnsignedInt());
             meterStatsBuilder.setDurationNsec(input.readUnsignedInt());
             int actualLength = METER_BODY_LENGTH;
             List<MeterBandStats> meterBandStatsList = new ArrayList<>();
             while (actualLength < meterStatsBodyLength) {
                 MeterBandStatsBuilder meterBandStatsBuilder = new MeterBandStatsBuilder();
-                byte[] packetBandCount = new byte[Long.SIZE/Byte.SIZE];
+                byte[] packetBandCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
                 input.readBytes(packetBandCount);
-                meterBandStatsBuilder.setPacketBandCount(new BigInteger(packetBandCount));
-                byte[] byteBandCount = new byte[Long.SIZE/Byte.SIZE];
+                meterBandStatsBuilder.setPacketBandCount(new BigInteger(1, packetBandCount));
+                byte[] byteBandCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
                 input.readBytes(byteBandCount);
-                meterBandStatsBuilder.setByteBandCount(new BigInteger(byteBandCount));
+                meterBandStatsBuilder.setByteBandCount(new BigInteger(1, byteBandCount));
                 meterBandStatsList.add(meterBandStatsBuilder.build());
                 actualLength += METER_BAND_STATS_LENGTH;
             }
index 6c5117830172e00e1ba20053eef0f96e96a715b1..ea859a2d53fe95aff9fd56ec826877ee986d2b4d 100644 (file)
@@ -57,9 +57,9 @@ public class OF10FeaturesReplyMessageFactory implements OFDeserializer<GetFeatur
         GetFeaturesOutputBuilder builder = new GetFeaturesOutputBuilder();
         builder.setVersion(version);
         builder.setXid(rawMessage.readUnsignedInt());
-        byte[] datapathId = new byte[Long.SIZE/Byte.SIZE];
+        byte[] datapathId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(datapathId);
-        builder.setDatapathId(new BigInteger(datapathId));
+        builder.setDatapathId(new BigInteger(1, datapathId));
         builder.setBuffers(rawMessage.readUnsignedInt());
         builder.setTables(rawMessage.readUnsignedByte());
         rawMessage.skipBytes(PADDING_IN_FEATURES_REPLY_HEADER);
index 76ac6e1d02b6eaf9299878ffca51bde876dc8796..dad45419bdbbc8959b35e7b2a0127161358e1d3b 100644 (file)
@@ -13,6 +13,7 @@ import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.OF10MatchDeserializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
@@ -50,9 +51,9 @@ public class OF10FlowRemovedMessageFactory implements OFDeserializer<FlowRemoved
         builder.setVersion(version);
         builder.setXid(rawMessage.readUnsignedInt());
         builder.setMatchV10(OF10MatchDeserializer.createMatchV10(rawMessage));
-        byte[] cookie = new byte[Long.SIZE/Byte.SIZE];
+        byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(cookie);
-        builder.setCookie(new BigInteger(cookie));
+        builder.setCookie(new BigInteger(1, cookie));
         builder.setPriority(rawMessage.readUnsignedShort());
         builder.setReason(FlowRemovedReason.forValue(rawMessage.readUnsignedByte()));
         rawMessage.skipBytes(PADDING_IN_FLOW_REMOVED_MESSAGE);
@@ -60,12 +61,12 @@ public class OF10FlowRemovedMessageFactory implements OFDeserializer<FlowRemoved
         builder.setDurationNsec(rawMessage.readUnsignedInt());
         builder.setIdleTimeout(rawMessage.readUnsignedShort());
         rawMessage.skipBytes(PADDING_IN_FLOW_REMOVED_MESSAGE_2);
-        byte[] packet_count = new byte[Long.SIZE/Byte.SIZE];
+        byte[] packet_count = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(packet_count);
-        builder.setPacketCount(new BigInteger(packet_count));
-        byte[] byte_count = new byte[Long.SIZE/Byte.SIZE];
+        builder.setPacketCount(new BigInteger(1, packet_count));
+        byte[] byte_count = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(byte_count);
-        builder.setByteCount(new BigInteger(byte_count));
+        builder.setByteCount(new BigInteger(1, byte_count));
         return builder.build();
     }
 
index 3de42faaca248eeffe401021ef3d3f7a5d6bd5eb..60a3672a7e5a3d2cc35c7e8e6857d2a5c07fd5cb 100644 (file)
@@ -16,6 +16,7 @@ import java.util.List;
 
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.OF10ActionsDeserializer;
 import org.opendaylight.openflowjava.protocol.impl.util.OF10MatchDeserializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
@@ -157,15 +158,15 @@ public class OF10StatsReplyMessageFactory implements OFDeserializer<MultipartRep
             flowStatsBuilder.setIdleTimeout(input.readUnsignedShort());
             flowStatsBuilder.setHardTimeout(input.readUnsignedShort());
             input.skipBytes(PADDING_IN_FLOW_STATS_HEADER_02);
-            byte[] cookie = new byte[Long.SIZE/Byte.SIZE];
+            byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(cookie);
-            flowStatsBuilder.setCookie(new BigInteger(cookie));
-            byte[] packetCount = new byte[Long.SIZE/Byte.SIZE];
+            flowStatsBuilder.setCookie(new BigInteger(1, cookie));
+            byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(packetCount);
-            flowStatsBuilder.setPacketCount(new BigInteger(packetCount));
-            byte[] byteCount = new byte[Long.SIZE/Byte.SIZE];
+            flowStatsBuilder.setPacketCount(new BigInteger(1, packetCount));
+            byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(byteCount);
-            flowStatsBuilder.setByteCount(new BigInteger(byteCount));
+            flowStatsBuilder.setByteCount(new BigInteger(1, byteCount));
             flowStatsBuilder.setActionsList(OF10ActionsDeserializer
                     .createActionsList(input, length - LENGTH_OF_FLOW_STATS));
             flowStatsList.add(flowStatsBuilder.build());
@@ -178,12 +179,12 @@ public class OF10StatsReplyMessageFactory implements OFDeserializer<MultipartRep
     private static MultipartReplyAggregateCase setAggregate(ByteBuf input) {
         MultipartReplyAggregateCaseBuilder caseBuilder = new MultipartReplyAggregateCaseBuilder();
         MultipartReplyAggregateBuilder builder = new MultipartReplyAggregateBuilder();
-        byte[] packetCount = new byte[Long.SIZE/Byte.SIZE];
+        byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         input.readBytes(packetCount);
-        builder.setPacketCount(new BigInteger(packetCount));
-        byte[] byteCount = new byte[Long.SIZE/Byte.SIZE];
+        builder.setPacketCount(new BigInteger(1, packetCount));
+        byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         input.readBytes(byteCount);
-        builder.setByteCount(new BigInteger(byteCount));
+        builder.setByteCount(new BigInteger(1, byteCount));
         builder.setFlowCount(input.readUnsignedInt());
         input.skipBytes(PADDING_IN_AGGREGATE_HEADER);
         caseBuilder.setMultipartReplyAggregate(builder.build());
@@ -205,12 +206,12 @@ public class OF10StatsReplyMessageFactory implements OFDeserializer<MultipartRep
             tableStatsBuilder.setNwDstMask(OF10MatchDeserializer.decodeNwDstMask(wildcards));
             tableStatsBuilder.setMaxEntries(input.readUnsignedInt());
             tableStatsBuilder.setActiveCount(input.readUnsignedInt());
-            byte[] lookupCount = new byte[Long.SIZE/Byte.SIZE];
+            byte[] lookupCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(lookupCount);
-            tableStatsBuilder.setLookupCount(new BigInteger(lookupCount));
-            byte[] matchedCount = new byte[Long.SIZE/Byte.SIZE];
+            tableStatsBuilder.setLookupCount(new BigInteger(1, lookupCount));
+            byte[] matchedCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(matchedCount);
-            tableStatsBuilder.setMatchedCount(new BigInteger(matchedCount));
+            tableStatsBuilder.setMatchedCount(new BigInteger(1, matchedCount));
             tableStatsList.add(tableStatsBuilder.build());
         }
         builder.setTableStats(tableStatsList);
@@ -226,42 +227,42 @@ public class OF10StatsReplyMessageFactory implements OFDeserializer<MultipartRep
             PortStatsBuilder portStatsBuilder = new PortStatsBuilder();
             portStatsBuilder.setPortNo((long) input.readUnsignedShort());
             input.skipBytes(PADDING_IN_PORT_STATS_HEADER);
-            byte[] rxPackets = new byte[Long.SIZE/Byte.SIZE];
+            byte[] rxPackets = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxPackets);
-            portStatsBuilder.setRxPackets(new BigInteger(rxPackets));
-            byte[] txPackets = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxPackets(new BigInteger(1, rxPackets));
+            byte[] txPackets = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txPackets);
-            portStatsBuilder.setTxPackets(new BigInteger(txPackets));
-            byte[] rxBytes = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxPackets(new BigInteger(1, txPackets));
+            byte[] rxBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxBytes);
-            portStatsBuilder.setRxBytes(new BigInteger(rxBytes));
-            byte[] txBytes = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxBytes(new BigInteger(1, rxBytes));
+            byte[] txBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txBytes);
-            portStatsBuilder.setTxBytes(new BigInteger(txBytes));
-            byte[] rxDropped = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxBytes(new BigInteger(1, txBytes));
+            byte[] rxDropped = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxDropped);
-            portStatsBuilder.setRxDropped(new BigInteger(rxDropped));
-            byte[] txDropped = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxDropped(new BigInteger(1, rxDropped));
+            byte[] txDropped = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txDropped);
-            portStatsBuilder.setTxDropped(new BigInteger(txDropped));
-            byte[] rxErrors = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxDropped(new BigInteger(1, txDropped));
+            byte[] rxErrors = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxErrors);
-            portStatsBuilder.setRxErrors(new BigInteger(rxErrors));
-            byte[] txErrors = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxErrors(new BigInteger(1, rxErrors));
+            byte[] txErrors = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txErrors);
-            portStatsBuilder.setTxErrors(new BigInteger(txErrors));
-            byte[] rxFrameErr = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setTxErrors(new BigInteger(1, txErrors));
+            byte[] rxFrameErr = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxFrameErr);
-            portStatsBuilder.setRxFrameErr(new BigInteger(rxFrameErr));
-            byte[] rxOverErr = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxFrameErr(new BigInteger(1, rxFrameErr));
+            byte[] rxOverErr = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxOverErr);
-            portStatsBuilder.setRxOverErr(new BigInteger(rxOverErr));
-            byte[] rxCrcErr = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxOverErr(new BigInteger(1, rxOverErr));
+            byte[] rxCrcErr = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(rxCrcErr);
-            portStatsBuilder.setRxCrcErr(new BigInteger(rxCrcErr));
-            byte[] collisions = new byte[Long.SIZE/Byte.SIZE];
+            portStatsBuilder.setRxCrcErr(new BigInteger(1, rxCrcErr));
+            byte[] collisions = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(collisions);
-            portStatsBuilder.setCollisions(new BigInteger(collisions));
+            portStatsBuilder.setCollisions(new BigInteger(1, collisions));
             portStatsList.add(portStatsBuilder.build());
         }
         builder.setPortStats(portStatsList);
@@ -278,15 +279,15 @@ public class OF10StatsReplyMessageFactory implements OFDeserializer<MultipartRep
             queueStatsBuilder.setPortNo((long) input.readUnsignedShort());
             input.skipBytes(PADDING_IN_QUEUE_HEADER);
             queueStatsBuilder.setQueueId(input.readUnsignedInt());
-            byte[] txBytes = new byte[Long.SIZE/Byte.SIZE];
+            byte[] txBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txBytes);
-            queueStatsBuilder.setTxBytes(new BigInteger(txBytes));
-            byte[] txPackets = new byte[Long.SIZE/Byte.SIZE];
+            queueStatsBuilder.setTxBytes(new BigInteger(1, txBytes));
+            byte[] txPackets = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txPackets);
-            queueStatsBuilder.setTxPackets(new BigInteger(txPackets));
-            byte[] txErrors = new byte[Long.SIZE/Byte.SIZE];
+            queueStatsBuilder.setTxPackets(new BigInteger(1, txPackets));
+            byte[] txErrors = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
             input.readBytes(txErrors);
-            queueStatsBuilder.setTxErrors(new BigInteger(txErrors));
+            queueStatsBuilder.setTxErrors(new BigInteger(1, txErrors));
             queueStatsList.add(queueStatsBuilder.build());
         }
         builder.setQueueStats(queueStatsList);
@@ -298,7 +299,7 @@ public class OF10StatsReplyMessageFactory implements OFDeserializer<MultipartRep
        MultipartReplyExperimenterCaseBuilder caseBuilder = new MultipartReplyExperimenterCaseBuilder();
         MultipartReplyExperimenterBuilder builder = new MultipartReplyExperimenterBuilder();
         builder.setExperimenter(input.readUnsignedInt());
-        byte[] data = new byte[Long.SIZE/Byte.SIZE];
+        byte[] data = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         input.readBytes(data);
         builder.setData(data);
         caseBuilder.setMultipartReplyExperimenter(builder.build());
index fec070016ca5aa5fd8383c9bad5b904fb3f5d644..d9f299635c54f0bd7a3cd693a3df8eb9375b7534 100644 (file)
@@ -13,6 +13,7 @@ import io.netty.buffer.ByteBuf;
 import java.math.BigInteger;
 
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.MatchDeserializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
@@ -52,9 +53,9 @@ public class PacketInMessageFactory implements OFDeserializer<PacketInMessage> {
         builder.setTotalLen(rawMessage.readUnsignedShort());
         builder.setReason(PacketInReason.forValue(rawMessage.readUnsignedByte()));
         builder.setTableId(new TableId((long)rawMessage.readUnsignedByte()));
-        byte[] cookie = new byte[Long.SIZE/Byte.SIZE];
+        byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         rawMessage.readBytes(cookie);
-        builder.setCookie(new BigInteger(cookie));
+        builder.setCookie(new BigInteger(1, cookie));
         builder.setMatch(MatchDeserializer.createMatch(rawMessage)); 
         rawMessage.skipBytes(PADDING_IN_PACKET_IN_HEADER);
         builder.setData(rawMessage.readBytes(rawMessage.readableBytes()).array());
index 9f9fec9a02fb88c6e2b41884713e57e0fbf2db1c..3ccb2589176ca4bb412a7ac496c9b2fa533184d2 100644 (file)
@@ -50,7 +50,7 @@ public class RoleReplyMessageFactory implements OFDeserializer<RoleRequestOutput
         rawMessage.skipBytes(PADDING_IN_ROLE_REPLY_HEADER);
         byte[] generationID = new byte[8];
         rawMessage.readBytes(generationID);
-        builder.setGenerationId(new BigInteger(generationID));
+        builder.setGenerationId(new BigInteger(1, generationID));
         return builder.build();
     }
 }
index 62916745bf113743a0f99dfc986d0e8c718b4ab3..6eec7b56d7a4f8e36416e2cb4b97019750a0809b 100644 (file)
@@ -516,7 +516,7 @@ public abstract class MatchDeserializer {
 
     private static void addMetadataAugmentation(MatchEntriesBuilder builder, ByteBuf in) {
         MetadataMatchEntryBuilder metadata = new MetadataMatchEntryBuilder();
-        byte[] metadataBytes = new byte[Long.SIZE/Byte.SIZE];
+        byte[] metadataBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         in.readBytes(metadataBytes);
         metadata.setMetadata(metadataBytes);
         builder.addAugmentation(MetadataMatchEntry.class, metadata.build());
index cc43e50e35d078f3b6679d47dcd49e79570af3dc..500aca3a3826d2eef241f4fe6b2e4e9a973a7efe 100644 (file)
@@ -164,9 +164,9 @@ public class MultipartReplyMessageFactoryTest {
                                               "00 0F "+//hardTimeout
                                               "00 0B "+//flags
                                               "00 00 00 00 "+//pad_02
-                                              "00 01 01 01 01 01 01 01 "+//cookie
-                                              "00 01 01 01 01 01 01 01 "+//packetCount
-                                              "00 01 01 01 01 01 01 01"//byteCount
+                                              "FF 01 01 01 01 01 01 01 "+//cookie
+                                              "EF 01 01 01 01 01 01 01 "+//packetCount
+                                              "7F 01 01 01 01 01 01 01"//byteCount
                                               );
         
         MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
@@ -185,13 +185,13 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong flags", new FlowModFlags(true, false, true, false, true), 
                                            message.getFlowStats().get(0).getFlags());
         Assert.assertEquals("Wrong cookie", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getFlowStats().get(0).getCookie());
         Assert.assertEquals("Wrong packetCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xEF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getFlowStats().get(0).getPacketCount());
         Assert.assertEquals("Wrong byteCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0x7F, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getFlowStats().get(0).getByteCount());
     }
     
@@ -201,8 +201,8 @@ public class MultipartReplyMessageFactoryTest {
     @Test
     public void testMultipartReplyAggregateBody(){
         ByteBuf bb = BufferHelper.buildBuffer("00 02 00 01 00 00 00 00 "+
-                                              "00 01 01 01 01 01 01 01 "+//packetCount
-                                              "00 01 01 01 01 01 01 01 "+//byteCount
+                                              "FF 01 01 01 01 01 01 01 "+//packetCount
+                                              "0F 01 01 01 01 01 01 01 "+//byteCount
                                               "00 00 00 08 "+//flowCount
                                               "00 00 00 00"//pad
                                               );
@@ -215,10 +215,10 @@ public class MultipartReplyMessageFactoryTest {
         MultipartReplyAggregateCase messageCase = (MultipartReplyAggregateCase) builtByFactory.getMultipartReplyBody();
         MultipartReplyAggregate message = messageCase.getMultipartReplyAggregate();
         Assert.assertEquals("Wrong packetCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getPacketCount());
         Assert.assertEquals("Wrong byteCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0x0F, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getByteCount());
         Assert.assertEquals("Wrong flowCount", 
                 8, 
@@ -234,8 +234,8 @@ public class MultipartReplyMessageFactoryTest {
                                               "08 "+//tableId
                                               "00 00 00 "+//pad
                                               "00 00 00 10 "+//activeCount
-                                              "00 01 01 01 01 01 01 01 "+//lookupCount
-                                              "00 01 01 01 01 01 01 01"//matchedCount
+                                              "FF 01 01 01 01 01 01 01 "+//lookupCount
+                                              "AF 01 01 01 01 01 01 01"//matchedCount
                                               );
         
         MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
@@ -249,10 +249,10 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong tableId", 8, message.getTableStats().get(0).getTableId().intValue());
         Assert.assertEquals("Wrong activeCount", 16, message.getTableStats().get(0).getActiveCount().longValue());
         Assert.assertEquals("Wrong lookupCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getTableStats().get(0).getLookupCount());
         Assert.assertEquals("Wrong matchedCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xAF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getTableStats().get(0).getMatchedCount());
     }
     
@@ -264,18 +264,18 @@ public class MultipartReplyMessageFactoryTest {
         ByteBuf bb = BufferHelper.buildBuffer("00 04 00 01 00 00 00 00 "+
                                               "00 00 00 FF "+//portNo
                                               "00 00 00 00 "+//pad
-                                              "00 01 01 01 01 01 01 01 "+//rxPackets
-                                              "00 02 02 02 02 02 02 02 "+//txPackets
-                                              "00 02 03 02 03 02 03 02 "+//rxBytes
-                                              "00 02 03 02 03 02 03 02 "+//txBytes
-                                              "00 02 03 02 03 02 03 02 "+//rxDropped
-                                              "00 02 03 02 03 02 03 02 "+//txDropped
-                                              "00 02 03 02 03 02 03 02 "+//rxErrors
-                                              "00 02 03 02 03 02 03 02 "+//txErrors
-                                              "00 02 03 02 03 02 03 02 "+//rxFrameErr
-                                              "00 02 03 02 03 02 03 02 "+//rxOverErr
-                                              "00 02 03 02 03 02 03 02 "+//rxCrcErr
-                                              "00 02 03 02 03 02 03 02 "+//collisions
+                                              "FF 01 01 01 01 01 01 01 "+//rxPackets
+                                              "FF 02 02 02 02 02 02 02 "+//txPackets
+                                              "FF 02 03 02 03 02 03 02 "+//rxBytes
+                                              "FF 02 03 02 03 02 03 02 "+//txBytes
+                                              "FF 02 03 02 03 02 03 02 "+//rxDropped
+                                              "FF 02 03 02 03 02 03 02 "+//txDropped
+                                              "FF 02 03 02 03 02 03 02 "+//rxErrors
+                                              "FF 02 03 02 03 02 03 02 "+//txErrors
+                                              "FF 02 03 02 03 02 03 02 "+//rxFrameErr
+                                              "FF 02 03 02 03 02 03 02 "+//rxOverErr
+                                              "FF 02 03 02 03 02 03 02 "+//rxCrcErr
+                                              "FF 02 03 02 03 02 03 02 "+//collisions
                                               "00 00 00 02 "+//durationSec
                                               "00 00 00 04"//durationNsec
                                               );
@@ -289,40 +289,40 @@ public class MultipartReplyMessageFactoryTest {
         MultipartReplyPortStats message = messageCase.getMultipartReplyPortStats();
         Assert.assertEquals("Wrong portNo", 255, message.getPortStats().get(0).getPortNo().intValue());
         Assert.assertEquals("Wrong rxPackets", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getPortStats().get(0).getRxPackets());
         Assert.assertEquals("Wrong txPackets", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getPortStats().get(0).getTxPackets());
         Assert.assertEquals("Wrong rxBytes", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getRxBytes());
         Assert.assertEquals("Wrong txBytes", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getTxBytes());
         Assert.assertEquals("Wrong rxDropped", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getRxDropped());
         Assert.assertEquals("Wrong txDropped", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getTxDropped());
         Assert.assertEquals("Wrong rxErrors", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getRxErrors());
         Assert.assertEquals("Wrong txErrors", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getTxErrors());
         Assert.assertEquals("Wrong rxFrameErr", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getRxFrameErr());
         Assert.assertEquals("Wrong rxOverErr", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getRxOverErr());
         Assert.assertEquals("Wrong rxCrcErr", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getRxCrcErr());
         Assert.assertEquals("Wrong collisions", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getPortStats().get(0).getCollisions());
         Assert.assertEquals("Wrong durationSec", 2, message.getPortStats().get(0).getDurationSec().intValue());
         Assert.assertEquals("Wrong durationNsec", 4, message.getPortStats().get(0).getDurationNsec().intValue());
@@ -336,9 +336,9 @@ public class MultipartReplyMessageFactoryTest {
         ByteBuf bb = BufferHelper.buildBuffer("00 05 00 01 00 00 00 00 "+
                                               "00 00 00 FF "+//portNo
                                               "00 00 00 10 "+//queueId
-                                              "00 02 03 02 03 02 03 02 "+//txBytes
-                                              "00 02 02 02 02 02 02 02 "+//txPackets
-                                              "00 02 03 02 03 02 03 02 "+//txErrors
+                                              "FF 02 03 02 03 02 03 02 "+//txBytes
+                                              "FF 02 02 02 02 02 02 02 "+//txPackets
+                                              "FF 02 03 02 03 02 03 02 "+//txErrors
                                               "00 00 00 02 "+//durationSec
                                               "00 00 00 04"//durationNsec
                                               );
@@ -353,13 +353,13 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong portNo", 255, message.getQueueStats().get(0).getPortNo().intValue());
         Assert.assertEquals("Wrong queueId", 16, message.getQueueStats().get(0).getQueueId().intValue());
         Assert.assertEquals("Wrong txBytes", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getQueueStats().get(0).getTxBytes());
         Assert.assertEquals("Wrong txPackets", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getQueueStats().get(0).getTxPackets());
         Assert.assertEquals("Wrong txErrors", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), 
                 message.getQueueStats().get(0).getTxErrors());
         Assert.assertEquals("Wrong durationSec", 2, message.getQueueStats().get(0).getDurationSec().intValue());
         Assert.assertEquals("Wrong durationNsec", 4, message.getQueueStats().get(0).getDurationNsec().intValue());
@@ -376,27 +376,27 @@ public class MultipartReplyMessageFactoryTest {
                                               "00 00 00 10 "+//groupId
                                               "00 00 00 12 "+//refCount
                                               "00 00 00 00 "+//pad2
-                                              "00 01 01 01 01 01 01 01 "+//packetCount
-                                              "00 01 01 01 01 01 01 01 "+//byteCount
+                                              "FF 01 01 01 01 01 01 01 "+//packetCount
+                                              "FF 01 01 01 01 01 01 01 "+//byteCount
                                               "00 00 00 08 "+//durationSec
                                               "00 00 00 09 "+//durationNsec
-                                              "00 01 01 01 01 01 01 01 "+//packetCountBucket
-                                              "00 01 01 01 01 01 01 01 "+//byteCountBucket
-                                              "00 02 02 02 02 02 02 02 "+//packetCountBucket_2
-                                              "00 02 02 02 02 02 02 02 "+//byteCountBucket_2
+                                              "FF 01 01 01 01 01 01 01 "+//packetCountBucket
+                                              "FF 01 01 01 01 01 01 01 "+//byteCountBucket
+                                              "FF 02 02 02 02 02 02 02 "+//packetCountBucket_2
+                                              "FF 02 02 02 02 02 02 02 "+//byteCountBucket_2
                                               "00 48 "+//length_2
                                               "00 00 "+//pad1.2
                                               "00 00 00 10 "+//groupId_2
                                               "00 00 00 12 "+//refCount_2
                                               "00 00 00 00 "+//pad2.2
-                                              "00 01 01 01 01 01 01 01 "+//packetCount_2
-                                              "00 01 01 01 01 01 01 01 "+//byteCount_2
+                                              "FF 01 01 01 01 01 01 01 "+//packetCount_2
+                                              "FF 01 01 01 01 01 01 01 "+//byteCount_2
                                               "00 00 00 08 "+//durationSec_2
                                               "00 00 00 09 "+//durationNsec_2
-                                              "00 01 01 01 01 01 01 01 "+//packetCountBucket_1.2
-                                              "00 01 01 01 01 01 01 01 "+//byteCountBucket_1.2
-                                              "00 02 02 02 02 02 02 02 "+//packetCountBucket_2.2
-                                              "00 02 02 02 02 02 02 02"//byteCountBucket_2.2
+                                              "FF 01 01 01 01 01 01 01 "+//packetCountBucket_1.2
+                                              "FF 01 01 01 01 01 01 01 "+//byteCountBucket_1.2
+                                              "FF 02 02 02 02 02 02 02 "+//packetCountBucket_2.2
+                                              "FF 02 02 02 02 02 02 02"//byteCountBucket_2.2
                                               );
         
         MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
@@ -409,47 +409,47 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong groupId", 16, message.getGroupStats().get(0).getGroupId().getValue().intValue());
         Assert.assertEquals("Wrong refCount", 18, message.getGroupStats().get(0).getRefCount().intValue());
         Assert.assertEquals("Wrong packetCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(0).getPacketCount());
         Assert.assertEquals("Wrong byteCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(0).getByteCount());
         Assert.assertEquals("Wrong durationSec", 8, message.getGroupStats().get(0).getDurationSec().intValue());
         Assert.assertEquals("Wrong durationNsec", 9, message.getGroupStats().get(0).getDurationNsec().intValue());
         Assert.assertEquals("Wrong packetCountBucket", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(0).getBucketStats().get(0).getPacketCount());
         Assert.assertEquals("Wrong byteCountBucket", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(0).getBucketStats().get(0).getByteCount());
         Assert.assertEquals("Wrong packetCountBucket_2", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getGroupStats().get(0).getBucketStats().get(1).getPacketCount());
         Assert.assertEquals("Wrong byteCountBucket_2", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getGroupStats().get(0).getBucketStats().get(1).getByteCount());
         
         Assert.assertEquals("Wrong groupId_2", 16, message.getGroupStats().get(1).getGroupId().getValue().intValue());
         Assert.assertEquals("Wrong refCount_2", 18, message.getGroupStats().get(1).getRefCount().intValue());
         Assert.assertEquals("Wrong packetCount_2", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(1).getPacketCount());
         Assert.assertEquals("Wrong byteCount_2", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(1).getByteCount());
         Assert.assertEquals("Wrong durationSec_2", 8, message.getGroupStats().get(1).getDurationSec().intValue());
         Assert.assertEquals("Wrong durationNsec_2", 9, message.getGroupStats().get(1).getDurationNsec().intValue());
         Assert.assertEquals("Wrong packetCountBucket_1.2", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(1).getBucketStats().get(0).getPacketCount());
         Assert.assertEquals("Wrong byteCountBucket_1.2", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getGroupStats().get(1).getBucketStats().get(0).getByteCount());
         Assert.assertEquals("Wrong packetCountBucket_2.2", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getGroupStats().get(1).getBucketStats().get(1).getPacketCount());
         Assert.assertEquals("Wrong byteCountBucket_2.2", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getGroupStats().get(1).getBucketStats().get(1).getByteCount());
     }
     
@@ -492,16 +492,16 @@ public class MultipartReplyMessageFactoryTest {
                                               "00 58 "+//len
                                               "00 00 00 00 00 00 "+//pad
                                               "00 00 00 07 "+//flowCount
-                                              "00 01 01 01 01 01 01 01 "+//packetInCount
-                                              "00 01 01 01 01 01 01 01 "+//byteInCount
+                                              "FF 01 01 01 01 01 01 01 "+//packetInCount
+                                              "FF 01 01 01 01 01 01 01 "+//byteInCount
                                               "00 00 00 05 "+//durationSec
                                               "00 00 00 05 "+//durationNsec
-                                              "00 01 01 01 01 01 01 01 "+//packetBandCount_01
-                                              "00 01 01 01 01 01 01 01 "+//byteBandCount_01
-                                              "00 02 02 02 02 02 02 02 "+//packetBandCount_02
-                                              "00 02 02 02 02 02 02 02 "+//byteBandCount_02
-                                              "00 03 03 03 03 03 03 03 "+//packetBandCount_03
-                                              "00 03 03 03 03 03 03 03"//byteBandCount_03
+                                              "FF 01 01 01 01 01 01 01 "+//packetBandCount_01
+                                              "FF 01 01 01 01 01 01 01 "+//byteBandCount_01
+                                              "FF 02 02 02 02 02 02 02 "+//packetBandCount_02
+                                              "FF 02 02 02 02 02 02 02 "+//byteBandCount_02
+                                              "FF 03 03 03 03 03 03 03 "+//packetBandCount_03
+                                              "FF 03 03 03 03 03 03 03"//byteBandCount_03
                                               );
         
         MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
@@ -516,32 +516,32 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong flowCount", 7, 
                             message.getMeterStats().get(0).getFlowCount().intValue());
         Assert.assertEquals("Wrong packetInCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getPacketInCount());
         Assert.assertEquals("Wrong byteInCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getByteInCount());
         Assert.assertEquals("Wrong durationSec", 5, 
                 message.getMeterStats().get(0).getDurationSec().intValue());
         Assert.assertEquals("Wrong durationNsec", 5, 
                 message.getMeterStats().get(0).getDurationNsec().intValue());
         Assert.assertEquals("Wrong packetBandCount_01", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(0).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_01", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(0).getByteBandCount());
         Assert.assertEquals("Wrong packetBandCount_02", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(1).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_02", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(1).getByteBandCount());
         Assert.assertEquals("Wrong packetBandCount_03", 
-                new BigInteger(new byte[]{0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(2).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_03", 
-                new BigInteger(new byte[]{0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(2).getByteBandCount());
     }
     
@@ -555,30 +555,30 @@ public class MultipartReplyMessageFactoryTest {
                                               "00 58 "+//len_0
                                               "00 00 00 00 00 00 "+//pad_0
                                               "00 00 00 07 "+//flowCount_0
-                                              "00 01 01 01 01 01 01 01 "+//packetInCount_0
-                                              "00 01 01 01 01 01 01 01 "+//byteInCount_0
+                                              "FF 01 01 01 01 01 01 01 "+//packetInCount_0
+                                              "FF 01 01 01 01 01 01 01 "+//byteInCount_0
                                               "00 00 00 05 "+//durationSec_0
                                               "00 00 00 05 "+//durationNsec_0
-                                              "00 01 01 01 01 01 01 01 "+//packetBandCount_01
-                                              "00 01 01 01 01 01 01 01 "+//byteBandCount_01
-                                              "00 02 02 02 02 02 02 02 "+//packetBandCount_02
-                                              "00 02 02 02 02 02 02 02 "+//byteBandCount_02
-                                              "00 03 03 03 03 03 03 03 "+//packetBandCount_03
-                                              "00 03 03 03 03 03 03 03 "+//byteBandCount_03
+                                              "FF 01 01 01 01 01 01 01 "+//packetBandCount_01
+                                              "FF 01 01 01 01 01 01 01 "+//byteBandCount_01
+                                              "FF 02 02 02 02 02 02 02 "+//packetBandCount_02
+                                              "FF 02 02 02 02 02 02 02 "+//byteBandCount_02
+                                              "FF 03 03 03 03 03 03 03 "+//packetBandCount_03
+                                              "FF 03 03 03 03 03 03 03 "+//byteBandCount_03
                                               "00 00 00 08 "+//meterId_1
                                               "00 58 "+//len_1
                                               "00 00 00 00 00 00 "+//pad_1
                                               "00 00 00 07 "+//flowCount_1
-                                              "00 01 01 01 01 01 01 01 "+//packetInCount_1
-                                              "00 01 01 01 01 01 01 01 "+//byteInCount_1
+                                              "FF 01 01 01 01 01 01 01 "+//packetInCount_1
+                                              "FF 01 01 01 01 01 01 01 "+//byteInCount_1
                                               "00 00 00 05 "+//durationSec_1
                                               "00 00 00 05 "+//durationNsec_1
-                                              "00 01 01 01 01 01 01 01 "+//packetBandCount_11
-                                              "00 01 01 01 01 01 01 01 "+//byteBandCount_11
-                                              "00 02 02 02 02 02 02 02 "+//packetBandCount_12
-                                              "00 02 02 02 02 02 02 02 "+//byteBandCount_12
-                                              "00 03 03 03 03 03 03 03 "+//packetBandCount_13
-                                              "00 03 03 03 03 03 03 03"//byteBandCount_13
+                                              "FF 01 01 01 01 01 01 01 "+//packetBandCount_11
+                                              "FF 01 01 01 01 01 01 01 "+//byteBandCount_11
+                                              "FF 02 02 02 02 02 02 02 "+//packetBandCount_12
+                                              "FF 02 02 02 02 02 02 02 "+//byteBandCount_12
+                                              "FF 03 03 03 03 03 03 03 "+//packetBandCount_13
+                                              "FF 03 03 03 03 03 03 03"//byteBandCount_13
                                               );
         
         MultipartReplyMessage builtByFactory = BufferHelper.decodeV13(MultipartReplyMessageFactory.getInstance(), bb);
@@ -593,32 +593,32 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong flowCount", 7, 
                             message.getMeterStats().get(0).getFlowCount().intValue());
         Assert.assertEquals("Wrong packetInCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getPacketInCount());
         Assert.assertEquals("Wrong byteInCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getByteInCount());
         Assert.assertEquals("Wrong durationSec", 5, 
                 message.getMeterStats().get(0).getDurationSec().intValue());
         Assert.assertEquals("Wrong durationNsec", 5, 
                 message.getMeterStats().get(0).getDurationNsec().intValue());
         Assert.assertEquals("Wrong packetBandCount_01", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(0).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_01", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(0).getByteBandCount());
         Assert.assertEquals("Wrong packetBandCount_02", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(1).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_02", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(1).getByteBandCount());
         Assert.assertEquals("Wrong packetBandCount_03", 
-                new BigInteger(new byte[]{0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(2).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_03", 
-                new BigInteger(new byte[]{0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
                 message.getMeterStats().get(0).getMeterBandStats().get(2).getByteBandCount());
         
         Assert.assertEquals("Wrong meterId", 8, 
@@ -626,32 +626,32 @@ public class MultipartReplyMessageFactoryTest {
         Assert.assertEquals("Wrong flowCount", 7, 
                 message.getMeterStats().get(1).getFlowCount().intValue());
         Assert.assertEquals("Wrong packetInCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(1).getPacketInCount());
         Assert.assertEquals("Wrong byteInCount", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(1).getByteInCount());
         Assert.assertEquals("Wrong durationSec", 5, 
                 message.getMeterStats().get(1).getDurationSec().intValue());
         Assert.assertEquals("Wrong durationNsec", 5, 
                 message.getMeterStats().get(1).getDurationNsec().intValue());
         Assert.assertEquals("Wrong packetBandCount_01", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(1).getMeterBandStats().get(0).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_01", 
-                new BigInteger(new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), 
                 message.getMeterStats().get(1).getMeterBandStats().get(0).getByteBandCount());
         Assert.assertEquals("Wrong packetBandCount_02", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getMeterStats().get(1).getMeterBandStats().get(1).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_02", 
-                new BigInteger(new byte[]{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), 
                 message.getMeterStats().get(1).getMeterBandStats().get(1).getByteBandCount());
         Assert.assertEquals("Wrong packetBandCount_03", 
-                new BigInteger(new byte[]{0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
                 message.getMeterStats().get(1).getMeterBandStats().get(2).getPacketBandCount());
         Assert.assertEquals("Wrong byteBandCount_03", 
-                new BigInteger(new byte[]{0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
+                new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), 
                 message.getMeterStats().get(1).getMeterBandStats().get(2).getByteBandCount());
     }
     
index 438f9b2ea78ac1dfe7b0250a66fc1c1cf183b81e..d1f3de31a940c262054b60e7e6c85ce34877ad06 100644 (file)
@@ -105,7 +105,7 @@ public class OF10StatsReplyMessageFactoryTest {
                 + "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
@@ -123,13 +123,13 @@ public class OF10StatsReplyMessageFactoryTest {
         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
@@ -150,7 +150,7 @@ public class OF10StatsReplyMessageFactoryTest {
     @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
@@ -161,10 +161,10 @@ public class OF10StatsReplyMessageFactoryTest {
         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
@@ -178,7 +178,7 @@ public class OF10StatsReplyMessageFactoryTest {
         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
@@ -197,10 +197,10 @@ public class OF10StatsReplyMessageFactoryTest {
         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
@@ -212,12 +212,12 @@ public class OF10StatsReplyMessageFactoryTest {
     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
@@ -228,40 +228,40 @@ public class OF10StatsReplyMessageFactoryTest {
         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
@@ -273,9 +273,9 @@ public class OF10StatsReplyMessageFactoryTest {
     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
@@ -287,13 +287,13 @@ public class OF10StatsReplyMessageFactoryTest {
         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
index 6a9ee5623f1e317d50c563a8f16a8860fff6b0b0..c1aa119d9144be5b40c0382b9eefb3f07ab750e1 100644 (file)
@@ -62,10 +62,10 @@ public class FlowModInputMessageFactoryTest {
     public void testFlowModInputMessageFactory() throws Exception {
         FlowModInputBuilder builder = new FlowModInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        byte[] cookie = new byte[]{0x00, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
-        builder.setCookie(new BigInteger(cookie));
-        byte[] cookieMask = new byte[]{0x01, 0x05, 0x00, 0x00, 0x09, 0x30, 0x00, 0x30};
-        builder.setCookieMask(new BigInteger(cookieMask));
+        byte[] cookie = new byte[]{(byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
+        builder.setCookie(new BigInteger(1, cookie));
+        byte[] cookieMask = new byte[]{(byte) 0xFF, 0x05, 0x00, 0x00, 0x09, 0x30, 0x00, 0x30};
+        builder.setCookieMask(new BigInteger(1, cookieMask));
         builder.setTableId(new TableId(65L));
         builder.setCommand(FlowModCommand.forValue(2));
         builder.setIdleTimeout(12);
@@ -116,8 +116,12 @@ public class FlowModInputMessageFactoryTest {
         factory.messageToBuffer(HelloMessageFactoryTest.VERSION_YET_SUPPORTED, out, message);
         
         BufferHelper.checkHeaderV13(out, factory.getMessageType(), factory.computeLength(message));
-        Assert.assertEquals("Wrong cookie", message.getCookie().longValue(), out.readLong());
-        Assert.assertEquals("Wrong cookieMask", message.getCookieMask().longValue(), out.readLong());
+        cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        out.readBytes(cookie);
+        Assert.assertEquals("Wrong cookie", message.getCookie(), new BigInteger(1, cookie));
+        cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        out.readBytes(cookieMask);
+        Assert.assertEquals("Wrong cookieMask", message.getCookieMask(), new BigInteger(1,  cookieMask));
         Assert.assertEquals("Wrong tableId", message.getTableId().getValue().intValue(), out.readUnsignedByte());
         Assert.assertEquals("Wrong command", message.getCommand().getIntValue(), out.readUnsignedByte());
         Assert.assertEquals("Wrong idleTimeOut", message.getIdleTimeout().intValue(), out.readShort());
index cdee930aec731a661ebb90aeafa6e92b4892fd47..d18def9c46e190e0ac2d22230f64b8b68154ecc9 100644 (file)
@@ -100,9 +100,9 @@ public class MultipartRequestInputFactoryTest {
         builder.setOutPort(85L);
         builder.setOutGroup(95L);
         byte[] cookie = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookie(new BigInteger(cookie));
+        builder.setCookie(new BigInteger(1, cookie));
         byte[] cookieMask = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookieMask(new BigInteger(cookieMask));
+        builder.setCookieMask(new BigInteger(1, cookieMask));
         caseBuilder.setMultipartRequestFlow(builder.build());
         //TODO match field
         return caseBuilder.build();
@@ -118,12 +118,12 @@ public class MultipartRequestInputFactoryTest {
         builder.setOutPort(output.readUnsignedInt());
         builder.setOutGroup(output.readUnsignedInt());
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
-        byte[] cookie = new byte[Long.SIZE/Byte.SIZE];
+        byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         output.readBytes(cookie);
-        builder.setCookie(new BigInteger(cookie));
-        byte[] cookieMask = new byte[Long.SIZE/Byte.SIZE];
+        builder.setCookie(new BigInteger(1, cookie));
+        byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         output.readBytes(cookieMask);
-        builder.setCookieMask(new BigInteger(cookieMask));
+        builder.setCookieMask(new BigInteger(1, cookieMask));
         caseBuilder.setMultipartRequestFlow(builder.build());
         return caseBuilder.build();
     }
@@ -165,9 +165,9 @@ public class MultipartRequestInputFactoryTest {
         builder.setOutPort(85L);
         builder.setOutGroup(95L);
         byte[] cookie = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookie(new BigInteger(cookie));
+        builder.setCookie(new BigInteger(1, cookie));
         byte[] cookieMask = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookieMask(new BigInteger(cookieMask));
+        builder.setCookieMask(new BigInteger(1, cookieMask));
         caseBuilder.setMultipartRequestAggregate(builder.build());
       //TODO match field
         return caseBuilder.build();
@@ -183,12 +183,12 @@ public class MultipartRequestInputFactoryTest {
         builder.setOutPort(output.readUnsignedInt());
         builder.setOutGroup(output.readUnsignedInt());
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_02);
-        byte[] cookie = new byte[Long.SIZE/Byte.SIZE];
+        byte[] cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         output.readBytes(cookie);
-        builder.setCookie(new BigInteger(cookie));
-        byte[] cookieMask = new byte[Long.SIZE/Byte.SIZE];
+        builder.setCookie(new BigInteger(1, cookie));
+        byte[] cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         output.readBytes(cookieMask);
-        builder.setCookieMask(new BigInteger(cookieMask));
+        builder.setCookieMask(new BigInteger(1, cookieMask));
         caseBuilder.setMultipartRequestAggregate(builder.build());
         return caseBuilder.build();
     }
@@ -531,8 +531,8 @@ public class MultipartRequestInputFactoryTest {
         TableFeaturesBuilder tableFeaturesBuilder = new TableFeaturesBuilder();
         tableFeaturesBuilder.setTableId((short) 8);
         tableFeaturesBuilder.setName("AAAABBBBCCCCDDDDEEEEFFFFGGGG");
-        tableFeaturesBuilder.setMetadataMatch(new BigInteger(new byte[] {0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}));
-        tableFeaturesBuilder.setMetadataWrite(new BigInteger(new byte[] {0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}));
+        tableFeaturesBuilder.setMetadataMatch(new BigInteger(1, new byte[] {0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}));
+        tableFeaturesBuilder.setMetadataWrite(new BigInteger(1, new byte[] {0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}));
         tableFeaturesBuilder.setConfig(new TableConfig(true));
         tableFeaturesBuilder.setMaxEntries(65L);
         TableFeatures tableFeature = tableFeaturesBuilder.build();
@@ -556,12 +556,12 @@ public class MultipartRequestInputFactoryTest {
         output.readBytes(tableNameBytes);
         String tableName = new String(tableNameBytes);
         tableFeaturesBuilder.setName(tableName.trim());
-        byte[] metadataMatch = new byte[Long.SIZE/Byte.SIZE];
+        byte[] metadataMatch = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         output.readBytes(metadataMatch);
-        tableFeaturesBuilder.setMetadataMatch(new BigInteger(metadataMatch));
-        byte[] metadataWrite = new byte[Long.SIZE/Byte.SIZE];
+        tableFeaturesBuilder.setMetadataMatch(new BigInteger(1, metadataMatch));
+        byte[] metadataWrite = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         output.readBytes(metadataWrite);
-        tableFeaturesBuilder.setMetadataWrite(new BigInteger(metadataWrite));
+        tableFeaturesBuilder.setMetadataWrite(new BigInteger(1, metadataWrite));
         tableFeaturesBuilder.setConfig(decodeTableConfig(output.readInt()));
         tableFeaturesBuilder.setMaxEntries(output.readUnsignedInt());
         TableFeatures tableFeature = tableFeaturesBuilder.build();
index 697eedf3232994c644b1315b1546b331616648cd..fadefe00a1dd9d106de3373670f0271059313d0d 100644 (file)
@@ -70,8 +70,8 @@ public class OF10FlowModInputMessageFactoryTest {
         matchBuilder.setTpSrc(6653);
         matchBuilder.setTpDst(6633);
         builder.setMatchV10(matchBuilder.build());
-        byte[] cookie = new byte[]{0x00, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
-        builder.setCookie(new BigInteger(cookie));
+        byte[] cookie = new byte[]{(byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
+        builder.setCookie(new BigInteger(1, cookie));
         builder.setCommand(FlowModCommand.forValue(0));
         builder.setIdleTimeout(12);
         builder.setHardTimeout(16);
index 9baa8553beac1988a38fc0cf2654cd05f07816c9..4de2c4a84e5dd13fcb2c459fe41df03c125e4b01 100644 (file)
@@ -41,8 +41,8 @@ public class RoleRequestInputMessageFactoryTest {
         RoleRequestInputBuilder builder = new RoleRequestInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setRole(ControllerRole.forValue(2));
-        byte[] generationId = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setGenerationId(new BigInteger(generationId));
+        byte[] generationId = new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+        builder.setGenerationId(new BigInteger(1, generationId));
         RoleRequestInput message = builder.build();
         
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -52,6 +52,8 @@ public class RoleRequestInputMessageFactoryTest {
         BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH);
         Assert.assertEquals("Wrong role", message.getRole().getIntValue(), ControllerRole.forValue((int) out.readUnsignedInt()).getIntValue());
         out.skipBytes(PADDING_IN_ROLE_REQUEST_MESSAGE);
-        Assert.assertEquals("Wrong generation ID", message.getGenerationId().longValue(), out.readLong());
+        byte[] genId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        out.readBytes(genId);
+        Assert.assertEquals("Wrong generation ID", message.getGenerationId(), new BigInteger(1, genId));
     }
 }