Code clean up 26/51226/9
authorClaudio D. Gasparini <cgaspari@cisco.com>
Tue, 31 Jan 2017 10:39:12 +0000 (11:39 +0100)
committerMilos Fabian <milos.fabian@pantheon.tech>
Fri, 10 Feb 2017 18:52:26 +0000 (18:52 +0000)
Migrate test from junit 3 to junit 4

Change-Id: I88e78739de6acf531154e2238e569ad5abd2f0da
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/ClusterIdAttributeParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/CommunitiesAttributeParserTest.java

index a364edd5a267b26de9dd52d5733953ff2328ac6b..36bc443e7b7fbfd94b71485af6f323dc65d68792 100644 (file)
@@ -8,11 +8,13 @@
 
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
 import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
-import junit.framework.TestCase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -23,7 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.attributes.ClusterIdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
 
-public class ClusterIdAttributeParserTest extends TestCase {
+public class ClusterIdAttributeParserTest {
     private static final byte[] clusterIdBytes = {(byte) 0x80, (byte) 0x0A, (byte) 0x08,
         (byte) 0xC0, (byte) 0xA8, (byte) 0x1, (byte) 0x1,
         (byte) 0xC0, (byte) 0xA8, (byte) 0x1, (byte) 0x2};
@@ -48,7 +50,7 @@ public class ClusterIdAttributeParserTest extends TestCase {
         final ByteBuf output = Unpooled.buffer();
         this.parser.serializeAttribute(clusterId, output);
 
-        Assert.assertArrayEquals(clusterIdBytes, ByteArray.getAllBytes(output));
+        assertArrayEquals(clusterIdBytes, ByteArray.getAllBytes(output));
 
         AttributesBuilder clusterIdOutput = new AttributesBuilder();
         this.parser.parseAttribute(Unpooled.wrappedBuffer(ByteArray.cutBytes(clusterIdBytes, 3)), clusterIdOutput);
index 262a41e1c670d2dce46f7c8c4a8a33928ccea10b..55af0528ab821bcdfadae167475bd4dc098e6ef3 100644 (file)
@@ -8,12 +8,13 @@
 
 package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
 import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
-import junit.framework.TestCase;
-import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.spi.pojo.ServiceLoaderBGPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
@@ -22,7 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.attributes.Communities;
 
-public class CommunitiesAttributeParserTest extends TestCase {
+public class CommunitiesAttributeParserTest {
 
     private static final byte[] CommunitiesBytes = {(byte) 0xC0, (byte) 0x08, (byte) 0x10,
         (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x1,
@@ -44,10 +45,10 @@ public class CommunitiesAttributeParserTest extends TestCase {
         final ByteBuf actual = Unpooled.buffer();
         ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry()
             .serializeAttribute(paBuilder.build(), actual);
-        Assert.assertArrayEquals(CommunitiesBytes, ByteArray.getAllBytes(actual));
+        assertArrayEquals(CommunitiesBytes, ByteArray.getAllBytes(actual));
         final Attributes attributeOut = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAttributeRegistry()
             .parseAttributes(actual);
-        assertEquals(comms,attributeOut.getCommunities());
+        assertEquals(comms, attributeOut.getCommunities());
     }
 
     @Test