Remove EncodeConstants.SIZE_OF_{BYTE,SHORT,INT,LONG}_IN_BYTES
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / serialization / messages / GroupMessageSerializerTest.java
index f092579cdac1679b62571f0d5eb948de7a8ba56d..743ed2fb7b9d07d8f88b7233fa7c81f54944a73d 100644 (file)
@@ -70,14 +70,14 @@ public class GroupMessageSerializerTest extends AbstractSerializerTest {
                                     .build())
                             .build())
                     .setOrder(ACTION_ORDER)
-                    .setKey(ACTION_KEY)
+                    .withKey(ACTION_KEY)
                     .build()
     );
 
     private static final Buckets BUCKETS = new BucketsBuilder()
             .setBucket(Collections.singletonList(new BucketBuilder()
                     .setBucketId(BUCKET_ID)
-                    .setKey(BUCKET_KEY)
+                    .withKey(BUCKET_KEY)
                     .setWatchGroup(BUCKET_WATCH_GROUP)
                     .setWatchPort(BUCKET_WATCH_PORT)
                     .setWeight(BUCKET_WEIGHT)
@@ -106,7 +106,7 @@ public class GroupMessageSerializerTest extends AbstractSerializerTest {
     }
 
     @Test
-    public void testSerialize() throws Exception {
+    public void testSerialize() {
         final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(MESSAGE, out);
 
@@ -131,14 +131,14 @@ public class GroupMessageSerializerTest extends AbstractSerializerTest {
 
         // Action
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
-        assertEquals(out.readUnsignedShort(), EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Size of action type
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Size of action length
-                        + EncodeConstants.SIZE_OF_SHORT_IN_BYTES // Match entry OXM class
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // Match entry field and mask
-                        + EncodeConstants.SIZE_OF_BYTE_IN_BYTES // Match entry length
+        assertEquals(out.readUnsignedShort(), Short.BYTES // Size of action type
+                        + Short.BYTES // Size of action length
+                        + Short.BYTES // Match entry OXM class
+                        + Byte.BYTES // Match entry field and mask
+                        + Byte.BYTES // Match entry length
                         + EncodeConstants.PADDING); // Size of set field (match entry)
         // Skip match entry header, we have tests for this elsewhere
-        out.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
+        out.skipBytes(Integer.BYTES);
 
         // Actual match body
         byte[] addressBytes = new byte[4];