Bump upstreams
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / match / ArpSourceTransportAddressEntryDeserializerTest.java
index dc83ae1f3b2fe349db77a35bf70b2ec3e4dcd440..a2d5165c74407d28bc1a0c521476ba9e710b6a3f 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
 
 import static org.junit.Assert.assertEquals;
@@ -14,7 +13,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
 import java.util.Iterator;
 import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchConvertorUtil;
@@ -24,28 +22,27 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
 
 public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
     @Test
-    public void deserializeEntry() throws Exception {
+    public void deserializeEntry() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
         final Ipv4Prefix arpSourceTransportAddress = new Ipv4Prefix("192.168.0.0/24");
         final Ipv4Prefix arpSourceTransportAddressNoMask = new Ipv4Prefix("192.168.0.0/32");
 
         writeHeader(in, false);
         Iterator<String> addressParts = IpConversionUtil.splitToParts(arpSourceTransportAddressNoMask);
-        in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
+        in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
 
         assertEquals(arpSourceTransportAddressNoMask.getValue(),
-                ArpMatch.class.cast(deserialize(in).getLayer3Match()).getArpSourceTransportAddress().getValue());
+                ((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceTransportAddress().getValue());
         assertEquals(0, in.readableBytes());
 
         writeHeader(in, true);
         addressParts = IpConversionUtil.splitToParts(arpSourceTransportAddress);
-        in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
+        in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
         in.writeBytes(MatchConvertorUtil.extractIpv4Mask(addressParts));
 
         final Ipv4Prefix desAddress =
-                ArpMatch.class.cast(deserialize(in).getLayer3Match()).getArpSourceTransportAddress();
+                ((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceTransportAddress();
         assertEquals(arpSourceTransportAddress.getValue(), desAddress.getValue());
         assertEquals(0, in.readableBytes());
     }
@@ -62,6 +59,6 @@ public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatc
 
     @Override
     protected int getValueLength() {
-        return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+        return Integer.BYTES;
     }
 }