Fix checkstyle violations in openflow-protocol-impl - part 12 93/67393/2
authorTom Pantelis <tompantelis@gmail.com>
Sun, 21 Jan 2018 02:50:17 +0000 (21:50 -0500)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 27 Jan 2018 02:34:57 +0000 (21:34 -0500)
Many violations - more to follow

Change-Id: I909943b0b0b3e8974dd73422843238042b4bac1b
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
66 files changed:
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializerRegistryImpl.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoOutputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoReplyInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoRequestMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ErrorMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowRemovedMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetAsyncReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetaAsyncRequestMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartRequestInputFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FeaturesReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowRemovedMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10HelloInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketInMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortStatusMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketInMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/QueueGetConfigReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetConfigMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/VendorInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/BufferHelper.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/CodeKeyMakerFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/DefaultDeserializerFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionsDeserializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ListDeserializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ListSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchDeserializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13ActionsSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13InstructionsSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer02Test.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OpenflowUtilsTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/TypeKeyMakerFactoryTest.java

index 803fd209aa66c53c06516fd8c8eebcd165e98315..5967483d42bba4a63ed0267c69ea569971d5bd35 100644 (file)
@@ -62,8 +62,8 @@ public class SerializerRegistryImpl implements SerializerRegistry {
         InstructionsInitializer.registerInstructionSerializers(this);
     }
 
-    public void setGroupAddModConfig(boolean isGroupAddModEnabled) {
-        this.isGroupAddModEnabled = isGroupAddModEnabled;
+    public void setGroupAddModConfig(boolean value) {
+        this.isGroupAddModEnabled = value;
     }
 
     @Override
index c0263c30651718d0ca97d32e18400944f27f215e..01edc6ed577803237b91b13b071aeb60152eb87d 100644 (file)
@@ -10,21 +10,21 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for BarrierInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class BarrierInputMessageFactoryTest {
 
@@ -33,7 +33,7 @@ public class BarrierInputMessageFactoryTest {
     private OFSerializer<BarrierInput> barrierFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -44,8 +44,7 @@ public class BarrierInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link BarrierInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link BarrierInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void test() throws Exception {
index cbe260d546b860a92b5b28f44c28407b9d942f32..a87549dcf2b4130392fb3c8369aca2d6e1374f59 100644 (file)
@@ -21,8 +21,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for BarrierReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class BarrierReplyMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 21;
index 0d6db4e06287d70b09d11bc8424b7aced54fd789..303b2ed343c6fe2988dd3296345b1655c0140706 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -24,8 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for EchoInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class EchoInputMessageFactoryTest {
 
@@ -34,7 +34,7 @@ public class EchoInputMessageFactoryTest {
     private OFSerializer<EchoInput> echoFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -45,8 +45,7 @@ public class EchoInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link EchoInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link EchoInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV13() throws Exception {
@@ -59,8 +58,7 @@ public class EchoInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link EchoInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link EchoInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV10() throws Exception {
@@ -73,11 +71,10 @@ public class EchoInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link EchoInputMessageFactory} for correct data serialization
-     * @throws Exception
+     * Testing of {@link EchoInputMessageFactory} for correct data serialization.
      */
     @Test
-    public void testData() throws Exception{
+    public void testData() throws Exception {
         byte[] dataToTest = new byte[]{91,92,93,94,95,96,97,98};
         EchoInputBuilder eib = new EchoInputBuilder();
         BufferHelper.setupHeader(eib, EncodeConstants.OF13_VERSION_ID);
@@ -85,7 +82,7 @@ public class EchoInputMessageFactoryTest {
         EchoInput ei = eib.build();
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         echoFactory.serialize(ei, out);
-        BufferHelper.checkHeaderV13(out, ECHO_REQUEST_MESSAGE_CODE_TYPE, 8+dataToTest.length);
+        BufferHelper.checkHeaderV13(out, ECHO_REQUEST_MESSAGE_CODE_TYPE, 8 + dataToTest.length);
         byte[] outData = new byte[dataToTest.length];
         out.readBytes(outData);
         Assert.assertArrayEquals("Wrong - different output data.", dataToTest, outData);
index 0f70b3eacefc7a803107088b6a48489940980f64..df8a82261bf3c31ba54dd834fed4ec2d2f724ed8 100644 (file)
@@ -23,8 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutputBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for EchoOutputMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class EchoOutputMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 3;
index 98bd9a63c234c4396e1b7a752536db57b3c97240..38f72126c7ebb659c89a99fce2312206181c6b80 100644 (file)
@@ -8,11 +8,9 @@
 
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
-import org.junit.Assert;
-
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
@@ -25,8 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for EchoReplyInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class EchoReplyInputMessageFactoryTest {
 
@@ -35,7 +34,7 @@ public class EchoReplyInputMessageFactoryTest {
     private OFSerializer<EchoReplyInput> echoFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -46,8 +45,7 @@ public class EchoReplyInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link EchoReplyInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link EchoReplyInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV13() throws Exception {
@@ -60,8 +58,7 @@ public class EchoReplyInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link EchoReplyInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link EchoReplyInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV10() throws Exception {
@@ -74,8 +71,7 @@ public class EchoReplyInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link EchoReplyInputMessageFactory} for correct message serialization
-     * @throws Exception
+     * Testing of {@link EchoReplyInputMessageFactory} for correct message serialization.
      */
     @Test
     public void testDataSerialize()throws Exception {
@@ -86,7 +82,7 @@ public class EchoReplyInputMessageFactoryTest {
         EchoReplyInput eri = erib.build();
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         echoFactory.serialize(eri, out);
-        BufferHelper.checkHeaderV13(out, ECHO_REPLY_MESSAGE_CODE_TYPE, 8+dataToTest.length);
+        BufferHelper.checkHeaderV13(out, ECHO_REPLY_MESSAGE_CODE_TYPE, 8 + dataToTest.length);
         byte[] outData = new byte[dataToTest.length];
         out.readBytes(outData);
         Assert.assertArrayEquals("Wrong - different output data.",dataToTest, outData);
index 22135bb640bfac89d0381d88cb4b01644b74bcbc..154579db14ac3a9619fdd52e5562b8c11d7a2333 100644 (file)
@@ -23,12 +23,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for EchoRequestMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class EchoRequestMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 2;
-    EchoRequestMessage message;
     private OFSerializer<EchoRequestMessage> factory;
 
     @Before
index 929cbefe6b2642fc8c3b51c369d902237edecd9c..47b03e1dddc4d80652af33675f18750380d77097 100644 (file)
@@ -23,8 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for ErrorMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class ErrorMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 1;
index 9b6720e4935fea48e76845c191e462294d631a17..27ac8f8cf8a877945f796ec36f7889085c076d87 100644 (file)
@@ -28,8 +28,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ExperimenterInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class ExperimenterInputMessageFactoryTest {
 
@@ -43,7 +44,7 @@ public class ExperimenterInputMessageFactoryTest {
     private ByteBuf out;
 
     /**
-     * Sets up ExperimenterInputMessageFactory
+     * Sets up ExperimenterInputMessageFactory.
      * @param real true if setup should use real registry, false when mock is desired
      */
     public void startUp(boolean real) {
@@ -60,10 +61,9 @@ public class ExperimenterInputMessageFactoryTest {
 
     /**
      * Testing of {@link ExperimenterInputMessageFactory} for correct serializer
-     * lookup and serialization
-     * @throws Exception
+     * lookup and serialization.
      */
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testV10Real() throws Exception {
         startUp(true);
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
@@ -78,10 +78,9 @@ public class ExperimenterInputMessageFactoryTest {
 
     /**
      * Testing of {@link ExperimenterInputMessageFactory} for correct serializer
-     * lookup and serialization
-     * @throws Exception
+     * lookup and serialization.
      */
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testV13Real() throws Exception {
         startUp(true);
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
@@ -96,8 +95,7 @@ public class ExperimenterInputMessageFactoryTest {
 
     /**
      * Testing of {@link ExperimenterInputMessageFactory} for correct serializer
-     * lookup and serialization
-     * @throws Exception
+     * lookup and serialization.
      */
     @Test
     public void testV10() throws Exception {
@@ -118,8 +116,7 @@ public class ExperimenterInputMessageFactoryTest {
 
     /**
      * Testing of {@link ExperimenterInputMessageFactory} for correct serializer
-     * lookup and serialization
-     * @throws Exception
+     * lookup and serialization.
      */
     @Test
     public void testV13() throws Exception {
@@ -137,4 +134,4 @@ public class ExperimenterInputMessageFactoryTest {
         expFactory.serialize(input, out);
         Mockito.verify(serializer, Mockito.times(1)).serialize(input.getExperimenterDataOfChoice(), out);
     }
-}
\ No newline at end of file
+}
index a3a72a27d4c885f84de77519e0833d9a5ed34605..dbf907370d5f5f8a0bcc5b27379c296d35cbde27 100644 (file)
@@ -10,11 +10,9 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -55,6 +53,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
 
 /**
+ * Unit tests for FlowModInputMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -64,7 +64,7 @@ public class FlowModInputMessageFactoryTest {
     private OFSerializer<FlowModInput> flowModFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -75,8 +75,7 @@ public class FlowModInputMessageFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link FlowModInputMessageFactory} for correct translation from POJO
+     * Testing of {@link FlowModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testFlowModInputMessageFactory() throws Exception {
@@ -97,7 +96,7 @@ public class FlowModInputMessageFactoryTest {
         builder.setFlags(new FlowModFlags(true, false, true, false, true));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(InPhyPort.class);
@@ -119,7 +118,7 @@ public class FlowModInputMessageFactoryTest {
         entries.add(entriesBuilder.build());
         matchBuilder.setMatchEntry(entries);
         builder.setMatch(matchBuilder.build());
-        List<Instruction> instructions = new ArrayList<>();
+        final List<Instruction> instructions = new ArrayList<>();
         InstructionBuilder insBuilder = new InstructionBuilder();
         GotoTableCaseBuilder goToCaseBuilder = new GotoTableCaseBuilder();
         GotoTableBuilder instructionBuilder = new GotoTableBuilder();
@@ -135,10 +134,10 @@ public class FlowModInputMessageFactoryTest {
         insBuilder.setInstructionChoice(metadataCaseBuilder.build());
         instructions.add(insBuilder.build());
         insBuilder = new InstructionBuilder();
-        ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
-        ApplyActionsBuilder actionsBuilder = new ApplyActionsBuilder();
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
+        final ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
+        final ApplyActionsBuilder actionsBuilder = new ApplyActionsBuilder();
+        final List<Action> actions = new ArrayList<>();
+        final ActionBuilder actionBuilder = new ActionBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(42L));
@@ -151,7 +150,7 @@ public class FlowModInputMessageFactoryTest {
         insBuilder.setInstructionChoice(applyActionsCaseBuilder.build());
         instructions.add(insBuilder.build());
         builder.setInstruction(instructions);
-        FlowModInput message = builder.build();
+        final FlowModInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
 
@@ -223,13 +222,15 @@ public class FlowModInputMessageFactoryTest {
         Assert.assertTrue("Unread data", out.readableBytes() == 0);
     }
 
-    private static FlowModFlags createFlowModFlagsFromBitmap(int input){
-        final Boolean _oFPFFSENDFLOWREM = (input & (1 << 0)) > 0;
-        final Boolean _oFPFFCHECKOVERLAP = (input & (1 << 1)) > 0;
-        final Boolean _oFPFFRESETCOUNTS = (input & (1 << 2)) > 0;
-        final Boolean _oFPFFNOPKTCOUNTS = (input & (1 << 3)) > 0;
-        final Boolean _oFPFFNOBYTCOUNTS = (input & (1 << 4)) > 0;
-        return new FlowModFlags(_oFPFFCHECKOVERLAP, _oFPFFNOBYTCOUNTS, _oFPFFNOPKTCOUNTS, _oFPFFRESETCOUNTS, _oFPFFSENDFLOWREM);
+    @SuppressWarnings("checkstyle:AbbreviationAsWordInName")
+    private static FlowModFlags createFlowModFlagsFromBitmap(int input) {
+        final Boolean _oFPFFSENDFLOWREM = (input & 1 << 0) > 0;
+        final Boolean _oFPFFCHECKOVERLAP = (input & 1 << 1) > 0;
+        final Boolean _oFPFFRESETCOUNTS = (input & 1 << 2) > 0;
+        final Boolean _oFPFFNOPKTCOUNTS = (input & 1 << 3) > 0;
+        final Boolean _oFPFFNOBYTCOUNTS = (input & 1 << 4) > 0;
+        return new FlowModFlags(_oFPFFCHECKOVERLAP, _oFPFFNOBYTCOUNTS, _oFPFFNOPKTCOUNTS, _oFPFFRESETCOUNTS,
+                _oFPFFSENDFLOWREM);
     }
 
 }
index 0ba90a23d946ea3411a41f1546d24119e6202559..3bb61441545551d41a15156bdedccb0ee116903b 100644 (file)
@@ -39,8 +39,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for FlowRemovedMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class FlowRemovedMessageFactoryTest {
     private OFSerializer<FlowRemovedMessage> factory;
@@ -70,7 +71,7 @@ public class FlowRemovedMessageFactoryTest {
         builder.setByteCount(BigInteger.valueOf(1234L));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(InPhyPort.class);
@@ -92,7 +93,7 @@ public class FlowRemovedMessageFactoryTest {
         entries.add(entriesBuilder.build());
         matchBuilder.setMatchEntry(entries);
         builder.setMatch(matchBuilder.build());
-        FlowRemovedMessage message = builder.build();
+        final FlowRemovedMessage message = builder.build();
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
 
         // simulate parent message
index f645944bde1b27c5e74088e7addec125abf94097..cf04d6a5c46ef8f04c2fddd850a31c0549379908 100644 (file)
@@ -33,8 +33,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMaskBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for GetAsyncReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class GetAsyncReplyMessageFactoryTest {
     private OFSerializer<GetAsyncOutput> factory;
@@ -68,7 +69,7 @@ public class GetAsyncReplyMessageFactoryTest {
     }
 
     private static List<PacketInMask> createPacketInMask() {
-        List<PacketInMask> masks = new ArrayList<>();
+        final List<PacketInMask> masks = new ArrayList<>();
         PacketInMaskBuilder builder;
         // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
         builder = new PacketInMaskBuilder();
@@ -87,7 +88,7 @@ public class GetAsyncReplyMessageFactoryTest {
     }
 
     private static List<PortStatusMask> createPortStatusMask() {
-        List<PortStatusMask> masks = new ArrayList<>();
+        final List<PortStatusMask> masks = new ArrayList<>();
         PortStatusMaskBuilder builder;
         builder = new PortStatusMaskBuilder();
         // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
@@ -106,7 +107,7 @@ public class GetAsyncReplyMessageFactoryTest {
     }
 
     private static List<FlowRemovedMask> createFlowRemowedMask() {
-        List<FlowRemovedMask> masks = new ArrayList<>();
+        final List<FlowRemovedMask> masks = new ArrayList<>();
         FlowRemovedMaskBuilder builder;
         // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
         builder = new FlowRemovedMaskBuilder();
index 35f5eef99367f476051fce598cfce739fd036b37..49501e3b2a04a8f0ae3c5ee60dcfa1897c3f8240 100644 (file)
@@ -10,21 +10,21 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for GetConfigInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class GetConfigInputMessageFactoryTest {
 
@@ -33,7 +33,7 @@ public class GetConfigInputMessageFactoryTest {
     private OFSerializer<GetConfigInput> getConfigFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -44,8 +44,7 @@ public class GetConfigInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link GetConfigInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link GetConfigInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV13() throws Exception {
@@ -60,8 +59,7 @@ public class GetConfigInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link GetConfigInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link GetConfigInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV10() throws Exception {
index a6d00adf7ccffb64aa0429c621db257f6e9af173..c14aba571e9fa4f74d1d025f110466d89c821532 100644 (file)
@@ -23,8 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutputBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for GetConfigReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class GetConfigReplyMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 8;
index fdf097c2350d082de6044198bf3d8a90e4f56499..8adb0dfea53a427963358f99459e0a9e09c846e6 100644 (file)
@@ -10,21 +10,21 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for GetFeaturesInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class GetFeaturesInputMessageFactoryTest {
 
@@ -33,7 +33,7 @@ public class GetFeaturesInputMessageFactoryTest {
     private OFSerializer<GetFeaturesInput> featuresFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -44,8 +44,7 @@ public class GetFeaturesInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link GetFeaturesInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link GetFeaturesInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV13() throws Exception {
@@ -60,8 +59,7 @@ public class GetFeaturesInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link GetFeaturesInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link GetFeaturesInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testV10() throws Exception {
index 780e148e2da3fb4369d30fadcb90ac0f5370c214..458cdb4130f6fb716d2ccc6d5fd641d2d1ec1666 100644 (file)
@@ -16,14 +16,16 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder;
 
 /**
+ * Unit tests for GetQueueConfigInputMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -34,7 +36,7 @@ public class GetQueueConfigInputMessageFactoryTest {
     private OFSerializer<GetQueueConfigInput> getQueueFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -45,8 +47,7 @@ public class GetQueueConfigInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link GetQueueConfigInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link GetQueueConfigInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testGetQueueConfigInputMessage() throws Exception {
index 0bdc8675873d99c66a770aa71dcd38acdbbdbec6..2d11e0e8956984cf558f53d6d5470ad660527ebc 100644 (file)
@@ -10,19 +10,20 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInputBuilder;
 
 /**
+ * Unit tests for GetaAsyncRequestMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -33,7 +34,7 @@ public class GetaAsyncRequestMessageFactoryTest {
     private OFSerializer<GetAsyncInput> getAsyncFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -44,8 +45,7 @@ public class GetaAsyncRequestMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link GetAsyncRequestMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link GetAsyncRequestMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testGetAsyncReques() throws Exception {
index bccc198aa8c1616f3e23c1ed7f5ced870e10b543..7be6047af8eefb182d3b6e79ace98a40b67f4f9b 100644 (file)
@@ -10,16 +10,12 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
-import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
@@ -33,8 +29,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsListBuilder;
 
 /**
- * @author timotej.kubas
+ * Unit tests for GroupModInputMessageFactory.
  *
+ * @author timotej.kubas
  */
 public class GroupModInputMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 15;
@@ -43,7 +40,7 @@ public class GroupModInputMessageFactoryTest {
     private GroupModInputMessageFactory groupModFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -53,8 +50,7 @@ public class GroupModInputMessageFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link GroupModInputMessageFactory} for correct translation from POJO
+     * Testing of {@link GroupModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testGroupModInputMessage() throws Exception {
@@ -65,7 +61,7 @@ public class GroupModInputMessageFactoryTest {
         builder.setGroupId(new GroupId(256L));
         List<BucketsList> exp = createBucketsList();
         builder.setBucketsList(exp);
-        GroupModInput message = builder.build();
+        final GroupModInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
 
@@ -89,35 +85,32 @@ public class GroupModInputMessageFactoryTest {
         Assert.assertArrayEquals("Wrong bucketList", exp.toArray(), rec.toArray());
     }
 
-    private static List<BucketsList> createBucketsList(){
-        List<BucketsList> bucketsList = new ArrayList<>();
+    private static List<BucketsList> createBucketsList() {
+        final List<BucketsList> bucketsList = new ArrayList<>();
         BucketsListBuilder bucketsBuilder = new BucketsListBuilder();
-        BucketsList bucket;
         bucketsBuilder.setWeight(10);
         bucketsBuilder.setWatchPort(new PortNumber(65L));
         bucketsBuilder.setWatchGroup(22L);
-        bucket = bucketsBuilder.build();
+        BucketsList bucket = bucketsBuilder.build();
         bucketsList.add(bucket);
         return bucketsList;
     }
 
-    private static List<BucketsList> createBucketsListFromBufer(ByteBuf out){
-        List<BucketsList> bucketsList = new ArrayList<>();
+    private static List<BucketsList> createBucketsListFromBufer(ByteBuf out) {
+        final List<BucketsList> bucketsList = new ArrayList<>();
         BucketsListBuilder bucketsBuilder = new BucketsListBuilder();
-        BucketsList bucket;
         out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
         bucketsBuilder.setWeight(out.readUnsignedShort());
         bucketsBuilder.setWatchPort(new PortNumber(out.readUnsignedInt()));
         bucketsBuilder.setWatchGroup(out.readUnsignedInt());
         out.skipBytes(4);
-        bucket = bucketsBuilder.build();
+        BucketsList bucket = bucketsBuilder.build();
         bucketsList.add(bucket);
         return bucketsList;
     }
 
     /**
-     * Testing of {@link GroupModInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link GroupModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testGroupModInputWithNoBuckets() throws Exception {
@@ -138,4 +131,4 @@ public class GroupModInputMessageFactoryTest {
         Assert.assertEquals("Wrong groupId", message.getGroupId().getValue().intValue(), out.readUnsignedInt());
         Assert.assertTrue("Unexpected data", out.readableBytes() == 0);
     }
-}
\ No newline at end of file
+}
index e9319a96208bfa5ba079df16fd17712fb89d47da..d9ff2039477a1640d007ddd05cbe2e0475897f9d 100644 (file)
@@ -10,20 +10,18 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.HelloElementType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;
@@ -33,8 +31,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * @author michal.polkorab
+ * Unit tests for HelloInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class HelloInputMessageFactoryTest {
 
@@ -43,7 +42,7 @@ public class HelloInputMessageFactoryTest {
     private OFSerializer<HelloInput> helloFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -54,8 +53,7 @@ public class HelloInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link HelloInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link HelloInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testWithoutElementsSet() throws Exception {
@@ -70,8 +68,7 @@ public class HelloInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link HelloInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link HelloInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testWith4BitVersionBitmap() throws Exception {
@@ -92,12 +89,12 @@ public class HelloInputMessageFactoryTest {
         Elements element = readElement(out).get(0);
         Assert.assertEquals("Wrong element type", expectedElement.get(0).getType(), element.getType());
         Elements comparation = createComparationElement(lengthOfBitmap).get(0);
-        Assert.assertArrayEquals("Wrong element bitmap", comparation.getVersionBitmap().toArray(), element.getVersionBitmap().toArray());
+        Assert.assertArrayEquals("Wrong element bitmap", comparation.getVersionBitmap().toArray(),
+                element.getVersionBitmap().toArray());
     }
 
     /**
-     * Testing of {@link HelloInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link HelloInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testWith64BitVersionBitmap() throws Exception {
@@ -118,12 +115,13 @@ public class HelloInputMessageFactoryTest {
         Elements element = readElement(out).get(0);
         Assert.assertEquals("Wrong element type", expectedElement.get(0).getType(), element.getType());
         Elements comparation = createComparationElement(lengthOfBitmap).get(0);
-        Assert.assertArrayEquals("Wrong element bitmap", comparation.getVersionBitmap().toArray(), element.getVersionBitmap().toArray());
+        Assert.assertArrayEquals("Wrong element bitmap", comparation.getVersionBitmap().toArray(),
+                element.getVersionBitmap().toArray());
     }
 
     private static List<Elements> createElement(int lengthOfBitmap) {
         ElementsBuilder elementsBuilder = new ElementsBuilder();
-        List<Elements> elementsList = new ArrayList<>();
+        final List<Elements> elementsList = new ArrayList<>();
         List<Boolean> booleanList = new ArrayList<>();
         for (int i = 0; i < lengthOfBitmap; i++) {
             booleanList.add(true);
@@ -135,14 +133,14 @@ public class HelloInputMessageFactoryTest {
     }
 
     private static List<Elements> createComparationElement(int lengthOfBitmap) {
-        ElementsBuilder elementsBuilder = new ElementsBuilder();
-        List<Elements> elementsList = new ArrayList<>();
+        final ElementsBuilder elementsBuilder = new ElementsBuilder();
+        final List<Elements> elementsList = new ArrayList<>();
         List<Boolean> booleanList = new ArrayList<>();
         for (int i = 0; i < lengthOfBitmap; i++) {
             booleanList.add(true);
         }
-        if ((lengthOfBitmap % Integer.SIZE) != 0) {
-            for (int i = 0; i < (Integer.SIZE - (lengthOfBitmap % Integer.SIZE)); i++) {
+        if (lengthOfBitmap % Integer.SIZE != 0) {
+            for (int i = 0; i < Integer.SIZE - lengthOfBitmap % Integer.SIZE; i++) {
                 booleanList.add(false);
             }
         }
@@ -176,12 +174,11 @@ public class HelloInputMessageFactoryTest {
         return elementsList;
     }
 
-    private static List<Boolean> readVersionBitmap(int[] input){
+    private static List<Boolean> readVersionBitmap(int[] input) {
         List<Boolean> versionBitmapList = new ArrayList<>();
-        for (int i = 0; i < input.length; i++) {
-            int mask = input[i];
+        for (int mask : input) {
             for (int j = 0; j < Integer.SIZE; j++) {
-                    versionBitmapList.add((mask & (1<<j)) != 0);
+                versionBitmapList.add((mask & 1 << j) != 0);
             }
         }
         return versionBitmapList;
index 0db9c8dac57a9ea37fd6c5ecb6d1364df2e2a6ee..2b507baafd0f4d47cebd6472b5a3c224e014186c 100644 (file)
@@ -21,8 +21,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for HelloMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class HelloMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 0;
index 115c0755da48db87a6376ba9c5cc37862b640977..7e0715dc0b0dc912964db406c4b057d1f118913b 100644 (file)
@@ -10,19 +10,17 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterBandType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId;
@@ -37,6 +35,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.mod.BandsBuilder;
 
 /**
+ * Unit tests for MeterModInputMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -46,7 +46,7 @@ public class MeterModInputMessageFactoryTest {
     private OFSerializer<MeterModInput> meterModFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -57,8 +57,7 @@ public class MeterModInputMessageFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MeterModInputMessageFactory} for correct translation from POJO
+     * Testing of {@link MeterModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testMeterModInputMessage() throws Exception {
@@ -80,25 +79,26 @@ public class MeterModInputMessageFactoryTest {
         Assert.assertEquals("Wrong bands", message.getBands(), decodeBandsList(out));
     }
 
-    private static MeterFlags decodeMeterModFlags(short input){
-        final Boolean _oFPMFKBPS = (input & (1 << 0)) > 0;
-        final Boolean _oFPMFPKTPS = (input & (1 << 1)) > 0;
-        final Boolean _oFPMFBURST = (input & (1 << 2)) > 0;
-        final Boolean _oFPMFSTATS = (input & (1 << 3)) > 0;
+    @SuppressWarnings("checkstyle:AbbreviationAsWordInName")
+    private static MeterFlags decodeMeterModFlags(short input) {
+        final Boolean _oFPMFKBPS = (input & 1 << 0) > 0;
+        final Boolean _oFPMFPKTPS = (input & 1 << 1) > 0;
+        final Boolean _oFPMFBURST = (input & 1 << 2) > 0;
+        final Boolean _oFPMFSTATS = (input & 1 << 3) > 0;
         return new MeterFlags(_oFPMFBURST, _oFPMFKBPS, _oFPMFPKTPS, _oFPMFSTATS);
     }
 
-    private static List<Bands> createBandsList(){
-        List<Bands> bandsList = new ArrayList<>();
-        BandsBuilder bandsBuilder = new BandsBuilder();
-        MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
+    private static List<Bands> createBandsList() {
+        final List<Bands> bandsList = new ArrayList<>();
+        final BandsBuilder bandsBuilder = new BandsBuilder();
+        final MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.OFPMBTDROP);
         dropBand.setRate(1L);
         dropBand.setBurstSize(2L);
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
-        MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
+        final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.OFPMBTDSCPREMARK);
         dscpRemarkBand.setRate(1L);
@@ -109,22 +109,22 @@ public class MeterModInputMessageFactoryTest {
         return bandsList;
     }
 
-    private static List<Bands> decodeBandsList(ByteBuf input){
-        List<Bands> bandsList = new ArrayList<>();
-        BandsBuilder bandsBuilder = new BandsBuilder();
-        MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
+    private static List<Bands> decodeBandsList(ByteBuf input) {
+        final List<Bands> bandsList = new ArrayList<>();
+        final BandsBuilder bandsBuilder = new BandsBuilder();
+        final MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
-        input.skipBytes(Short.SIZE/Byte.SIZE);
+        input.skipBytes(Short.SIZE / Byte.SIZE);
         dropBand.setRate(input.readUnsignedInt());
         dropBand.setBurstSize(input.readUnsignedInt());
         input.skipBytes(4);
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
-        MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
+        final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
-        input.skipBytes(Short.SIZE/Byte.SIZE);
+        input.skipBytes(Short.SIZE / Byte.SIZE);
         dscpRemarkBand.setRate(input.readUnsignedInt());
         dscpRemarkBand.setBurstSize(input.readUnsignedInt());
         dscpRemarkBand.setPrecLevel(input.readUnsignedByte());
@@ -135,8 +135,7 @@ public class MeterModInputMessageFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MeterModInputMessageFactory} for correct translation from POJO
+     * Testing of {@link MeterModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testMeterModInputMessageWithNoBands() throws Exception {
@@ -157,4 +156,4 @@ public class MeterModInputMessageFactoryTest {
         Assert.assertEquals("Wrong meterId", message.getMeterId().getValue().intValue(), out.readUnsignedInt());
         Assert.assertTrue("Unexpected data", out.readableBytes() == 0);
     }
-}
\ No newline at end of file
+}
index a6e18bde8069c7463f2a3c0ad5d91eb26c5afbd7..72d6d88bc48585482026b02c031eeb8adc6ccbbb 100644 (file)
@@ -178,8 +178,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeaturePropertiesBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for MultipartReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class MultipartReplyMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 19;
@@ -201,9 +202,9 @@ public class MultipartReplyMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setFlags(new MultipartRequestFlags(true));
         builder.setType(MultipartType.forValue(12));
-        MultipartReplyTableFeaturesCaseBuilder caseBuilder = new MultipartReplyTableFeaturesCaseBuilder();
-        MultipartReplyTableFeaturesBuilder featuresBuilder = new MultipartReplyTableFeaturesBuilder();
-        List<TableFeatures> tableFeaturesList = new ArrayList<>();
+        final MultipartReplyTableFeaturesCaseBuilder caseBuilder = new MultipartReplyTableFeaturesCaseBuilder();
+        final MultipartReplyTableFeaturesBuilder featuresBuilder = new MultipartReplyTableFeaturesBuilder();
+        final List<TableFeatures> tableFeaturesList = new ArrayList<>();
         TableFeaturesBuilder tableFeaturesBuilder = new TableFeaturesBuilder();
         tableFeaturesBuilder.setTableId((short) 8);
         tableFeaturesBuilder.setName("AAAABBBBCCCCDDDDEEEEFFFFGGGG");
@@ -211,7 +212,6 @@ public class MultipartReplyMessageFactoryTest {
         tableFeaturesBuilder.setMetadataWrite(new byte[] { 0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01 });
         tableFeaturesBuilder.setConfig(new TableConfig(true));
         tableFeaturesBuilder.setMaxEntries(65L);
-        List<TableFeatureProperties> properties = new ArrayList<>();
         TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTNEXTTABLES);
         NextTableRelatedTableFeaturePropertyBuilder nextPropBuilder = new NextTableRelatedTableFeaturePropertyBuilder();
@@ -220,6 +220,7 @@ public class MultipartReplyMessageFactoryTest {
         nextIds.add(new NextTableIdsBuilder().setTableId((short) 2).build());
         nextPropBuilder.setNextTableIds(nextIds);
         propBuilder.addAugmentation(NextTableRelatedTableFeatureProperty.class, nextPropBuilder.build());
+        List<TableFeatureProperties> properties = new ArrayList<>();
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTNEXTTABLESMISS);
@@ -230,7 +231,6 @@ public class MultipartReplyMessageFactoryTest {
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTINSTRUCTIONS);
-        InstructionRelatedTableFeaturePropertyBuilder insPropBuilder = new InstructionRelatedTableFeaturePropertyBuilder();
         List<Instruction> insIds = new ArrayList<>();
         InstructionBuilder insBuilder = new InstructionBuilder();
         insBuilder.setInstructionChoice(new WriteActionsCaseBuilder().build());
@@ -238,6 +238,8 @@ public class MultipartReplyMessageFactoryTest {
         insBuilder = new InstructionBuilder();
         insBuilder.setInstructionChoice(new GotoTableCaseBuilder().build());
         insIds.add(insBuilder.build());
+        InstructionRelatedTableFeaturePropertyBuilder insPropBuilder =
+                new InstructionRelatedTableFeaturePropertyBuilder();
         insPropBuilder.setInstruction(insIds);
         propBuilder.addAugmentation(InstructionRelatedTableFeatureProperty.class, insPropBuilder.build());
         properties.add(propBuilder.build());
@@ -308,18 +310,18 @@ public class MultipartReplyMessageFactoryTest {
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTMATCH);
-        OxmRelatedTableFeaturePropertyBuilder oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
-        List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(InPhyPort.class);
         entriesBuilder.setHasMask(false);
+        List<MatchEntry> entries = new ArrayList<>();
         entries.add(entriesBuilder.build());
         entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(InPort.class);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
+        OxmRelatedTableFeaturePropertyBuilder oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
         oxmBuilder.setMatchEntry(entries);
         propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
         properties.add(propBuilder.build());
@@ -539,7 +541,7 @@ public class MultipartReplyMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setFlags(new MultipartRequestFlags(true));
         builder.setType(MultipartType.forValue(11));
-        MultipartReplyMeterFeaturesCaseBuilder meterFeaturesCase = new MultipartReplyMeterFeaturesCaseBuilder();
+        final MultipartReplyMeterFeaturesCaseBuilder meterFeaturesCase = new MultipartReplyMeterFeaturesCaseBuilder();
         MultipartReplyMeterFeaturesBuilder meterFeatures = new MultipartReplyMeterFeaturesBuilder();
         meterFeatures.setMaxMeter(1L);
         meterFeatures.setBandTypes(new MeterBandTypeBitmap(true, false));
@@ -644,7 +646,7 @@ public class MultipartReplyMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setFlags(new MultipartRequestFlags(true));
         builder.setType(MultipartType.forValue(8));
-        MultipartReplyGroupFeaturesCaseBuilder featureCase = new MultipartReplyGroupFeaturesCaseBuilder();
+        final MultipartReplyGroupFeaturesCaseBuilder featureCase = new MultipartReplyGroupFeaturesCaseBuilder();
         MultipartReplyGroupFeaturesBuilder feature = new MultipartReplyGroupFeaturesBuilder();
         feature.setTypes(new GroupTypes(true, false, true, false));
         feature.setCapabilities(new GroupCapabilities(true, false, true, true));
@@ -888,7 +890,7 @@ public class MultipartReplyMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setFlags(new MultipartRequestFlags(true));
         builder.setType(MultipartType.forValue(2));
-        MultipartReplyAggregateCaseBuilder aggregateCase = new MultipartReplyAggregateCaseBuilder();
+        final MultipartReplyAggregateCaseBuilder aggregateCase = new MultipartReplyAggregateCaseBuilder();
         MultipartReplyAggregateBuilder aggregate = new MultipartReplyAggregateBuilder();
         aggregate.setPacketCount(BigInteger.valueOf(1L));
         aggregate.setByteCount(BigInteger.valueOf(1L));
@@ -940,7 +942,7 @@ public class MultipartReplyMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setFlags(new MultipartRequestFlags(true));
         builder.setType(MultipartType.forValue(0));
-        MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
+        final MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
         MultipartReplyDescBuilder desc = new MultipartReplyDescBuilder();
         desc.setMfrDesc("Test");
         desc.setHwDesc("Test");
@@ -1060,45 +1062,45 @@ public class MultipartReplyMessageFactoryTest {
     }
 
     private static PortConfig createPortConfig(long input) {
-        final Boolean _portDown = ((input) & (1 << 0)) > 0;
-        final Boolean _noRecv = ((input) & (1 << 2)) > 0;
-        final Boolean _noFwd = ((input) & (1 << 5)) > 0;
-        final Boolean _noPacketIn = ((input) & (1 << 6)) > 0;
+        final Boolean _portDown = (input & 1 << 0) > 0;
+        final Boolean _noRecv = (input & 1 << 2) > 0;
+        final Boolean _noFwd = (input & 1 << 5) > 0;
+        final Boolean _noPacketIn = (input & 1 << 6) > 0;
         return new PortConfig(_noFwd, _noPacketIn, _noRecv, _portDown);
     }
 
     private static PortFeatures createPortFeatures(long input) {
-        final Boolean _10mbHd = ((input) & (1 << 0)) > 0;
-        final Boolean _10mbFd = ((input) & (1 << 1)) > 0;
-        final Boolean _100mbHd = ((input) & (1 << 2)) > 0;
-        final Boolean _100mbFd = ((input) & (1 << 3)) > 0;
-        final Boolean _1gbHd = ((input) & (1 << 4)) > 0;
-        final Boolean _1gbFd = ((input) & (1 << 5)) > 0;
-        final Boolean _10gbFd = ((input) & (1 << 6)) > 0;
-        final Boolean _40gbFd = ((input) & (1 << 7)) > 0;
-        final Boolean _100gbFd = ((input) & (1 << 8)) > 0;
-        final Boolean _1tbFd = ((input) & (1 << 9)) > 0;
-        final Boolean _other = ((input) & (1 << 10)) > 0;
-        final Boolean _copper = ((input) & (1 << 11)) > 0;
-        final Boolean _fiber = ((input) & (1 << 12)) > 0;
-        final Boolean _autoneg = ((input) & (1 << 13)) > 0;
-        final Boolean _pause = ((input) & (1 << 14)) > 0;
-        final Boolean _pauseAsym = ((input) & (1 << 15)) > 0;
+        final Boolean _10mbHd = (input & 1 << 0) > 0;
+        final Boolean _10mbFd = (input & 1 << 1) > 0;
+        final Boolean _100mbHd = (input & 1 << 2) > 0;
+        final Boolean _100mbFd = (input & 1 << 3) > 0;
+        final Boolean _1gbHd = (input & 1 << 4) > 0;
+        final Boolean _1gbFd = (input & 1 << 5) > 0;
+        final Boolean _10gbFd = (input & 1 << 6) > 0;
+        final Boolean _40gbFd = (input & 1 << 7) > 0;
+        final Boolean _100gbFd = (input & 1 << 8) > 0;
+        final Boolean _1tbFd = (input & 1 << 9) > 0;
+        final Boolean _other = (input & 1 << 10) > 0;
+        final Boolean _copper = (input & 1 << 11) > 0;
+        final Boolean _fiber = (input & 1 << 12) > 0;
+        final Boolean _autoneg = (input & 1 << 13) > 0;
+        final Boolean _pause = (input & 1 << 14) > 0;
+        final Boolean _pauseAsym = (input & 1 << 15) > 0;
         return new PortFeatures(_100gbFd, _100mbFd, _100mbHd, _10gbFd, _10mbFd, _10mbHd, _1gbFd, _1gbHd, _1tbFd,
                 _40gbFd, _autoneg, _copper, _fiber, _other, _pause, _pauseAsym);
     }
 
     private static PortState createPortState(long input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
-        final Boolean two = ((input) & (1 << 1)) > 0;
-        final Boolean three = ((input) & (1 << 2)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
+        final Boolean three = (input & 1 << 2) > 0;
         return new PortState(two, one, three);
     }
 
     private static List<Bands> decodeBandsList(ByteBuf input) {
-        List<Bands> bandsList = new ArrayList<>();
-        BandsBuilder bandsBuilder = new BandsBuilder();
-        MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
+        final List<Bands> bandsList = new ArrayList<>();
+        final BandsBuilder bandsBuilder = new BandsBuilder();
+        final MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
         input.skipBytes(Short.SIZE / Byte.SIZE);
@@ -1106,7 +1108,7 @@ public class MultipartReplyMessageFactoryTest {
         dropBand.setBurstSize(input.readUnsignedInt());
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
-        MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
+        final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
         input.skipBytes(Short.SIZE / Byte.SIZE);
@@ -1129,22 +1131,22 @@ public class MultipartReplyMessageFactoryTest {
     }
 
     private static MeterBandTypeBitmap createMeterBandTypeBitmap(int input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
-        final Boolean two = ((input) & (1 << 1)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
         return new MeterBandTypeBitmap(one, two);
     }
 
     private static List<Bands> createBandsList() {
-        List<Bands> bandsList = new ArrayList<>();
-        BandsBuilder bandsBuilder = new BandsBuilder();
-        MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
+        final List<Bands> bandsList = new ArrayList<>();
+        final BandsBuilder bandsBuilder = new BandsBuilder();
+        final MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.OFPMBTDROP);
         dropBand.setRate(1L);
         dropBand.setBurstSize(2L);
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
-        MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
+        final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.OFPMBTDSCPREMARK);
         dscpRemarkBand.setRate(1L);
@@ -1156,10 +1158,10 @@ public class MultipartReplyMessageFactoryTest {
     }
 
     private static MeterFlags createMeterFlags(int input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
-        final Boolean two = ((input) & (1 << 1)) > 0;
-        final Boolean three = ((input) & (1 << 2)) > 0;
-        final Boolean four = ((input) & (1 << 3)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
+        final Boolean three = (input & 1 << 2) > 0;
+        final Boolean four = (input & 1 << 3) > 0;
         return new MeterFlags(three, one, two, four);
     }
 
@@ -1187,43 +1189,27 @@ public class MultipartReplyMessageFactoryTest {
     }
 
     private static ActionType createActionType(int input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
-        final Boolean two = ((input) & (1 << 1)) > 0;
-        final Boolean three = ((input) & (1 << 2)) > 0;
-        final Boolean four = ((input) & (1 << 3)) > 0;
-        final Boolean five = ((input) & (1 << 4)) > 0;
-        final Boolean six = ((input) & (1 << 5)) > 0;
-        final Boolean seven = ((input) & (1 << 6)) > 0;
-        final Boolean eight = ((input) & (1 << 7)) > 0;
-        final Boolean nine = ((input) & (1 << 8)) > 0;
-        final Boolean ten = ((input) & (1 << 9)) > 0;
-        final Boolean eleven = ((input) & (1 << 10)) > 0;
-        final Boolean twelve = ((input) & (1 << 11)) > 0;
-        final Boolean thirteen = ((input) & (1 << 12)) > 0;
-        final Boolean fourteen = ((input) & (1 << 13)) > 0;
-        final Boolean fifthteen = ((input) & (1 << 14)) > 0;
-        final Boolean sixteen = ((input) & (1 << 15)) > 0;
-        final Boolean seventeen = ((input) & (1 << 16)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
+        final Boolean three = (input & 1 << 2) > 0;
+        final Boolean four = (input & 1 << 3) > 0;
+        final Boolean five = (input & 1 << 4) > 0;
+        final Boolean six = (input & 1 << 5) > 0;
+        final Boolean seven = (input & 1 << 6) > 0;
+        final Boolean eight = (input & 1 << 7) > 0;
+        final Boolean nine = (input & 1 << 8) > 0;
+        final Boolean ten = (input & 1 << 9) > 0;
+        final Boolean eleven = (input & 1 << 10) > 0;
+        final Boolean twelve = (input & 1 << 11) > 0;
+        final Boolean thirteen = (input & 1 << 12) > 0;
+        final Boolean fourteen = (input & 1 << 13) > 0;
+        final Boolean fifthteen = (input & 1 << 14) > 0;
+        final Boolean sixteen = (input & 1 << 15) > 0;
+        final Boolean seventeen = (input & 1 << 16) > 0;
         return new ActionType(three, two, five, thirteen, seventeen, eleven, one, nine, sixteen, seven, eight,
                 fifthteen, six, fourteen, four, twelve, ten);
     }
 
-    private static GroupCapabilities createGroupCapabilities(int input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
-        final Boolean two = ((input) & (1 << 1)) > 0;
-        final Boolean three = ((input) & (1 << 2)) > 0;
-        final Boolean four = ((input) & (1 << 3)) > 0;
-        return new GroupCapabilities(three, four, two, one);
-    }
-
-    private static GroupTypes createGroupTypes(int input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
-        final Boolean two = ((input) & (1 << 1)) > 0;
-        final Boolean three = ((input) & (1 << 2)) > 0;
-        final Boolean four = ((input) & (1 << 3)) > 0;
-        return new GroupTypes(one, four, three, two);
-    }
-
     private static List<ActionType> createActionType() {
         ActionType actionType1 = new ActionType(true, false, true, false, true, false, true, false, true, false, true,
                 false, true, false, true, false, true);
@@ -1242,6 +1228,22 @@ public class MultipartReplyMessageFactoryTest {
 
     }
 
+    private static GroupCapabilities createGroupCapabilities(int input) {
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
+        final Boolean three = (input & 1 << 2) > 0;
+        final Boolean four = (input & 1 << 3) > 0;
+        return new GroupCapabilities(three, four, two, one);
+    }
+
+    private static GroupTypes createGroupTypes(int input) {
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
+        final Boolean three = (input & 1 << 2) > 0;
+        final Boolean four = (input & 1 << 3) > 0;
+        return new GroupTypes(one, four, three, two);
+    }
+
     private static List<GroupDesc> createGroupDesc() {
         GroupDescBuilder builder = new GroupDescBuilder();
         builder.setType(GroupType.forValue(1));
@@ -1278,13 +1280,13 @@ public class MultipartReplyMessageFactoryTest {
     }
 
     private static List<Action> createActionList() {
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
+        final List<Action> actions = new ArrayList<>();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(45L));
         outputBuilder.setMaxLength(55);
         caseBuilder.setOutputAction(outputBuilder.build());
+        ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
@@ -1337,7 +1339,7 @@ public class MultipartReplyMessageFactoryTest {
         builder.setCollisions(BigInteger.valueOf(1L));
         builder.setDurationSec(1L);
         builder.setDurationNsec(1L);
-        List<PortStats> list = new ArrayList<PortStats>();
+        List<PortStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
     }
@@ -1348,7 +1350,7 @@ public class MultipartReplyMessageFactoryTest {
         builder.setActiveCount(1L);
         builder.setLookupCount(BigInteger.valueOf(1L));
         builder.setMatchedCount(BigInteger.valueOf(1L));
-        List<TableStats> list = new ArrayList<TableStats>();
+        List<TableStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
     }
@@ -1366,7 +1368,7 @@ public class MultipartReplyMessageFactoryTest {
         builder.setByteCount(BigInteger.valueOf(1234L));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(InPhyPort.class);
@@ -1388,7 +1390,7 @@ public class MultipartReplyMessageFactoryTest {
         entries.add(entriesBuilder.build());
         matchBuilder.setMatchEntry(entries);
         builder.setMatch(matchBuilder.build());
-        List<Instruction> instructions = new ArrayList<>();
+        final List<Instruction> instructions = new ArrayList<>();
         // Goto_table instruction
         InstructionBuilder builderInstruction = new InstructionBuilder();
         GotoTableCaseBuilder gotoCaseBuilder = new GotoTableCaseBuilder();
@@ -1420,16 +1422,16 @@ public class MultipartReplyMessageFactoryTest {
         instructions.add(builderInstruction.build());
         // Write_actions instruction
         builderInstruction = new InstructionBuilder();
-        WriteActionsCaseBuilder writeActionsCaseBuilder = new WriteActionsCaseBuilder();
-        WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
+        final WriteActionsCaseBuilder writeActionsCaseBuilder = new WriteActionsCaseBuilder();
+        final WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(45L));
         outputBuilder.setMaxLength(55);
         caseBuilder.setOutputAction(outputBuilder.build());
+        ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
+        List<Action> actions = new ArrayList<>();
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
@@ -1444,8 +1446,8 @@ public class MultipartReplyMessageFactoryTest {
         instructions.add(builderInstruction.build());
         // Apply_actions instruction
         builderInstruction = new InstructionBuilder();
-        ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
-        ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
+        final ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
+        final ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
         actions = new ArrayList<>();
         actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder vlanCaseBuilder = new PushVlanCaseBuilder();
@@ -1462,18 +1464,18 @@ public class MultipartReplyMessageFactoryTest {
         builderInstruction.setInstructionChoice(applyActionsCaseBuilder.build());
         instructions.add(builderInstruction.build());
         builder.setInstruction(instructions);
-        List<FlowStats> list = new ArrayList<FlowStats>();
+        List<FlowStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
     }
 
     private static MultipartRequestFlags createMultipartRequestFlags(int input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
         return new MultipartRequestFlags(one);
     }
 
     private static MultipartReplyDescCase decodeDescBody(ByteBuf output) {
-        MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
+        final MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
         MultipartReplyDescBuilder desc = new MultipartReplyDescBuilder();
         byte[] mfrDesc = new byte[256];
         output.readBytes(mfrDesc);
index f87a18a07144bf819b2756e96e67d514848308c3..e06c39bfa53ef4252a0515e97beb8bdd9b9e0c42 100644 (file)
@@ -10,18 +10,16 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.math.BigInteger;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
@@ -54,17 +52,28 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder;
 
 /**
+ * Unit tests for MultipartRequestInputFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
 public class MultipartRequestInputFactoryTest {
-    /** padding in MultipartRequest message */
+    static final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01 = 3;
+    static final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02 = 4;
+    static final byte PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY = 4;
+    static final byte PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_01 = 3;
+    static final byte PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_02 = 4;
+    static final byte PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY = 4;
+    static final byte PADDING_IN_MULTIPART_REQUEST_GROUP_BODY = 4;
+    static final byte PADDING_IN_MULTIPART_REQUEST_METER_BODY = 4;
+
+    /** padding in MultipartRequest message. */
     public static final byte PADDING_IN_MULTIPART_REQUEST_MESSAGE = 4;
     private SerializerRegistry registry;
     private OFSerializer<MultipartRequestInput> multipartFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -75,8 +84,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestFlowInputFactory() throws Exception {
@@ -98,7 +106,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     private static MultipartRequestFlowCase createRequestFlow() {
-        MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
+        final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
         MultipartRequestFlowBuilder builder = new MultipartRequestFlowBuilder();
         builder.setTableId((short) 8);
         builder.setOutPort(85L);
@@ -113,9 +121,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     private static MultipartRequestFlowCase decodeRequestFlow(ByteBuf output) {
-        final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01 = 3;
-        final byte PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02 = 4;
-        MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
+        final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
         MultipartRequestFlowBuilder builder = new MultipartRequestFlowBuilder();
         builder.setTableId(output.readUnsignedByte());
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
@@ -133,8 +139,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestInputAggregateBodyFactory() throws Exception {
@@ -155,14 +160,15 @@ public class MultipartRequestInputFactoryTest {
         Assert.assertEquals("Wrong aggregate", message.getMultipartRequestBody(), decodeRequestAggregate(out));
     }
 
-    private static MultipartRequestFlags decodeMultipartRequestFlags(short input){
-        final Boolean _oFPMPFREQMORE = (input & (1 << 0)) > 0;
+    @SuppressWarnings("checkstyle:AbbreviationAsWordInName")
+    private static MultipartRequestFlags decodeMultipartRequestFlags(short input) {
+        final Boolean _oFPMPFREQMORE = (input & 1 << 0) > 0;
         return new MultipartRequestFlags(_oFPMPFREQMORE);
     }
 
 
     private static MultipartRequestAggregateCase createRequestAggregate() {
-        MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
+        final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
         MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
         builder.setTableId((short) 8);
         builder.setOutPort(85L);
@@ -177,9 +183,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     private static MultipartRequestAggregateCase decodeRequestAggregate(ByteBuf output) {
-        final byte PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_01 = 3;
-        final byte PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_02 = 4;
-        MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
+        final  MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
         MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
         builder.setTableId(output.readUnsignedByte());
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_01);
@@ -197,8 +201,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestInputTableFactory() throws Exception {
@@ -219,8 +222,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestPortStatsMessageFactory() throws Exception {
@@ -250,7 +252,6 @@ public class MultipartRequestInputFactoryTest {
     }
 
     private static MultipartRequestPortStatsCase decodeRequestPortStats(ByteBuf output) {
-        final byte PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY = 4;
         MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder builder = new MultipartRequestPortStatsBuilder();
         builder.setPortNo(output.readUnsignedInt());
@@ -260,8 +261,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestQueueMessageFactory() throws Exception {
@@ -301,8 +301,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestGroupMessageFactory() throws Exception {
@@ -332,7 +331,6 @@ public class MultipartRequestInputFactoryTest {
     }
 
     private static MultipartRequestGroupCase decodeRequestGroup(ByteBuf output) {
-        final byte PADDING_IN_MULTIPART_REQUEST_GROUP_BODY = 4;
         MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
         MultipartRequestGroupBuilder builder = new MultipartRequestGroupBuilder();
         builder.setGroupId(new GroupId(output.readUnsignedInt()));
@@ -342,8 +340,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestMeterMessageFactory() throws Exception {
@@ -373,7 +370,6 @@ public class MultipartRequestInputFactoryTest {
     }
 
     private static MultipartRequestMeterCase decodeRequestMeter(ByteBuf output) {
-        final byte PADDING_IN_MULTIPART_REQUEST_METER_BODY = 4;
         MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
         MultipartRequestMeterBuilder builder = new MultipartRequestMeterBuilder();
         builder.setMeterId(new MeterId(output.readUnsignedInt()));
@@ -383,8 +379,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestMeterConfigMessageFactory() throws Exception {
@@ -414,7 +409,6 @@ public class MultipartRequestInputFactoryTest {
     }
 
     private static MultipartRequestMeterConfigCase decodeRequestMeterConfig(ByteBuf output) {
-        final byte PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY = 4;
         MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
         MultipartRequestMeterConfigBuilder builder = new MultipartRequestMeterConfigBuilder();
         builder.setMeterId(new MeterId(output.readUnsignedInt()));
@@ -424,8 +418,7 @@ public class MultipartRequestInputFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO
+     * Testing of {@link MultipartRequestInputFactory} for correct translation from POJO.
      */
     @Test
     public void testMultipartRequestDescMessageFactory() throws Exception {
index cc31a00e8436143fb40fe9d7e5f8f4646e0d2a13..95da585afa344be8d434269db39d5cf32b0e7f4a 100644 (file)
@@ -10,21 +10,21 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10BarrierInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class OF10BarrierInputMessageFactoryTest {
 
@@ -32,7 +32,7 @@ public class OF10BarrierInputMessageFactoryTest {
     private OFSerializer<BarrierInput> barrierFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -43,8 +43,7 @@ public class OF10BarrierInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link OF10BarrierInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link OF10BarrierInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void test() throws Exception {
index 7ec4e44643ce5d2f94ded73a52e0b0c3de79311b..3b3817d126c2db18fc00aa11e3cbafd1ef79b8a2 100644 (file)
@@ -21,8 +21,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for OF10BarrierReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10BarrierReplyMessageFactoryTest {
     private OFSerializer<BarrierOutput> factory;
index ecfbcad5593217d6e230cb94d5f236a604702d52..501087ffa9ecc58d0575931288e8af6d2bcdfef3 100644 (file)
@@ -34,8 +34,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPortBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for OF10FeaturesReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10FeaturesReplyMessageFactoryTest {
     private OFSerializer<GetFeaturesOutput> factory;
@@ -94,7 +95,7 @@ public class OF10FeaturesReplyMessageFactoryTest {
     }
 
     private static List<PhyPort> createPorts() {
-        List<PhyPort> ports = new ArrayList<>();
+        final List<PhyPort> ports = new ArrayList<>();
         PhyPortBuilder builder = new PhyPortBuilder();
         builder.setPortNo(1L);
         builder.setHwAddr(new MacAddress("94:de:80:a6:61:40"));
@@ -114,72 +115,74 @@ public class OF10FeaturesReplyMessageFactoryTest {
     }
 
     private static PortConfigV10 createPortConfig(long input) {
-        final Boolean _portDown = ((input) & (1 << 0)) > 0;
-        final Boolean _noStp = ((input) & (1 << 1)) > 0;
-        final Boolean _noRecv = ((input) & (1 << 2)) > 0;
-        final Boolean _noRecvStp = ((input) & (1 << 3)) > 0;
-        final Boolean _noFlood = ((input) & (1 << 4)) > 0;
-        final Boolean _noFwd = ((input) & (1 << 5)) > 0;
-        final Boolean _noPacketIn = ((input) & (1 << 6)) > 0;
+        final Boolean _portDown = (input & 1 << 0) > 0;
+        final Boolean _noStp = (input & 1 << 1) > 0;
+        final Boolean _noRecv = (input & 1 << 2) > 0;
+        final Boolean _noRecvStp = (input & 1 << 3) > 0;
+        final Boolean _noFlood = (input & 1 << 4) > 0;
+        final Boolean _noFwd = (input & 1 << 5) > 0;
+        final Boolean _noPacketIn = (input & 1 << 6) > 0;
         return new PortConfigV10(_noFlood, _noFwd, _noPacketIn, _noRecv, _noRecvStp, _noStp, _portDown);
     }
 
     private static PortFeaturesV10 createPortFeatures(long input) {
-        final Boolean _10mbHd = ((input) & (1 << 0)) > 0;
-        final Boolean _10mbFd = ((input) & (1 << 1)) > 0;
-        final Boolean _100mbHd = ((input) & (1 << 2)) > 0;
-        final Boolean _100mbFd = ((input) & (1 << 3)) > 0;
-        final Boolean _1gbHd = ((input) & (1 << 4)) > 0;
-        final Boolean _1gbFd = ((input) & (1 << 5)) > 0;
-        final Boolean _10gbFd = ((input) & (1 << 6)) > 0;
-        final Boolean _copper = ((input) & (1 << 7)) > 0;
-        final Boolean _fiber = ((input) & (1 << 8)) > 0;
-        final Boolean _autoneg = ((input) & (1 << 9)) > 0;
-        final Boolean _pause = ((input) & (1 << 10)) > 0;
-        final Boolean _pauseAsym = ((input) & (1 << 11)) > 0;
+        final Boolean _10mbHd = (input & 1 << 0) > 0;
+        final Boolean _10mbFd = (input & 1 << 1) > 0;
+        final Boolean _100mbHd = (input & 1 << 2) > 0;
+        final Boolean _100mbFd = (input & 1 << 3) > 0;
+        final Boolean _1gbHd = (input & 1 << 4) > 0;
+        final Boolean _1gbFd = (input & 1 << 5) > 0;
+        final Boolean _10gbFd = (input & 1 << 6) > 0;
+        final Boolean _copper = (input & 1 << 7) > 0;
+        final Boolean _fiber = (input & 1 << 8) > 0;
+        final Boolean _autoneg = (input & 1 << 9) > 0;
+        final Boolean _pause = (input & 1 << 10) > 0;
+        final Boolean _pauseAsym = (input & 1 << 11) > 0;
         return new PortFeaturesV10(_100mbFd, _100mbHd, _10gbFd, _10mbFd, _10mbHd, _1gbFd, _1gbHd, _autoneg, _copper,
                 _fiber, _pause, _pauseAsym);
     }
 
     private static PortStateV10 createPortState(long input) {
-        final Boolean _linkDown = ((input) & (1 << 0)) > 0;
-        final Boolean _blocked = ((input) & (1 << 1)) > 0;
-        final Boolean _live = ((input) & (1 << 2)) > 0;
-        final Boolean _stpListen = ((input) & (1 << 3)) > 0;
-        final Boolean _stpLearn = ((input) & (1 << 4)) > 0;
-        final Boolean _stpForward = ((input) & (1 << 5)) > 0;
-        final Boolean _stpBlock = ((input) & (1 << 6)) > 0;
-        final Boolean _stpMask = ((input) & (1 << 7)) > 0;
+        final Boolean _linkDown = (input & 1 << 0) > 0;
+        final Boolean _blocked = (input & 1 << 1) > 0;
+        final Boolean _live = (input & 1 << 2) > 0;
+        final Boolean _stpListen = (input & 1 << 3) > 0;
+        final Boolean _stpLearn = (input & 1 << 4) > 0;
+        final Boolean _stpForward = (input & 1 << 5) > 0;
+        final Boolean _stpBlock = (input & 1 << 6) > 0;
+        final Boolean _stpMask = (input & 1 << 7) > 0;
         return new PortStateV10(_blocked, _linkDown, _live, _stpBlock, _stpForward, _stpLearn, _stpListen, _stpMask);
     }
 
+    @SuppressWarnings("checkstyle:AbbreviationAsWordInName")
     private static CapabilitiesV10 createCapabilities(long input) {
-        Boolean _oFPCFLOWSTATS = ((input) & (1 << 0)) > 0;
-        Boolean _oFPCTABLESTATS = ((input) & (1 << 1)) > 0;
-        Boolean _oFPCPORTSTATS = ((input) & (1 << 2)) > 0;
-        Boolean _oFPCSTP = ((input) & (1 << 3)) > 0;
-        Boolean _oFPCRESERVED = ((input) & (1 << 4)) > 0;
-        Boolean _oFPCIPREASM = ((input) & (1 << 5)) > 0;
-        Boolean _oFPCQUEUESTATS = ((input) & (1 << 6)) > 0;
-        Boolean _oFPCARPMATCHIP = ((input) & (1 << 7)) > 0;
+        final Boolean _oFPCFLOWSTATS = (input & 1 << 0) > 0;
+        final Boolean _oFPCTABLESTATS = (input & 1 << 1) > 0;
+        final Boolean _oFPCPORTSTATS = (input & 1 << 2) > 0;
+        final Boolean _oFPCSTP = (input & 1 << 3) > 0;
+        final Boolean _oFPCRESERVED = (input & 1 << 4) > 0;
+        final Boolean _oFPCIPREASM = (input & 1 << 5) > 0;
+        final Boolean _oFPCQUEUESTATS = (input & 1 << 6) > 0;
+        final Boolean _oFPCARPMATCHIP = (input & 1 << 7) > 0;
         return new CapabilitiesV10(_oFPCARPMATCHIP, _oFPCFLOWSTATS, _oFPCIPREASM, _oFPCPORTSTATS, _oFPCQUEUESTATS,
                 _oFPCRESERVED, _oFPCSTP, _oFPCTABLESTATS);
     }
 
+    @SuppressWarnings("checkstyle:AbbreviationAsWordInName")
     private static ActionTypeV10 createActionsV10(long input) {
-        Boolean _oFPATOUTPUT = ((input) & (1 << 0)) > 0;
-        Boolean _oFPATSETVLANVID = ((input) & (1 << 1)) > 0;
-        Boolean _oFPATSETVLANPCP = ((input) & (1 << 2)) > 0;
-        Boolean _oFPATSTRIPVLAN = ((input) & (1 << 3)) > 0;
-        Boolean _oFPATSETDLSRC = ((input) & (1 << 4)) > 0;
-        Boolean _oFPATSETDLDST = ((input) & (1 << 5)) > 0;
-        Boolean _oFPATSETNWSRC = ((input) & (1 << 6)) > 0;
-        Boolean _oFPATSETNWDST = ((input) & (1 << 7)) > 0;
-        Boolean _oFPATSETNWTOS = ((input) & (1 << 8)) > 0;
-        Boolean _oFPATSETTPSRC = ((input) & (1 << 9)) > 0;
-        Boolean _oFPATSETTPDST = ((input) & (1 << 10)) > 0;
-        Boolean _oFPATENQUEUE = ((input) & (1 << 11)) > 0;
-        Boolean _oFPATVENDOR = ((input) & (1 << 12)) > 0;
+        final Boolean _oFPATOUTPUT = (input & 1 << 0) > 0;
+        final Boolean _oFPATSETVLANVID = (input & 1 << 1) > 0;
+        final Boolean _oFPATSETVLANPCP = (input & 1 << 2) > 0;
+        final Boolean _oFPATSTRIPVLAN = (input & 1 << 3) > 0;
+        final Boolean _oFPATSETDLSRC = (input & 1 << 4) > 0;
+        final Boolean _oFPATSETDLDST = (input & 1 << 5) > 0;
+        final Boolean _oFPATSETNWSRC = (input & 1 << 6) > 0;
+        final Boolean _oFPATSETNWDST = (input & 1 << 7) > 0;
+        final Boolean _oFPATSETNWTOS = (input & 1 << 8) > 0;
+        final Boolean _oFPATSETTPSRC = (input & 1 << 9) > 0;
+        final Boolean _oFPATSETTPDST = (input & 1 << 10) > 0;
+        final Boolean _oFPATENQUEUE = (input & 1 << 11) > 0;
+        final Boolean _oFPATVENDOR = (input & 1 << 12) > 0;
         return new ActionTypeV10(_oFPATENQUEUE, _oFPATOUTPUT, _oFPATSETDLDST, _oFPATSETDLSRC, _oFPATSETNWDST,
                 _oFPATSETNWSRC, _oFPATSETNWTOS, _oFPATSETTPDST, _oFPATSETTPSRC, _oFPATSETVLANPCP, _oFPATSETVLANVID,
                 _oFPATSTRIPVLAN, _oFPATVENDOR);
index b8343bbd8aeaf615541327f79319d40271292ced..d65ec2e8e4dd001a0f340205908e6628485a75c1 100644 (file)
@@ -10,11 +10,9 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -42,8 +40,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10FlowModInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class OF10FlowModInputMessageFactoryTest {
 
@@ -51,7 +50,7 @@ public class OF10FlowModInputMessageFactoryTest {
     private OFSerializer<FlowModInput> flowModFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -62,8 +61,7 @@ public class OF10FlowModInputMessageFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link OF10FlowModInputMessageFactory} for correct translation from POJO
+     * Testing of {@link OF10FlowModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testFlowModInputMessageFactory() throws Exception {
@@ -95,7 +93,7 @@ public class OF10FlowModInputMessageFactoryTest {
         builder.setBufferId(2L);
         builder.setOutPort(new PortNumber(4422L));
         builder.setFlagsV10(new FlowModFlagsV10(true, false, true));
-        List<Action> actions = new ArrayList<>();
+        final List<Action> actions = new ArrayList<>();
         ActionBuilder actionBuilder = new ActionBuilder();
         SetNwDstCaseBuilder nwDstCaseBuilder = new SetNwDstCaseBuilder();
         SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();
index ed54d82e8ab2baf50cc81561880c0fb42be64dcf..bb82cd8dfb59d82b19e59fba79fa4a27715b4d85 100644 (file)
@@ -29,8 +29,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for OF10FlowRemovedMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10FlowRemovedMessageFactoryTest {
     private OFSerializer<FlowRemovedMessage> factory;
index b7ed855b8cb2a64c71f3a63d1c7d9d8ec1122475..c5ef3fef2a72f3a349b5a16568227cd0b3014c9f 100644 (file)
@@ -10,21 +10,21 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10HelloInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class OF10HelloInputMessageFactoryTest {
 
@@ -32,7 +32,7 @@ public class OF10HelloInputMessageFactoryTest {
     private OFSerializer<HelloInput> helloFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -43,8 +43,7 @@ public class OF10HelloInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link OF10HelloInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link OF10HelloInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testWithoutElementsSet() throws Exception {
index abe0055dd2604aa7c7d3b33aadd4e7a370adb589..ab40cd0704ff54755720db00e1ff607b21379ff7 100644 (file)
@@ -24,8 +24,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for OF10PacketInMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10PacketInMessageFactoryTest {
     private OFSerializer<PacketInMessage> factory;
index af4f139e93c0506b2f8a9202da144fc76e90639e..e30f397f75126a36809618d03ff2fb2d2ecc9240 100644 (file)
@@ -10,10 +10,8 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -34,8 +32,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10PacketOutInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class OF10PacketOutInputMessageFactoryTest {
 
@@ -43,7 +42,7 @@ public class OF10PacketOutInputMessageFactoryTest {
     private OFSerializer<PacketOutInput> packetOutFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -54,8 +53,7 @@ public class OF10PacketOutInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link OF10PacketOutInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link OF10PacketOutInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testPacketOutInputMessage() throws Exception {
@@ -63,13 +61,13 @@ public class OF10PacketOutInputMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         builder.setBufferId(256L);
         builder.setInPort(new PortNumber(257L));
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
+        final List<Action> actions = new ArrayList<>();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(42L));
         outputBuilder.setMaxLength(50);
         caseBuilder.setOutputAction(outputBuilder.build());
+        ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
@@ -101,8 +99,7 @@ public class OF10PacketOutInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link OF10PacketOutInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link OF10PacketOutInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testPacketOutInputWithNoData() throws Exception {
@@ -122,4 +119,4 @@ public class OF10PacketOutInputMessageFactoryTest {
         out.skipBytes(8); // skip packet out message to data index
         Assert.assertTrue("Unread data", out.readableBytes() == 0);
     }
-}
\ No newline at end of file
+}
index da063fbd334123b78f2d9274186a1daa8d4d0174..1680df08451f1cdba1a28764b22ed4a1078f4869 100644 (file)
@@ -16,10 +16,10 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfigV10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10;
@@ -28,8 +28,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10PortModInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class OF10PortModInputMessageFactoryTest {
 
@@ -37,7 +38,7 @@ public class OF10PortModInputMessageFactoryTest {
     private OFSerializer<PortModInput> portModFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -48,8 +49,7 @@ public class OF10PortModInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link OF10PortModInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link OF10PortModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testPortModInput() throws Exception {
index 116882797e5c668686fa5fcacf4b6520b03c37ca..30ab3ca8e6ddd7e802202c1024537897586a6350 100644 (file)
@@ -28,8 +28,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for OF10PortStatusMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10PortStatusMessageFactoryTest {
     private OFSerializer<PortStatusMessage> factory;
@@ -88,42 +89,42 @@ public class OF10PortStatusMessageFactoryTest {
     }
 
     private static PortConfigV10 createPortConfig(long input) {
-        final Boolean _portDown = ((input) & (1 << 0)) > 0;
-        final Boolean _noStp = ((input) & (1 << 1)) > 0;
-        final Boolean _noRecv = ((input) & (1 << 2)) > 0;
-        final Boolean _noRecvStp = ((input) & (1 << 3)) > 0;
-        final Boolean _noFlood = ((input) & (1 << 4)) > 0;
-        final Boolean _noFwd = ((input) & (1 << 5)) > 0;
-        final Boolean _noPacketIn = ((input) & (1 << 6)) > 0;
+        final Boolean _portDown = (input & 1 << 0) > 0;
+        final Boolean _noStp = (input & 1 << 1) > 0;
+        final Boolean _noRecv = (input & 1 << 2) > 0;
+        final Boolean _noRecvStp = (input & 1 << 3) > 0;
+        final Boolean _noFlood = (input & 1 << 4) > 0;
+        final Boolean _noFwd = (input & 1 << 5) > 0;
+        final Boolean _noPacketIn = (input & 1 << 6) > 0;
         return new PortConfigV10(_noFlood, _noFwd, _noPacketIn, _noRecv, _noRecvStp, _noStp, _portDown);
     }
 
     private static PortFeaturesV10 createPortFeatures(long input) {
-        final Boolean _10mbHd = ((input) & (1 << 0)) > 0;
-        final Boolean _10mbFd = ((input) & (1 << 1)) > 0;
-        final Boolean _100mbHd = ((input) & (1 << 2)) > 0;
-        final Boolean _100mbFd = ((input) & (1 << 3)) > 0;
-        final Boolean _1gbHd = ((input) & (1 << 4)) > 0;
-        final Boolean _1gbFd = ((input) & (1 << 5)) > 0;
-        final Boolean _10gbFd = ((input) & (1 << 6)) > 0;
-        final Boolean _copper = ((input) & (1 << 7)) > 0;
-        final Boolean _fiber = ((input) & (1 << 8)) > 0;
-        final Boolean _autoneg = ((input) & (1 << 9)) > 0;
-        final Boolean _pause = ((input) & (1 << 10)) > 0;
-        final Boolean _pauseAsym = ((input) & (1 << 11)) > 0;
+        final Boolean _10mbHd = (input & 1 << 0) > 0;
+        final Boolean _10mbFd = (input & 1 << 1) > 0;
+        final Boolean _100mbHd = (input & 1 << 2) > 0;
+        final Boolean _100mbFd = (input & 1 << 3) > 0;
+        final Boolean _1gbHd = (input & 1 << 4) > 0;
+        final Boolean _1gbFd = (input & 1 << 5) > 0;
+        final Boolean _10gbFd = (input & 1 << 6) > 0;
+        final Boolean _copper = (input & 1 << 7) > 0;
+        final Boolean _fiber = (input & 1 << 8) > 0;
+        final Boolean _autoneg = (input & 1 << 9) > 0;
+        final Boolean _pause = (input & 1 << 10) > 0;
+        final Boolean _pauseAsym = (input & 1 << 11) > 0;
         return new PortFeaturesV10(_100mbFd, _100mbHd, _10gbFd, _10mbFd, _10mbHd, _1gbFd, _1gbHd, _autoneg, _copper,
                 _fiber, _pause, _pauseAsym);
     }
 
     private static PortStateV10 createPortState(long input) {
-        final Boolean _linkDown = ((input) & (1 << 0)) > 0;
-        final Boolean _blocked = ((input) & (1 << 1)) > 0;
-        final Boolean _live = ((input) & (1 << 2)) > 0;
-        final Boolean _stpListen = ((input) & (1 << 3)) > 0;
-        final Boolean _stpLearn = ((input) & (1 << 4)) > 0;
-        final Boolean _stpForward = ((input) & (1 << 5)) > 0;
-        final Boolean _stpBlock = ((input) & (1 << 6)) > 0;
-        final Boolean _stpMask = ((input) & (1 << 7)) > 0;
+        final Boolean _linkDown = (input & 1 << 0) > 0;
+        final Boolean _blocked = (input & 1 << 1) > 0;
+        final Boolean _live = (input & 1 << 2) > 0;
+        final Boolean _stpListen = (input & 1 << 3) > 0;
+        final Boolean _stpLearn = (input & 1 << 4) > 0;
+        final Boolean _stpForward = (input & 1 << 5) > 0;
+        final Boolean _stpBlock = (input & 1 << 6) > 0;
+        final Boolean _stpMask = (input & 1 << 7) > 0;
         return new PortStateV10(_blocked, _linkDown, _live, _stpBlock, _stpForward, _stpLearn, _stpListen, _stpMask);
     }
 }
index 81234dde452002f460008827913a4bca0f422f7f..f0dd4a58c6feb26771a3750b725a5995adeb589b 100644 (file)
@@ -16,16 +16,17 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10QueueGetConfigInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 public class OF10QueueGetConfigInputMessageFactoryTest {
 
@@ -33,7 +34,7 @@ public class OF10QueueGetConfigInputMessageFactoryTest {
     private OFSerializer<GetQueueConfigInput> queueFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -44,8 +45,7 @@ public class OF10QueueGetConfigInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link OF10QueueGetConfigInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link OF10QueueGetConfigInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void test() throws Exception {
index c46d03d7fdd30f4d058a73d61b89f4455f0897bf..da8646bd3973cff4fc47cd76d2ef811ed9261826 100644 (file)
@@ -33,8 +33,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for OF10QueueGetConfigReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10QueueGetConfigReplyMessageFactoryTest {
     private OFSerializer<GetQueueConfigOutput> factory;
@@ -86,7 +87,7 @@ public class OF10QueueGetConfigReplyMessageFactoryTest {
     }
 
     private static List<QueueProperty> createPropertiesList() {
-        List<QueueProperty> propertiesList = new ArrayList<>();
+        final List<QueueProperty> propertiesList = new ArrayList<>();
         QueuePropertyBuilder pb = new QueuePropertyBuilder();
         pb.setProperty(QueueProperties.forValue(1));
         RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
index 8b52cb01ed52ad08313c7c09f7ffacc32399657a..155038c44f3045e413036d455b17ca56569643eb 100644 (file)
@@ -62,8 +62,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.multipart.reply.table.TableStatsBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for OF10StatsReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class OF10StatsReplyMessageFactoryTest {
     private OFSerializer<MultipartReplyMessage> factory;
@@ -84,7 +85,7 @@ public class OF10StatsReplyMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         builder.setFlags(new MultipartRequestFlags(true));
         builder.setType(MultipartType.forValue(0));
-        MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
+        final MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
         MultipartReplyDescBuilder desc = new MultipartReplyDescBuilder();
         desc.setMfrDesc("Test");
         desc.setHwDesc("Test");
@@ -168,7 +169,7 @@ public class OF10StatsReplyMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         builder.setFlags(new MultipartRequestFlags(true));
         builder.setType(MultipartType.forValue(2));
-        MultipartReplyAggregateCaseBuilder aggregateCase = new MultipartReplyAggregateCaseBuilder();
+        final MultipartReplyAggregateCaseBuilder aggregateCase = new MultipartReplyAggregateCaseBuilder();
         MultipartReplyAggregateBuilder aggregate = new MultipartReplyAggregateBuilder();
         aggregate.setPacketCount(BigInteger.valueOf(1234L));
         aggregate.setByteCount(BigInteger.valueOf(1234L));
@@ -322,7 +323,7 @@ public class OF10StatsReplyMessageFactoryTest {
         builder.setRxOverErr(BigInteger.valueOf(1L));
         builder.setRxCrcErr(BigInteger.valueOf(1L));
         builder.setCollisions(BigInteger.valueOf(1L));
-        List<PortStats> list = new ArrayList<PortStats>();
+        List<PortStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
     }
@@ -369,8 +370,8 @@ public class OF10StatsReplyMessageFactoryTest {
         builder.setCookie(BigInteger.valueOf(1234L));
         builder.setPacketCount(BigInteger.valueOf(1234L));
         builder.setByteCount(BigInteger.valueOf(1234L));
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
+        final List<Action> actions = new ArrayList<>();
+        final ActionBuilder actionBuilder = new ActionBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(42L));
@@ -379,18 +380,18 @@ public class OF10StatsReplyMessageFactoryTest {
         actionBuilder.setActionChoice(caseBuilder.build());
         actions.add(actionBuilder.build());
         builder.setAction(actions);
-        List<FlowStats> list = new ArrayList<FlowStats>();
+        List<FlowStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
     }
 
     private static MultipartRequestFlags createMultipartRequestFlags(int input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
         return new MultipartRequestFlags(one);
     }
 
     private static MultipartReplyDescCase decodeDescBody(ByteBuf output) {
-        MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
+        final MultipartReplyDescCaseBuilder descCase = new MultipartReplyDescCaseBuilder();
         MultipartReplyDescBuilder desc = new MultipartReplyDescBuilder();
         byte[] mfrDesc = new byte[256];
         output.readBytes(mfrDesc);
index c44b9f0c86d1d21417bd800508b4eac91556fb0d..415f2f9d294147efe180fb66adb4d89762f5a480 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -40,8 +39,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10StatsRequestInputFactory.
  *
+ * @author michal.polkorab
  */
 public class OF10StatsRequestInputFactoryTest {
 
@@ -49,7 +49,7 @@ public class OF10StatsRequestInputFactoryTest {
     private OFSerializer<MultipartRequestInput> multipartFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -60,8 +60,7 @@ public class OF10StatsRequestInputFactoryTest {
     }
 
     /**
-     * Testing OF10StatsRequestInputFactory (Desc) for correct serialization
-     * @throws Exception
+     * Testing OF10StatsRequestInputFactory (Desc) for correct serialization.
      */
     @Test
     public void testDesc() throws Exception {
@@ -85,8 +84,7 @@ public class OF10StatsRequestInputFactoryTest {
     }
 
     /**
-     * Testing OF10StatsRequestInputFactory (Flow) for correct serialization
-     * @throws Exception
+     * Testing OF10StatsRequestInputFactory (Flow) for correct serialization.
      */
     @Test
     public void testFlow() throws Exception {
@@ -94,8 +92,8 @@ public class OF10StatsRequestInputFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         builder.setType(MultipartType.OFPMPFLOW);
         builder.setFlags(new MultipartRequestFlags(false));
-        MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
-        MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
+        final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
+        final MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true,
                 true, true, true, true));
@@ -152,8 +150,7 @@ public class OF10StatsRequestInputFactoryTest {
     }
 
     /**
-     * Testing OF10StatsRequestInputFactory (Aggregate) for correct serialization
-     * @throws Exception
+     * Testing OF10StatsRequestInputFactory (Aggregate) for correct serialization.
      */
     @Test
     public void testAggregate() throws Exception {
@@ -161,8 +158,8 @@ public class OF10StatsRequestInputFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         builder.setType(MultipartType.OFPMPAGGREGATE);
         builder.setFlags(new MultipartRequestFlags(false));
-        MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
-        MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
+        final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
+        final MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(false, false, false, false,
                 false, false, false, false, false, false));
@@ -219,8 +216,7 @@ public class OF10StatsRequestInputFactoryTest {
     }
 
     /**
-     * Testing OF10StatsRequestInputFactory (Table) for correct serialization
-     * @throws Exception
+     * Testing OF10StatsRequestInputFactory (Table) for correct serialization.
      */
     @Test
     public void testTable() throws Exception {
@@ -244,8 +240,7 @@ public class OF10StatsRequestInputFactoryTest {
     }
 
     /**
-     * Testing OF10StatsRequestInputFactory (Port) for correct serialization
-     * @throws Exception
+     * Testing OF10StatsRequestInputFactory (Port) for correct serialization.
      */
     @Test
     public void testPort() throws Exception {
@@ -272,8 +267,7 @@ public class OF10StatsRequestInputFactoryTest {
     }
 
     /**
-     * Testing OF10StatsRequestInputFactory (Queue) for correct serialization
-     * @throws Exception
+     * Testing OF10StatsRequestInputFactory (Queue) for correct serialization.
      */
     @Test
     public void testQueue() throws Exception {
index 8f917b7b148a227c83656f1d5e81ce06ea109c73..6aa2508d8593ccad63af733d027eecbf1be3e6d4 100644 (file)
@@ -40,8 +40,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for PacketInMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class PacketInMessageFactoryTest {
     private OFSerializer<PacketInMessage> factory;
@@ -67,7 +68,7 @@ public class PacketInMessageFactoryTest {
         builder.setCookie(new BigInteger(1, cookie));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(InPhyPort.class);
index 60ee5210f1e68fdaddffd0fceb27bc08091b0bb8..e0e3def16b35b68721ce18cb8fc1788aaab71056 100644 (file)
@@ -10,10 +10,8 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -35,8 +33,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
 
 /**
- * @author timotej.kubas
+ * Unit tests for PacketOutInputMessageFactory.
  *
+ * @author timotej.kubas
  */
 public class PacketOutInputMessageFactoryTest {
     private static final byte MESSAGE_TYPE = 13;
@@ -46,7 +45,7 @@ public class PacketOutInputMessageFactoryTest {
     private OFSerializer<PacketOutInput> packetOutFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -57,8 +56,7 @@ public class PacketOutInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link PacketOutInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link PacketOutInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testPacketOutInputMessage() throws Exception {
@@ -66,7 +64,7 @@ public class PacketOutInputMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setBufferId(256L);
         builder.setInPort(new PortNumber(256L));
-        List<Action> actions = new ArrayList<>();
+        final List<Action> actions = new ArrayList<>();
         ActionBuilder actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
         PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
@@ -102,8 +100,7 @@ public class PacketOutInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link PacketOutInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link PacketOutInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testPacketOutInputWithNoData() throws Exception {
@@ -123,4 +120,4 @@ public class PacketOutInputMessageFactoryTest {
         out.skipBytes(16); // skip packet out message to data index
         Assert.assertTrue("Unexpected data", out.readableBytes() == 0);
     }
-}
\ No newline at end of file
+}
index f9319019170e0be2c76f9cb3c64e534420952324..2640fd1a10e5e854ff596cc7ce4be4206ce1d335 100644 (file)
@@ -16,10 +16,10 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeatures;
@@ -28,6 +28,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInputBuilder;
 
 /**
+ * Unit tests for PortModInputMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -41,7 +43,7 @@ public class PortModInputMessageFactoryTest {
     private OFSerializer<PortModInput> portModFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -52,8 +54,7 @@ public class PortModInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link PortModInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link PortModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testPortModInput() throws Exception {
@@ -67,7 +68,7 @@ public class PortModInputMessageFactoryTest {
                                               false, false, false, true,
                                               false, false, false, false,
                                               false, false, false, false));
-        PortModInput message = builder.build();
+        final PortModInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
 
@@ -97,31 +98,31 @@ public class PortModInputMessageFactoryTest {
         out.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_03);
     }
 
-    private static PortConfig createPortConfig(long input){
-        final Boolean _portDown   = ((input) & (1<<0)) > 0;
-        final Boolean _noRecv    = ((input) & (1<<2)) > 0;
-        final Boolean _noFwd       = ((input) & (1<<5)) > 0;
-        final Boolean _noPacketIn = ((input) & (1<<6)) > 0;
+    private static PortConfig createPortConfig(long input) {
+        final Boolean _portDown = (input & 1 << 0) > 0;
+        final Boolean _noRecv = (input & 1 << 2) > 0;
+        final Boolean _noFwd = (input & 1 << 5) > 0;
+        final Boolean _noPacketIn = (input & 1 << 6) > 0;
         return new PortConfig(_noFwd, _noPacketIn, _noRecv, _portDown);
     }
 
-    private static PortFeatures createPortFeatures(long input){
-        final Boolean _10mbHd = ((input) & (1<<0)) > 0;
-        final Boolean _10mbFd = ((input) & (1<<1)) > 0;
-        final Boolean _100mbHd = ((input) & (1<<2)) > 0;
-        final Boolean _100mbFd = ((input) & (1<<3)) > 0;
-        final Boolean _1gbHd = ((input) & (1<<4)) > 0;
-        final Boolean _1gbFd = ((input) & (1<<5)) > 0;
-        final Boolean _10gbFd = ((input) & (1<<6)) > 0;
-        final Boolean _40gbFd = ((input) & (1<<7)) > 0;
-        final Boolean _100gbFd = ((input) & (1<<8)) > 0;
-        final Boolean _1tbFd = ((input) & (1<<9)) > 0;
-        final Boolean _other = ((input) & (1<<10)) > 0;
-        final Boolean _copper = ((input) & (1<<11)) > 0;
-        final Boolean _fiber = ((input) & (1<<12)) > 0;
-        final Boolean _autoneg = ((input) & (1<<13)) > 0;
-        final Boolean _pause = ((input) & (1<<14)) > 0;
-        final Boolean _pauseAsym = ((input) & (1<<15)) > 0;
+    private static PortFeatures createPortFeatures(long input) {
+        final Boolean _10mbHd = (input & 1 << 0) > 0;
+        final Boolean _10mbFd = (input & 1 << 1) > 0;
+        final Boolean _100mbHd = (input & 1 << 2) > 0;
+        final Boolean _100mbFd = (input & 1 << 3) > 0;
+        final Boolean _1gbHd = (input & 1 << 4) > 0;
+        final Boolean _1gbFd = (input & 1 << 5) > 0;
+        final Boolean _10gbFd = (input & 1 << 6) > 0;
+        final Boolean _40gbFd = (input & 1 << 7) > 0;
+        final Boolean _100gbFd = (input & 1 << 8) > 0;
+        final Boolean _1tbFd = (input & 1 << 9) > 0;
+        final Boolean _other = (input & 1 << 10) > 0;
+        final Boolean _copper = (input & 1 << 11) > 0;
+        final Boolean _fiber = (input & 1 << 12) > 0;
+        final Boolean _autoneg = (input & 1 << 13) > 0;
+        final Boolean _pause = (input & 1 << 14) > 0;
+        final Boolean _pauseAsym = (input & 1 << 15) > 0;
         return new PortFeatures(_100gbFd, _100mbFd,  _100mbHd, _10gbFd, _10mbFd, _10mbHd,
                 _1gbFd, _1gbHd, _1tbFd, _40gbFd, _autoneg, _copper, _fiber, _other, _pause, _pauseAsym);
     }
index 362d2fd86f220543c6a08cde8dd5fd4a404ba874..79ed523ea989be72a737ee029ae118b0127c3f92 100644 (file)
@@ -28,8 +28,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for PortStatusMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class PortStatusMessageFactoryTest {
     private OFSerializer<PortStatusMessage> factory;
@@ -97,38 +98,38 @@ public class PortStatusMessageFactoryTest {
     }
 
     private static PortConfig createPortConfig(long input) {
-        final Boolean _portDown = ((input) & (1 << 0)) > 0;
-        final Boolean _noRecv = ((input) & (1 << 2)) > 0;
-        final Boolean _noFwd = ((input) & (1 << 5)) > 0;
-        final Boolean _noPacketIn = ((input) & (1 << 6)) > 0;
+        final Boolean _portDown = (input & 1 << 0) > 0;
+        final Boolean _noRecv = (input & 1 << 2) > 0;
+        final Boolean _noFwd = (input & 1 << 5) > 0;
+        final Boolean _noPacketIn = (input & 1 << 6) > 0;
         return new PortConfig(_noFwd, _noPacketIn, _noRecv, _portDown);
     }
 
     private static PortFeatures createPortFeatures(long input) {
-        final Boolean _10mbHd = ((input) & (1 << 0)) > 0;
-        final Boolean _10mbFd = ((input) & (1 << 1)) > 0;
-        final Boolean _100mbHd = ((input) & (1 << 2)) > 0;
-        final Boolean _100mbFd = ((input) & (1 << 3)) > 0;
-        final Boolean _1gbHd = ((input) & (1 << 4)) > 0;
-        final Boolean _1gbFd = ((input) & (1 << 5)) > 0;
-        final Boolean _10gbFd = ((input) & (1 << 6)) > 0;
-        final Boolean _40gbFd = ((input) & (1 << 7)) > 0;
-        final Boolean _100gbFd = ((input) & (1 << 8)) > 0;
-        final Boolean _1tbFd = ((input) & (1 << 9)) > 0;
-        final Boolean _other = ((input) & (1 << 10)) > 0;
-        final Boolean _copper = ((input) & (1 << 11)) > 0;
-        final Boolean _fiber = ((input) & (1 << 12)) > 0;
-        final Boolean _autoneg = ((input) & (1 << 13)) > 0;
-        final Boolean _pause = ((input) & (1 << 14)) > 0;
-        final Boolean _pauseAsym = ((input) & (1 << 15)) > 0;
+        final Boolean _10mbHd = (input & 1 << 0) > 0;
+        final Boolean _10mbFd = (input & 1 << 1) > 0;
+        final Boolean _100mbHd = (input & 1 << 2) > 0;
+        final Boolean _100mbFd = (input & 1 << 3) > 0;
+        final Boolean _1gbHd = (input & 1 << 4) > 0;
+        final Boolean _1gbFd = (input & 1 << 5) > 0;
+        final Boolean _10gbFd = (input & 1 << 6) > 0;
+        final Boolean _40gbFd = (input & 1 << 7) > 0;
+        final Boolean _100gbFd = (input & 1 << 8) > 0;
+        final Boolean _1tbFd = (input & 1 << 9) > 0;
+        final Boolean _other = (input & 1 << 10) > 0;
+        final Boolean _copper = (input & 1 << 11) > 0;
+        final Boolean _fiber = (input & 1 << 12) > 0;
+        final Boolean _autoneg = (input & 1 << 13) > 0;
+        final Boolean _pause = (input & 1 << 14) > 0;
+        final Boolean _pauseAsym = (input & 1 << 15) > 0;
         return new PortFeatures(_100gbFd, _100mbFd, _100mbHd, _10gbFd, _10mbFd, _10mbHd, _1gbFd, _1gbHd, _1tbFd,
                 _40gbFd, _autoneg, _copper, _fiber, _other, _pause, _pauseAsym);
     }
 
     private static PortState createPortState(long input) {
-        final Boolean one = ((input) & (1 << 0)) > 0;
-        final Boolean two = ((input) & (1 << 1)) > 0;
-        final Boolean three = ((input) & (1 << 2)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
+        final Boolean three = (input & 1 << 2) > 0;
         return new PortState(two, one, three);
     }
 
index c69a0da130d0417df3aa4019233785a9458bb2c8..cac11f9551e61288431159e5235b1a49800d05d2 100644 (file)
@@ -33,8 +33,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for QueueGetConfigReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class QueueGetConfigReplyMessageFactoryTest {
     private OFSerializer<GetQueueConfigOutput> factory;
@@ -111,7 +112,7 @@ public class QueueGetConfigReplyMessageFactoryTest {
     }
 
     private static List<QueueProperty> createPropertiesList() {
-        List<QueueProperty> propertiesList = new ArrayList<>();
+        final List<QueueProperty> propertiesList = new ArrayList<>();
         QueuePropertyBuilder pb = new QueuePropertyBuilder();
         pb.setProperty(QueueProperties.forValue(2));
         RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
index 8ed5855319e0f62943caf9aed5ceca278f320abc..d23e8e17cc678693056f471752f54896d19b9788 100644 (file)
@@ -24,8 +24,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutputBuilder;
 
 /**
- * @author giuseppex.petralia@intel.com
+ * Unit tests for RoleReplyMessageFactory.
  *
+ * @author giuseppex.petralia@intel.com
  */
 public class RoleReplyMessageFactoryTest {
     private OFSerializer<RoleRequestOutput> factory;
index ac09080bf8315445e51022c3fb0590859a89f412..b27417955939e244ac5d08100418e2909502a118 100644 (file)
@@ -10,23 +10,23 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.math.BigInteger;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ControllerRole;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInputBuilder;
 
 /**
+ * Unit tests for RoleRequestInputMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -38,7 +38,7 @@ public class RoleRequestInputMessageFactoryTest {
     private OFSerializer<RoleRequestInput> roleFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -49,8 +49,7 @@ public class RoleRequestInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link RoleRequestInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link RoleRequestInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testRoleRequestInputMessage() throws Exception {
@@ -65,7 +64,8 @@ public class RoleRequestInputMessageFactoryTest {
         roleFactory.serialize(message, out);
 
         BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH);
-        Assert.assertEquals("Wrong role", message.getRole().getIntValue(), ControllerRole.forValue((int) out.readUnsignedInt()).getIntValue());
+        Assert.assertEquals("Wrong role", message.getRole().getIntValue(),
+                ControllerRole.forValue((int) out.readUnsignedInt()).getIntValue());
         out.skipBytes(PADDING_IN_ROLE_REQUEST_MESSAGE);
         byte[] genId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
         out.readBytes(genId);
index 1f2ff731d089df2c67220354f663ee4c354abdd8..eb5f94d72c0764be12327c1139ce59b1141cb5c0 100644 (file)
@@ -10,10 +10,8 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -36,6 +34,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMaskBuilder;
 
 /**
+ * Unit tests for SetAsyncInputMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -45,7 +45,7 @@ public class SetAsyncInputMessageFactoryTest {
     private OFSerializer<SetAsyncInput> setAsyncFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -56,8 +56,7 @@ public class SetAsyncInputMessageFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link SetAsyncInputMessageFactory} for correct translation from POJO
+     * Testing of {@link SetAsyncInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testSetAsyncInputMessage() throws Exception {
@@ -82,7 +81,7 @@ public class SetAsyncInputMessageFactoryTest {
     }
 
     private static List<PacketInMask> createPacketInMask() {
-        List<PacketInMask> masks = new ArrayList<>();
+        final List<PacketInMask> masks = new ArrayList<>();
         PacketInMaskBuilder builder;
         // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
         builder = new PacketInMaskBuilder();
@@ -101,7 +100,7 @@ public class SetAsyncInputMessageFactoryTest {
     }
 
     private static List<PortStatusMask> createPortStatusMask() {
-        List<PortStatusMask> masks = new ArrayList<>();
+        final List<PortStatusMask> masks = new ArrayList<>();
         PortStatusMaskBuilder builder;
         builder = new PortStatusMaskBuilder();
         // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
@@ -120,7 +119,7 @@ public class SetAsyncInputMessageFactoryTest {
     }
 
     private static List<FlowRemovedMask> createFlowRemowedMask() {
-        List<FlowRemovedMask> masks = new ArrayList<>();
+        final List<FlowRemovedMask> masks = new ArrayList<>();
         FlowRemovedMaskBuilder builder;
         // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
         builder = new FlowRemovedMaskBuilder();
@@ -140,8 +139,7 @@ public class SetAsyncInputMessageFactoryTest {
     }
 
     /**
-     * @throws Exception
-     * Testing of {@link SetAsyncInputMessageFactory} for correct translation from POJO
+     * Testing of {@link SetAsyncInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testSetAsyncInputWithNullMasks() throws Exception {
@@ -158,4 +156,4 @@ public class SetAsyncInputMessageFactoryTest {
         BufferHelper.checkHeaderV13(out,(byte) 28, 8);
         Assert.assertTrue("Unexpected data", out.readableBytes() == 0);
     }
-}
\ No newline at end of file
+}
index 700d1641f39550337c31b176fc73bd94d978ab88..61f615eb2ecaf31d05168bea5155da5f837a87d6 100644 (file)
@@ -10,21 +10,22 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInputBuilder;
 
 /**
+ * Unit tests for SetConfigMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -35,7 +36,7 @@ public class SetConfigMessageFactoryTest {
     private OFSerializer<SetConfigInput> setConfigFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -46,8 +47,7 @@ public class SetConfigMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link SetConfigMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link SetConfigMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testSetConfigMessageV13() throws Exception {
@@ -67,8 +67,7 @@ public class SetConfigMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link SetConfigMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link SetConfigMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testSetConfigMessageV10() throws Exception {
index 27ae6457855d6b271ffe711d602426f1d28f8323..1f198063994c05a52a83c6642cf28ca24d2e9da9 100644 (file)
@@ -16,15 +16,17 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInputBuilder;
 
 /**
+ * Unit tests for TableModInputMessageFactory.
+ *
  * @author timotej.kubas
  * @author michal.polkorab
  */
@@ -35,7 +37,7 @@ public class TableModInputMessageFactoryTest {
     private OFSerializer<TableModInput> tableModFactory;
 
     /**
-     * Initializes serializer registry and stores correct factory in field
+     * Initializes serializer registry and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -46,8 +48,7 @@ public class TableModInputMessageFactoryTest {
     }
 
     /**
-     * Testing of {@link TableModInputMessageFactory} for correct translation from POJO
-     * @throws Exception
+     * Testing of {@link TableModInputMessageFactory} for correct translation from POJO.
      */
     @Test
     public void testTableModInput() throws Exception {
index f299e818e9e9f6a1832a220007231e95cba7b86d..371e83ef4d421009a21695281a9eee7c38e611e9 100644 (file)
@@ -27,8 +27,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
 
 /**
- * @author michal.polkorab
+ * Unit tests for VendorInputMessageFactory.
  *
+ * @author michal.polkorab
  */
 @RunWith(MockitoJUnitRunner.class)
 public class VendorInputMessageFactoryTest {
@@ -39,7 +40,8 @@ public class VendorInputMessageFactoryTest {
     VendorInputMessageFactory serializer;
 
     /**
-     * Tests {@link VendorInputMessageFactory#serialize(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterOfMessage, ByteBuf)}
+     * Tests {@link VendorInputMessageFactory#serialize(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
+     * .protocol.rev130731.ExperimenterOfMessage, ByteBuf)}.
      */
     @Test
     public void test() {
@@ -47,7 +49,7 @@ public class VendorInputMessageFactoryTest {
             .thenReturn(serializer);
         VendorInputMessageFactory factory = new VendorInputMessageFactory();
         factory.injectSerializerRegistry(registry);
-        ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
+        final ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
         builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
         builder.setXid(12345L);
@@ -59,6 +61,7 @@ public class VendorInputMessageFactoryTest {
         Mockito.when(registry.getSerializer(Matchers.<ExperimenterIdSerializerKey<ExperimenterDataOfChoice>>any()))
                 .thenReturn(foundSerializer);
         factory.serialize(experimenterInput, buffer);
-        Mockito.verify(foundSerializer, Mockito.times(1)).serialize(experimenterInput.getExperimenterDataOfChoice(), buffer);
+        Mockito.verify(foundSerializer, Mockito.times(1))
+            .serialize(experimenterInput.getExperimenterDataOfChoice(), buffer);
     }
-}
\ No newline at end of file
+}
index b9d2b0f5ee87a5e5e42bcdf9e804aeebca3d8ec8..942070676f378ee7d3f5a137079089cca89fe79f 100644 (file)
@@ -8,9 +8,7 @@
 package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
-
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -41,8 +39,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ActionsDeserializer.
  *
+ * @author michal.polkorab
  */
 public class ActionsDeserializerTest {
 
@@ -51,7 +50,7 @@ public class ActionsDeserializerTest {
     private DeserializerRegistry registry;
 
     /**
-     * Initializes deserializer registry and lookups correct deserializer
+     * Initializes deserializer registry and lookups correct deserializer.
      */
     @Before
     public void startUp() {
@@ -60,7 +59,7 @@ public class ActionsDeserializerTest {
     }
 
     /**
-     * Testing actions deserialization
+     * Testing actions deserialization.
      */
     @Test
     public void test() {
@@ -146,7 +145,7 @@ public class ActionsDeserializerTest {
     }
 
     /**
-     * Tests {@link AbstractActionDeserializer#deserializeHeader(ByteBuf)}
+     * Tests {@link AbstractActionDeserializer#deserializeHeader(ByteBuf)}.
      */
     @Test
     public void testDeserializeHeader() {
@@ -159,8 +158,10 @@ public class ActionsDeserializerTest {
 
         Assert.assertTrue("Wrong action type", actions.get(0).getActionChoice() instanceof OutputActionCase);
         Assert.assertNull("Wrong action port", ((OutputActionCase) actions.get(0).getActionChoice()).getOutputAction());
-        Assert.assertNull("Wrong action max-length", ((OutputActionCase) actions.get(0).getActionChoice()).getOutputAction());
+        Assert.assertNull("Wrong action max-length",
+                ((OutputActionCase) actions.get(0).getActionChoice()).getOutputAction());
         Assert.assertTrue("Wrong action type", actions.get(1).getActionChoice() instanceof SetFieldCase);
-        Assert.assertNull("Wrong action oxm field", ((SetFieldCase) actions.get(1).getActionChoice()).getSetFieldAction());
+        Assert.assertNull("Wrong action oxm field",
+                ((SetFieldCase) actions.get(1).getActionChoice()).getSetFieldAction());
     }
 }
index 29d0da2f94707468a1b5246a3c1d0b415bcb83d5..a2da310d82b8d0273bbbf45298ab352c154c687c 100644 (file)
@@ -10,32 +10,29 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-
 import org.junit.Assert;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
-import org.opendaylight.yangtools.yang.binding.DataObject;
 
 /**
- * @author michal.polkorab
+ * Helper class for buffers.
  *
+ * @author michal.polkorab
  */
 public abstract class BufferHelper {
 
-    /**
-     *
-     */
     public static final Long DEFAULT_XID = 0x01020304L;
     private static final byte[] XID = new byte[] { 0x01, 0x02, 0x03, 0x04 };
 
     /**
-     * @param payload
+     * Build a ByteBuffer.
+     *
+     * @param payload the payload data
      * @return ByteBuf filled with OpenFlow protocol message without first 4
      *         bytes
      */
@@ -47,6 +44,8 @@ public abstract class BufferHelper {
     }
 
     /**
+     * Build a ByteBuffer.
+     *
      * @param payload String in hex format
      * @return ByteBuf filled with OpenFlow protocol message without first 4
      *         bytes
@@ -56,6 +55,8 @@ public abstract class BufferHelper {
     }
 
     /**
+     * Build a ByteBuffer.
+     *
      * @return ByteBuf filled with OpenFlow protocol header message without first 4
      *         bytes
      */
@@ -67,7 +68,8 @@ public abstract class BufferHelper {
     }
 
     /**
-     * Use version 1.3 for encoded message
+     * Use version 1.3 for encoded message.
+     *
      * @param input ByteBuf to be checked for correct OpenFlow Protocol header
      * @param msgType type of received message
      * @param length expected length of message in header
@@ -77,7 +79,17 @@ public abstract class BufferHelper {
     }
 
     /**
-     * Use version 1.0 for encoded message
+     * Checks a 1.3 header.
+     *
+     * @param ofHeader OpenFlow protocol header
+     */
+    public static void checkHeaderV13(OfHeader ofHeader) {
+        checkHeader(ofHeader, (short) EncodeConstants.OF13_VERSION_ID);
+    }
+
+    /**
+     * Use version 1.0 for encoded message.
+     *
      * @param input ByteBuf to be checked for correct OpenFlow Protocol header
      * @param msgType type of received message
      * @param length expected length of message in header
@@ -86,30 +98,25 @@ public abstract class BufferHelper {
         checkHeader(input, msgType, length, (short) EncodeConstants.OF10_VERSION_ID);
     }
 
-    private static void checkHeader(ByteBuf input, byte msgType, int length, Short version) {
-        Assert.assertEquals("Wrong version", version, Short.valueOf(input.readByte()));
-        Assert.assertEquals("Wrong type", msgType, input.readByte());
-        Assert.assertEquals("Wrong length", length, input.readUnsignedShort());
-        Assert.assertEquals("Wrong Xid", DEFAULT_XID, Long.valueOf(input.readUnsignedInt()));
-    }
-
-
-    /**
-     * @param ofHeader OpenFlow protocol header
-     */
-    public static void checkHeaderV13(OfHeader ofHeader) {
-        checkHeader(ofHeader, (short) EncodeConstants.OF13_VERSION_ID);
-    }
-
     /**
+     * Checks a 1.0 header.
+     *
      * @param ofHeader OpenFlow protocol header
      */
     public static void checkHeaderV10(OfHeader ofHeader) {
         checkHeader(ofHeader, (short) EncodeConstants.OF10_VERSION_ID);
     }
 
+    private static void checkHeader(ByteBuf input, byte msgType, int length, Short version) {
+        Assert.assertEquals("Wrong version", version, Short.valueOf(input.readByte()));
+        Assert.assertEquals("Wrong type", msgType, input.readByte());
+        Assert.assertEquals("Wrong length", length, input.readUnsignedShort());
+        Assert.assertEquals("Wrong Xid", DEFAULT_XID, Long.valueOf(input.readUnsignedInt()));
+    }
+
     /**
      * Check version and xid of OFP header.
+     *
      * @param ofHeader OpenFlow protocol header
      * @param version OpenFlow protocol version
      */
@@ -119,23 +126,22 @@ public abstract class BufferHelper {
     }
 
     /**
-     * @param builder
+     * Sets up a header.
+     *
+     * @param builder builder
      * @param version wire protocol number used
-     * @throws NoSuchMethodException
-     * @throws SecurityException
-     * @throws IllegalAccessException
-     * @throws IllegalArgumentException
-     * @throws InvocationTargetException
      */
-    public static void setupHeader(Object builder, int version) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
-        Method m = builder.getClass().getMethod("setVersion", Short.class);
-        m.invoke(builder, (short) version);
+    public static void setupHeader(Object builder, int version) throws NoSuchMethodException, SecurityException,
+            IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+        Method method = builder.getClass().getMethod("setVersion", Short.class);
+        method.invoke(builder, (short) version);
         Method m2 = builder.getClass().getMethod("setXid", Long.class);
         m2.invoke(builder, BufferHelper.DEFAULT_XID);
     }
 
     /**
-     * Decode message
+     * Decode message.
+     *
      * @param decoder decoder instance
      * @param bb data input buffer
      * @return message decoded pojo
index 024dae0de1277f01bdb8d5f008fe5a999ab00ebe..1950b036db0bade354b3fae1bcbc8e8a866864f6 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.keys.ActionDeserializerKey;
@@ -19,13 +18,14 @@ import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 
 /**
- * @author michal.polkorab
+ * Unit tests for CodeKeyMakerFactory.
  *
+ * @author michal.polkorab
  */
 public class CodeKeyMakerFactoryTest {
 
     /**
-     * Tests {@link CodeKeyMakerFactory#createMatchEntriesKeyMaker(short)}
+     * Tests {@link CodeKeyMakerFactory#createMatchEntriesKeyMaker(short)}.
      */
     @Test
     public void testMatchEntriesKeyMaker() {
@@ -43,7 +43,7 @@ public class CodeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link CodeKeyMakerFactory#createMatchEntriesKeyMaker(short)}
+     * Tests {@link CodeKeyMakerFactory#createMatchEntriesKeyMaker(short)}.
      */
     @Test
     public void testExperimenterMatchEntriesKeyMaker() {
@@ -55,14 +55,15 @@ public class CodeKeyMakerFactoryTest {
         MessageCodeKey codeKey = keyMaker.make(buffer);
 
         Assert.assertNotNull("Null key", codeKey);
-        MatchEntryDeserializerKey comparationKey = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, 65535, 0);
+        MatchEntryDeserializerKey comparationKey =
+                new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, 65535, 0);
         comparationKey.setExperimenterId(1L);
         Assert.assertEquals("Wrong key", comparationKey, codeKey);
         Assert.assertEquals("Buffer index modified", 8, buffer.readableBytes());
     }
 
     /**
-     * Tests {@link CodeKeyMakerFactory#createActionsKeyMaker(short)}
+     * Tests {@link CodeKeyMakerFactory#createActionsKeyMaker(short)}.
      */
     @Test
     public void testActionKeyMaker() {
@@ -80,7 +81,7 @@ public class CodeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link CodeKeyMakerFactory#createActionsKeyMaker(short)}
+     * Tests {@link CodeKeyMakerFactory#createActionsKeyMaker(short)}.
      */
     @Test
     public void testExperimenterActionKeyMaker() {
@@ -98,7 +99,7 @@ public class CodeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link CodeKeyMakerFactory#createInstructionsKeyMaker(short)}
+     * Tests {@link CodeKeyMakerFactory#createInstructionsKeyMaker(short)}.
      */
     @Test
     public void testInstructionKeyMaker() {
@@ -116,7 +117,7 @@ public class CodeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link CodeKeyMakerFactory#createInstructionsKeyMaker(short)}
+     * Tests {@link CodeKeyMakerFactory#createInstructionsKeyMaker(short)}.
      */
     @Test
     public void testExperimenterInstructionKeyMaker() {
@@ -132,4 +133,4 @@ public class CodeKeyMakerFactoryTest {
                         65535, 1L), codeKey);
         Assert.assertEquals("Buffer index modified", 8, buffer.readableBytes());
     }
-}
\ No newline at end of file
+}
index b5eead74b0f8f50cf87689831af1b9fb98e1decb..fd1b709bb383ab8fcde27c42dffd5768e97247f4 100644 (file)
@@ -41,9 +41,9 @@ public abstract class DefaultDeserializerFactoryTest<T extends DataContainer> {
     protected void testHeaderVersions(final List<Byte> versions, final ByteBuf buffer) {
         for (short version : versions) {
             ByteBuf bb = buffer.copy();
-            OFDeserializer<T> factory = registry.getDeserializer(
+            OFDeserializer<T> serializer = registry.getDeserializer(
                     new MessageCodeKey(version, messageCodeKey.getMsgType(), messageCodeKey.getClazz()));
-            T builtByFactory = BufferHelper.deserialize(factory, bb);
+            T builtByFactory = BufferHelper.deserialize(serializer, bb);
             BufferHelper.checkHeader((OfHeader) builtByFactory, version);
         }
     }
index 60f187618d9e451e699f214c9036b763631847ca..b4eb2576d262b19d8b7e01de3403f644e249fab2 100644 (file)
@@ -8,9 +8,7 @@
 package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
-
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -32,8 +30,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
 
 /**
- * @author michal.polkorab
+ * Unit tests for InstructionsDeserializer.
  *
+ * @author michal.polkorab
  */
 public class InstructionsDeserializerTest {
 
@@ -41,7 +40,7 @@ public class InstructionsDeserializerTest {
     private DeserializerRegistry registry;
 
     /**
-     * Initializes deserializer registry and lookups correct deserializer
+     * Initializes deserializer registry and lookups correct deserializer.
      */
     @Before
     public void startUp() {
@@ -50,7 +49,7 @@ public class InstructionsDeserializerTest {
     }
 
     /**
-     * Testing instructions translation
+     * Testing instructions translation.
      */
     @Test
     public void test() {
@@ -92,7 +91,8 @@ public class InstructionsDeserializerTest {
                 .getMaxLength().intValue());
         Action action2 = ((WriteActionsCase) i5.getInstructionChoice()).getWriteActions().getAction().get(1);
         Assert.assertTrue("Wrong action", action2.getActionChoice() instanceof GroupCase);
-        Assert.assertEquals("Wrong action", 80, ((GroupCase) action2.getActionChoice()).getGroupAction().getGroupId().intValue());
+        Assert.assertEquals("Wrong action", 80,
+                ((GroupCase) action2.getActionChoice()).getGroupAction().getGroupId().intValue());
         Instruction i6 = instructions.get(5);
         Assert.assertTrue("Wrong type - i6", i6.getInstructionChoice() instanceof ApplyActionsCase);
         Assert.assertEquals("Wrong instructions - i6", 2, ((ApplyActionsCase) i6.getInstructionChoice())
index fb622cd858666db9f404e6cf4bf8be9735e6ffc6..e966705bdb64d5e8be6d06d452d5a197cde37351 100644 (file)
@@ -8,11 +8,9 @@
 
 package org.opendaylight.openflowjava.protocol.impl.util;
 
-import java.util.List;
-
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
-
+import java.util.List;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -23,8 +21,9 @@ import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ListDeserializer.
  *
+ * @author michal.polkorab
  */
 @RunWith(MockitoJUnitRunner.class)
 public class ListDeserializerTest {
@@ -33,7 +32,7 @@ public class ListDeserializerTest {
     @Mock DeserializerRegistry registry;
 
     /**
-     * Tests {@link ListDeserializer#deserializeList(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
+     * Tests {@link ListDeserializer#deserializeList(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}.
      */
     @Test
     public void test() {
@@ -45,7 +44,7 @@ public class ListDeserializerTest {
     }
 
     /**
-     * Tests {@link ListDeserializer#deserializeHeaders(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
+     * Tests {@link ListDeserializer#deserializeHeaders(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}.
      */
     @Test
     public void test2() {
@@ -55,4 +54,4 @@ public class ListDeserializerTest {
 
         Assert.assertNull("List is not null", list);
     }
-}
\ No newline at end of file
+}
index e1fdc445266c7be450b9665dd8f90d73486b6eec..ed6ddf52997750f0dd8086fc88c210d1850b427c 100644 (file)
@@ -10,9 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
-
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -22,8 +20,9 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegist
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
- * @author michal.polkorab
+ * Unit tests for ListSerializer.
  *
+ * @author michal.polkorab
  */
 @RunWith(MockitoJUnitRunner.class)
 public class ListSerializerTest {
@@ -33,7 +32,7 @@ public class ListSerializerTest {
 
     /**
      * Tests {@link ListSerializer#serializeHeaderList(List, TypeKeyMaker, SerializerRegistry, ByteBuf)}
-     * with null List
+     * with null List.
      */
     @Test
     public void test() {
@@ -42,4 +41,4 @@ public class ListSerializerTest {
 
         Assert.assertEquals("Data written to buffer", 0, buffer.readableBytes());
     }
-}
\ No newline at end of file
+}
index 792f1f9dc55edc64c3523f077bdbd9fafe3b43df..3a9ebaca5fae188c7dd3fcb7abc718822db5e5c1 100644 (file)
@@ -8,9 +8,7 @@
 package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
-
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -113,8 +111,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
 
 /**
- * @author michal.polkorab
+ * Unit tests for MatchDeserializer.
  *
+ * @author michal.polkorab
  */
 public class MatchDeserializerTest {
 
@@ -122,7 +121,7 @@ public class MatchDeserializerTest {
     private DeserializerRegistry registry;
 
     /**
-     * Initializes deserializer registry and lookups correct deserializer
+     * Initializes deserializer registry and lookups correct deserializer.
      */
     @Before
     public void startUp() {
@@ -134,7 +133,7 @@ public class MatchDeserializerTest {
     }
 
     /**
-     * Testing Ipv4 address deserialization
+     * Testing Ipv4 address deserialization.
      */
     @Test
     public void testIpv4Address() {
@@ -150,7 +149,7 @@ public class MatchDeserializerTest {
     }
 
     /**
-     * Testing Ipv6 address deserialization
+     * Testing Ipv6 address deserialization.
      */
     @Test
     public void testIpv6Address() {
@@ -166,7 +165,7 @@ public class MatchDeserializerTest {
     }
 
     /**
-     * Testing match deserialization
+     * Testing match deserialization.
      */
     @Test
     public void testMatch() {
@@ -214,7 +213,6 @@ public class MatchDeserializerTest {
                 + "80 00 4D 10 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 FF "
                 + "80 00 4F 04 00 00 03 04");
 
-        System.out.println(buffer.readableBytes());
         Match match = matchDeserializer.deserialize(buffer);
         Assert.assertEquals("Wrong match type", OxmMatchType.class, match.getType());
         Assert.assertEquals("Wrong match entries size", 40, match.getMatchEntry().size());
@@ -499,7 +497,7 @@ public class MatchDeserializerTest {
     }
 
     /**
-     * Testing header deserialization
+     * Testing header deserialization.
      */
     @Test
     public void testHeaders() {
@@ -517,7 +515,7 @@ public class MatchDeserializerTest {
     }
 
     /**
-     * Testing standard match type
+     * Testing standard match type.
      */
     @Test
     public void testStandardMatch() {
index 8c0d4eaadd0a28c0ba2fedf011efb20b59240254..7c42b1547bf69a74a75896792154cb3fb62c2bed 100644 (file)
@@ -31,15 +31,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10ActionsDeserializer.
  *
+ * @author michal.polkorab
  */
 public class OF10ActionsDeserializerTest {
 
     private DeserializerRegistry registry;
 
     /**
-     * Initializes deserializer registry and lookups correct deserializer
+     * Initializes deserializer registry and lookups correct deserializer.
      */
     @Before
     public void startUp() {
@@ -48,7 +49,7 @@ public class OF10ActionsDeserializerTest {
     }
 
     /**
-     * Testing correct deserialization of actions (OF v1.0)
+     * Testing correct deserialization of actions (OF v1.0).
      */
     @Test
     public void test() {
index 07f11eba1c72a83542975cd58ef1da8199f5adce..60bc7e2949918d835628b4a6e0607ff17d7bf0bd 100644 (file)
@@ -9,10 +9,8 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -51,15 +49,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10ActionsSerializer.
  *
+ * @author michal.polkorab
  */
 public class OF10ActionsSerializerTest {
 
     private SerializerRegistry registry;
 
     /**
-     * Initializes serializer table and stores correct factory in field
+     * Initializes serializer table and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -68,17 +67,17 @@ public class OF10ActionsSerializerTest {
     }
 
     /**
-     * Testing correct serialization of actions (OF v1.0)
+     * Testing correct serialization of actions (OF v1.0).
      */
     @Test
     public void test() {
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
+        final List<Action> actions = new ArrayList<>();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(42L));
         outputBuilder.setMaxLength(32);
         caseBuilder.setOutputAction(outputBuilder.build());
+        ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
index d4f7b9be4f346aa757ea73040a79c6c07343d870..cb10fa3701161a14942c075d275802d2cb35cce4 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -24,15 +23,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10MatchDeserializer.
  *
+ * @author michal.polkorab
  */
 public class OF10MatchDeserializerTest {
 
     private OFDeserializer<MatchV10> matchDeserializer;
 
     /**
-     * Initializes deserializer registry and lookups correct deserializer
+     * Initializes deserializer registry and lookups correct deserializer.
      */
     @Before
     public void startUp() {
@@ -43,7 +43,7 @@ public class OF10MatchDeserializerTest {
     }
 
     /**
-     * Testing correct deserialization of ofp_match
+     * Testing correct deserialization of ofp_match.
      */
     @Test
     public void test() {
@@ -71,7 +71,7 @@ public class OF10MatchDeserializerTest {
     }
 
     /**
-     * Testing correct deserialization of ofp_match
+     * Testing correct deserialization of ofp_match.
      */
     @Test
     public void test2() {
index 4e27095eb9c29742a8fa835a4a2da8f2cae252dc..22d8171319fb66af47fcb468c9f49f267b1f57dc 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -27,8 +26,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF10MatchSerializer.
  *
+ * @author michal.polkorab
  */
 public class OF10MatchSerializerTest {
 
@@ -36,7 +36,7 @@ public class OF10MatchSerializerTest {
     private OFSerializer<MatchV10> matchSerializer;
 
     /**
-     * Initializes serializer table and stores correct factory in field
+     * Initializes serializer table and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -47,11 +47,11 @@ public class OF10MatchSerializerTest {
     }
 
     /**
-     * Testing correct serialization of ofp_match
+     * Testing correct serialization of ofp_match.
      */
     @Test
     public void test() {
-        ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
+        final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         MatchV10Builder builder = new MatchV10Builder();
         builder.setWildcards(new FlowWildcardsV10(false, false, true, false,
                 false, true, false, true, true, true));
@@ -94,11 +94,11 @@ public class OF10MatchSerializerTest {
     }
 
     /**
-     * Testing correct serialization of ofp_match
+     * Testing correct serialization of ofp_match.
      */
     @Test
     public void test2() {
-        ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
+        final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         MatchV10Builder builder = new MatchV10Builder();
         builder.setWildcards(new FlowWildcardsV10(true, true, true, true,
                 true, true, true, true, true, true));
index 66462d8ba4dbed82b87f036c7d75c68239ac622e..e54beea9d5a06699d16f7b3463603ba77f47eb5b 100644 (file)
@@ -9,10 +9,8 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -57,15 +55,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF13ActionsSerializer.
  *
+ * @author michal.polkorab
  */
 public class OF13ActionsSerializerTest {
 
     private SerializerRegistry registry;
 
     /**
-     * Initializes serializer table and stores correct factory in field
+     * Initializes serializer table and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -74,18 +73,18 @@ public class OF13ActionsSerializerTest {
     }
 
     /**
-     * Testing correct serialization of actions
+     * Testing correct serialization of actions.
      */
     @Test
     public void test() {
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(42L));
         outputBuilder.setMaxLength(52);
         caseBuilder.setOutputAction(outputBuilder.build());
+        ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
+        List<Action> actions = new ArrayList<>();
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(new CopyTtlOutCaseBuilder().build());
@@ -152,9 +151,6 @@ public class OF13ActionsSerializerTest {
         actionBuilder.setActionChoice(new DecNwTtlCaseBuilder().build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
-        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
-        SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
-        List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
         matchBuilder.setOxmClass(OpenflowBasicClass.class);
         matchBuilder.setOxmMatchField(InPort.class);
@@ -164,8 +160,11 @@ public class OF13ActionsSerializerTest {
         inPortBuilder.setPortNumber(new PortNumber(1L));
         inPortCaseBuilder.setInPort(inPortBuilder.build());
         matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
+        List<MatchEntry> entries = new ArrayList<>();
         entries.add(matchBuilder.build());
+        SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
         setFieldBuilder.setMatchEntry(entries);
+        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
         setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
         actionBuilder.setActionChoice(setFieldCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -248,23 +247,20 @@ public class OF13ActionsSerializerTest {
     }
 
     /**
-     * Testing correct serialization of actions
+     * Testing correct serialization of actions.
      */
     @Test
     public void testHeaders() {
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(42L));
         outputBuilder.setMaxLength(52);
         caseBuilder.setOutputAction(outputBuilder.build());
+        ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
+        List<Action> actions = new ArrayList<>();
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
-        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
-        SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
-        List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
         matchBuilder.setOxmClass(OpenflowBasicClass.class);
         matchBuilder.setOxmMatchField(InPort.class);
@@ -274,8 +270,11 @@ public class OF13ActionsSerializerTest {
         inPortBuilder.setPortNumber(new PortNumber(1L));
         inPortCaseBuilder.setInPort(inPortBuilder.build());
         matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
+        List<MatchEntry> entries = new ArrayList<>();
         entries.add(matchBuilder.build());
+        SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
         setFieldBuilder.setMatchEntry(entries);
+        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
         setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
         actionBuilder.setActionChoice(setFieldCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -290,4 +289,4 @@ public class OF13ActionsSerializerTest {
         Assert.assertEquals("Wrong action length", 4, out.readUnsignedShort());
         Assert.assertTrue("Unread data", out.readableBytes() == 0);
     }
-}
\ No newline at end of file
+}
index 251c4c945d09bc894993bf326cbed74ac34c7452..40d708a43136f7f24ab19d49f6d827b6477e7f66 100644 (file)
@@ -9,10 +9,8 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -46,15 +44,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF13InstructionsSerializer.
  *
+ * @author michal.polkorab
  */
 public class OF13InstructionsSerializerTest {
 
     private SerializerRegistry registry;
 
     /**
-     * Initializes serializer table and stores correct factory in field
+     * Initializes serializer table and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -63,11 +62,11 @@ public class OF13InstructionsSerializerTest {
     }
 
     /**
-     * Testing instructions translation
+     * Testing instructions translation.
      */
     @Test
     public void test() {
-        List<Instruction> instructions = new ArrayList<>();
+        final List<Instruction> instructions = new ArrayList<>();
         // Goto_table instruction
         InstructionBuilder builder = new InstructionBuilder();
         GotoTableCaseBuilder gotoCaseBuilder = new GotoTableCaseBuilder();
@@ -99,16 +98,16 @@ public class OF13InstructionsSerializerTest {
         instructions.add(builder.build());
         // Write_actions instruction
         builder = new InstructionBuilder();
-        WriteActionsCaseBuilder writeActionsCaseBuilder = new WriteActionsCaseBuilder();
-        WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
-        List<Action> actions = new ArrayList<>();
-        ActionBuilder actionBuilder = new ActionBuilder();
+        final WriteActionsCaseBuilder writeActionsCaseBuilder = new WriteActionsCaseBuilder();
+        final WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
         outputBuilder.setPort(new PortNumber(45L));
         outputBuilder.setMaxLength(55);
         caseBuilder.setOutputAction(outputBuilder.build());
+        ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
+        List<Action> actions = new ArrayList<>();
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
@@ -123,8 +122,8 @@ public class OF13InstructionsSerializerTest {
         instructions.add(builder.build());
         // Apply_actions instruction
         builder = new InstructionBuilder();
-        ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
-        ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
+        final ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
+        final ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
         actions = new ArrayList<>();
         actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder vlanCaseBuilder = new PushVlanCaseBuilder();
index e27c049aaa78e53142ba3a3f1d5bf8c94ec05736..0f8eac8f716256837c459843cd43ca05d6e2f47b 100644 (file)
@@ -9,10 +9,8 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -157,8 +155,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF13MatchSerializer02.
  *
+ * @author michal.polkorab
  */
 public class OF13MatchSerializer02Test {
 
@@ -166,7 +165,7 @@ public class OF13MatchSerializer02Test {
     private OFSerializer<Match> matchSerializer;
 
     /**
-     * Initializes serializer table and stores correct factory in field
+     * Initializes serializer table and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -177,7 +176,7 @@ public class OF13MatchSerializer02Test {
     }
 
     /**
-     * Testing serialization of match
+     * Testing serialization of match.
      */
     @Test
     public void testEmptyMatch() {
@@ -194,13 +193,13 @@ public class OF13MatchSerializer02Test {
     }
 
     /**
-     * Testing serialization of match
+     * Testing serialization of match.
      */
     @Test
     public void test() {
         MatchBuilder builder = new MatchBuilder();
         builder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entryBuilder = new MatchEntryBuilder();
         entryBuilder.setOxmClass(OpenflowBasicClass.class);
         entryBuilder.setOxmMatchField(InPort.class);
@@ -268,7 +267,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setOxmClass(OpenflowBasicClass.class);
         entryBuilder.setOxmMatchField(VlanVid.class);
         entryBuilder.setHasMask(true);
-        VlanVidCaseBuilder vlanVidCaseBuilder = new VlanVidCaseBuilder();
+        final VlanVidCaseBuilder vlanVidCaseBuilder = new VlanVidCaseBuilder();
         VlanVidBuilder vlanVidBuilder = new VlanVidBuilder();
         vlanVidBuilder.setVlanVid(45);
         vlanVidBuilder.setCfiBit(true);
@@ -524,11 +523,11 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setOxmClass(OpenflowBasicClass.class);
         entryBuilder.setOxmMatchField(Icmpv6Code.class);
         entryBuilder.setHasMask(false);
-        Icmpv6CodeCaseBuilder Icmpv6CodeCaseBuilder = new Icmpv6CodeCaseBuilder();
-        Icmpv6CodeBuilder Icmpv6CodeBuilder = new Icmpv6CodeBuilder();
-        Icmpv6CodeBuilder.setIcmpv6Code((short) 60);
-        Icmpv6CodeCaseBuilder.setIcmpv6Code(Icmpv6CodeBuilder.build());
-        entryBuilder.setMatchEntryValue(Icmpv6CodeCaseBuilder.build());
+        Icmpv6CodeCaseBuilder icmpv6CodeCaseBuilder = new Icmpv6CodeCaseBuilder();
+        Icmpv6CodeBuilder icmpv6CodeBuilder = new Icmpv6CodeBuilder();
+        icmpv6CodeBuilder.setIcmpv6Code((short) 60);
+        icmpv6CodeCaseBuilder.setIcmpv6Code(icmpv6CodeBuilder.build());
+        entryBuilder.setMatchEntryValue(icmpv6CodeCaseBuilder.build());
         entries.add(entryBuilder.build());
         entryBuilder.setOxmClass(OpenflowBasicClass.class);
         entryBuilder.setOxmMatchField(Ipv6NdTarget.class);
@@ -573,21 +572,21 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setOxmClass(OpenflowBasicClass.class);
         entryBuilder.setOxmMatchField(MplsTc.class);
         entryBuilder.setHasMask(false);
-        MplsTcCaseBuilder MplsTcCaseBuilder = new MplsTcCaseBuilder();
-        MplsTcBuilder MplsTcBuilder = new MplsTcBuilder();
-        MplsTcBuilder.setTc((short) 62);
-        MplsTcCaseBuilder.setMplsTc(MplsTcBuilder.build());
-        entryBuilder.setMatchEntryValue(MplsTcCaseBuilder.build());
+        MplsTcCaseBuilder mplsTcCaseBuilder = new MplsTcCaseBuilder();
+        MplsTcBuilder mplsTcBuilder = new MplsTcBuilder();
+        mplsTcBuilder.setTc((short) 62);
+        mplsTcCaseBuilder.setMplsTc(mplsTcBuilder.build());
+        entryBuilder.setMatchEntryValue(mplsTcCaseBuilder.build());
         entries.add(entryBuilder.build());
         entryBuilder = new MatchEntryBuilder();
         entryBuilder.setOxmClass(OpenflowBasicClass.class);
         entryBuilder.setOxmMatchField(MplsBos.class);
         entryBuilder.setHasMask(false);
-        MplsBosCaseBuilder MplsBosCaseBuilder = new MplsBosCaseBuilder();
-        MplsBosBuilder MplsBosBuilder = new MplsBosBuilder();
-        MplsBosBuilder.setBos(true);
-        MplsBosCaseBuilder.setMplsBos(MplsBosBuilder.build());
-        entryBuilder.setMatchEntryValue(MplsBosCaseBuilder.build());
+        MplsBosCaseBuilder mplsBosCaseBuilder = new MplsBosCaseBuilder();
+        MplsBosBuilder mplsBosBuilder = new MplsBosBuilder();
+        mplsBosBuilder.setBos(true);
+        mplsBosCaseBuilder.setMplsBos(mplsBosBuilder.build());
+        entryBuilder.setMatchEntryValue(mplsBosCaseBuilder.build());
         entries.add(entryBuilder.build());
         entryBuilder = new MatchEntryBuilder();
         entryBuilder.setOxmClass(OpenflowBasicClass.class);
index 0c2a6aa0dd4193650661bfe4b328393da772d790..994b79b3ebdd2788f313ee33379c43b72552f668 100644 (file)
@@ -10,10 +10,8 @@ package org.opendaylight.openflowjava.protocol.impl.util;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -26,8 +24,6 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6FlowLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.TcpFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.oxm.container.match.entry.value.experimenter.id._case.TcpFlagsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.experimenter.id._case.ExperimenterBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
@@ -59,8 +55,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OF13MatchSerializer.
  *
+ * @author michal.polkorab
  */
 public class OF13MatchSerializerTest {
 
@@ -70,7 +67,7 @@ public class OF13MatchSerializerTest {
     private OFSerializer<Match> matchSerializer;
 
     /**
-     * Initializes serializer table and stores correct factory in field
+     * Initializes serializer table and stores correct factory in field.
      */
     @Before
     public void startUp() {
@@ -81,13 +78,13 @@ public class OF13MatchSerializerTest {
     }
 
     /**
-     * Test for correct serialization of Ipv4Address match entry
+     * Test for correct serialization of Ipv4Address match entry.
      */
     @Test
     public void testIpv4Src() {
         MatchBuilder builder = new MatchBuilder();
         builder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(Ipv4Src.class);
@@ -116,13 +113,13 @@ public class OF13MatchSerializerTest {
     }
 
     /**
-     * Test for correct serialization of Ipv6Address match entry
+     * Test for correct serialization of Ipv6Address match entry.
      */
     @Test
     public void testIpv6Various() {
         MatchBuilder builder = new MatchBuilder();
         builder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         // ipv6 match entry with correct Ipv6 address
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
@@ -243,13 +240,13 @@ public class OF13MatchSerializerTest {
     }
 
     /**
-     * Test for correct serialization of incorrect Ipv6Address match entry
+     * Test for correct serialization of incorrect Ipv6Address match entry.
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testIpv6Incorrect() {
         MatchBuilder builder = new MatchBuilder();
         builder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         // ipv6 match entry with incorrect Ipv6 address
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
@@ -268,7 +265,7 @@ public class OF13MatchSerializerTest {
     }
 
     /**
-     * Test for correct serialization of Ipv4Address match entry
+     * Test for correct serialization of Ipv4Address match entry.
      */
     @Test
     public void testIpv6Flabel() {
@@ -290,7 +287,7 @@ public class OF13MatchSerializerTest {
     }
 
     /**
-     * Test for correct serialization of Ipv4Address match entry
+     * Test for correct serialization of Ipv4Address match entry.
      */
     @Test
     public void testIpv6FlabelWithMask() {
@@ -313,7 +310,7 @@ public class OF13MatchSerializerTest {
     }
 
     /**
-     * Test for correct serialization of Ipv4Address match entry with wrong mask
+     * Test for correct serialization of Ipv4Address match entry with wrong mask.
      */
     @Test
     public void testIpv6FlabelWithMaskBad() {
@@ -328,16 +325,10 @@ public class OF13MatchSerializerTest {
         }
     }
 
-    /**
-     * @param labelValue ipv6 flow label
-     * @param hasMask
-     * @param mask ipv6 flow label mask
-     * @return
-     */
     private static Match buildIpv6FLabelMatch(long labelValue, boolean hasMask, byte[] mask) {
         MatchBuilder builder = new MatchBuilder();
         builder.setType(OxmMatchType.class);
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
         entriesBuilder.setOxmMatchField(Ipv6Flabel.class);
@@ -355,7 +346,7 @@ public class OF13MatchSerializerTest {
     }
 
     /**
-     * Test Standard match type
+     * Test Standard match type.
      */
     @Test
     public void testStandardMatchType() {
@@ -374,11 +365,11 @@ public class OF13MatchSerializerTest {
 
     /**
      * Test serialize experimenter match entry - with no experimenter
-     * match entry serializer registered
+     * match entry serializer registered.
      */
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testSerializeExperimenterMatchEntry() {
-        List<MatchEntry> entries = new ArrayList<>();
+        final List<MatchEntry> entries = new ArrayList<>();
         MatchEntryBuilder builder = new MatchEntryBuilder();
         builder.setOxmClass(ExperimenterClass.class);
         builder.setOxmMatchField(OxmMatchFieldClass.class);
index 4a1ceb78585b200fb9cc501e8a2dffb6aad11e47..854077374ac0eca075a890007c27b5c3efeb4729 100644 (file)
@@ -15,13 +15,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortStateV10;
 
 /**
- * @author michal.polkorab
+ * Unit tests for OpenflowUtils.
  *
+ * @author michal.polkorab
  */
 public class OpenflowUtilsTest {
 
     /**
-     * Tests {@link OpenflowUtils#createPortState(long)}
+     * Tests {@link OpenflowUtils#createPortState(long)}.
      */
     @Test
     public void testPortState() {
@@ -39,7 +40,7 @@ public class OpenflowUtilsTest {
     }
 
     /**
-     * Tests {@link OpenflowUtils#createPortConfig(long)}
+     * Tests {@link OpenflowUtils#createPortConfig(long)}.
      */
     @Test
     public void testPortConfig() {
@@ -53,7 +54,7 @@ public class OpenflowUtilsTest {
     }
 
     /**
-     * Tests {@link OpenflowUtils#createPortFeatures(long)}
+     * Tests {@link OpenflowUtils#createPortFeatures(long)}.
      */
     @Test
     public void testPortFeatures() {
@@ -65,4 +66,4 @@ public class OpenflowUtilsTest {
         Assert.assertEquals("Wrong port features", new PortFeaturesV10(false, false, false, false, false, false,
                 false, false, false, false, false, false), features);
     }
-}
\ No newline at end of file
+}
index c95541c9c5433e8bc0b85d979f13f133fb345701..71a39319881ba956478d60dbb8122d7761bb0976 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.experimenter.id._case.ExperimenterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCase;
@@ -39,13 +38,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 
 /**
- * @author michal.polkorab
+ * Unit tests for TypeKeyMakerFactory.
  *
+ * @author michal.polkorab
  */
 public class TypeKeyMakerFactoryTest {
 
     /**
-     * Tests {@link TypeKeyMakerFactory#createActionKeyMaker(short)}
+     * Tests {@link TypeKeyMakerFactory#createActionKeyMaker(short)}.
      */
     @Test
     public void testActionKeyMaker() {
@@ -63,14 +63,15 @@ public class TypeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link TypeKeyMakerFactory#createActionKeyMaker(short)}
+     * Tests {@link TypeKeyMakerFactory#createActionKeyMaker(short)}.
      */
     @Test
     public void testExperimenterActionKeyMaker() {
         TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID);
         Assert.assertNotNull("Null keyMaker", keyMaker);
 
-        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping
+            .ActionBuilder builder = new ActionBuilder();
         builder.setExperimenterId(new ExperimenterId(42L));
         builder.setActionChoice(new CopyTtlInCaseBuilder().build());
         Action action = builder.build();
@@ -82,11 +83,12 @@ public class TypeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link TypeKeyMakerFactory#createInstructionKeyMaker(short)}
+     * Tests {@link TypeKeyMakerFactory#createInstructionKeyMaker(short)}.
      */
     @Test
     public void testInstructionKeyMaker() {
-        TypeKeyMaker<Instruction> keyMaker = TypeKeyMakerFactory.createInstructionKeyMaker(EncodeConstants.OF13_VERSION_ID);
+        TypeKeyMaker<Instruction> keyMaker =
+                TypeKeyMakerFactory.createInstructionKeyMaker(EncodeConstants.OF13_VERSION_ID);
         Assert.assertNotNull("Null keyMaker", keyMaker);
 
         InstructionBuilder builder = new InstructionBuilder();
@@ -100,11 +102,12 @@ public class TypeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link TypeKeyMakerFactory#createInstructionKeyMaker(short)}
+     * Tests {@link TypeKeyMakerFactory#createInstructionKeyMaker(short)}.
      */
     @Test
     public void testExperimenterInstructionKeyMaker() {
-        TypeKeyMaker<Instruction> keyMaker = TypeKeyMakerFactory.createInstructionKeyMaker(EncodeConstants.OF13_VERSION_ID);
+        TypeKeyMaker<Instruction> keyMaker =
+                TypeKeyMakerFactory.createInstructionKeyMaker(EncodeConstants.OF13_VERSION_ID);
         Assert.assertNotNull("Null keyMaker", keyMaker);
 
         InstructionBuilder builder = new InstructionBuilder();
@@ -119,11 +122,12 @@ public class TypeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link TypeKeyMakerFactory#createMatchEntriesKeyMaker(short)}
+     * Tests {@link TypeKeyMakerFactory#createMatchEntriesKeyMaker(short)}.
      */
     @Test
     public void testMatchEntriesKeyMaker() {
-        TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
+        TypeKeyMaker<MatchEntry> keyMaker =
+                TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
         Assert.assertNotNull("Null keyMaker", keyMaker);
 
         MatchEntryBuilder builder = new MatchEntryBuilder();
@@ -140,11 +144,12 @@ public class TypeKeyMakerFactoryTest {
     }
 
     /**
-     * Tests {@link TypeKeyMakerFactory#createMatchEntriesKeyMaker(short)}
+     * Tests {@link TypeKeyMakerFactory#createMatchEntriesKeyMaker(short)}.
      */
     @Test
     public void testExperimenterMatchEntriesKeyMaker() {
-        TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
+        TypeKeyMaker<MatchEntry> keyMaker =
+                TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
         Assert.assertNotNull("Null keyMaker", keyMaker);
 
         MatchEntryBuilder builder = new MatchEntryBuilder();
@@ -166,11 +171,7 @@ public class TypeKeyMakerFactoryTest {
         Assert.assertEquals("Wrong key", comparationKey, key);
     }
 
-    private class ActionSubtypeClass extends ExperimenterActionSubType {
-        // only for testing purposes
-    }
-
     private class OxmMatchFieldClass extends MatchField {
         // only for testing purposes
     }
-}
\ No newline at end of file
+}