BGPCEP/concepts - get rid of util dependency 34/8534/3
authorMilos Fabian <milfabia@cisco.com>
Wed, 2 Jul 2014 10:31:59 +0000 (12:31 +0200)
committerMilos Fabian <milfabia@cisco.com>
Fri, 4 Jul 2014 07:17:26 +0000 (07:17 +0000)
Change-Id: I7fa5d0c426200d0947e6a689f8f9f4986d6722f9
Signed-off-by: Milos Fabian <milfabia@cisco.com>
concepts/pom.xml
concepts/src/test/java/org/opendaylight/protocol/concepts/BandwidthTest.java

index 3d391cac80dace861ec680b3bc2d548b2ac701e3..cf099432717b5867501ec60b82c3c5eca57e5f99 100644 (file)
@@ -74,8 +74,8 @@
             <artifactId>junit</artifactId>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>util</artifactId>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-buffer</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>
index 90f5a931aac11119d0f5cac0bbbc685e0449832f..3453972e79cf10399ec7d9759367fa5a56ccad6f 100644 (file)
@@ -14,11 +14,11 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
 
+import io.netty.buffer.Unpooled;
 import java.util.HashSet;
 import java.util.Set;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth;
 
 public class BandwidthTest {
@@ -26,15 +26,15 @@ public class BandwidthTest {
 
     @Before
     public void setUp() {
-        this.b1 = new Bandwidth(ByteArray.intToBytes(1000, 4));
-        this.b2 = new Bandwidth(ByteArray.intToBytes(2000, 4));
-        this.b3 = new Bandwidth(ByteArray.intToBytes(2000, 4));
-        this.b4 = new Bandwidth(ByteArray.intToBytes(100, 4));
+        this.b1 = new Bandwidth(Unpooled.copyInt(1000).array());
+        this.b2 = new Bandwidth(Unpooled.copyInt(2000).array());
+        this.b3 = new Bandwidth(Unpooled.copyInt(2000).array());
+        this.b4 = new Bandwidth(Unpooled.copyInt(100).array());
     }
 
     @Test
     public void testBitsBytes() {
-        assertEquals(1000.0, ByteArray.bytesToLong(this.b1.getValue()), 0.1);
+        assertEquals(1000.0, Unpooled.wrappedBuffer(this.b1.getValue()).readInt(), 0.1);
     }
 
     @Test