Fix checkstyle violations in openflow-protocol-impl - part 12
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / PortModInputMessageFactoryTest.java
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);
     }