<type>pom</type>
<scope>import</scope>
</dependency>
- <dependency>
- <groupId>junit-addons</groupId>
- <artifactId>junit-addons</artifactId>
- <version>1.4</version>
- </dependency>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock</artifactId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit-addons</groupId>
- <artifactId>junit-addons</artifactId>
- </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>common.unittest.tools</artifactId>
</dependency>
- <dependency>
- <groupId>junit-addons</groupId>
- <artifactId>junit-addons</artifactId>
- </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit-addons</groupId>
- <artifactId>junit-addons</artifactId>
- <version>1.4</version>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
*/
package org.opendaylight.lispflowmapping.lisp.authentication;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.MapNotifySerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.MapRegisterSerializer;
new MappingRecordItemBuilder().setMappingRecord(etlrBuilder.build()).setMappingRecordItemId("xyzzy")
.build());
final ByteBuffer serializedMapNotifyMsg = MapNotifySerializer.getInstance().serialize(mapNotifyBuilder.build());
- ArrayAssert.assertEquals(new byte[0], LispAuthenticationUtil.createAuthenticationData(serializedMapNotifyMsg,
+ assertArrayEquals(new byte[0], LispAuthenticationUtil.createAuthenticationData(serializedMapNotifyMsg,
"password"));
}
- private static boolean validate(MapRegister mapRegister, ByteBuffer byteBuffer, Eid eid, Uint16 keyId, String
- password) {
+ private static boolean validate(final MapRegister mapRegister, final ByteBuffer byteBuffer, final Eid eid,
+ final Uint16 keyId, final String password) {
MappingAuthkey key = new MappingAuthkeyBuilder().setKeyType(keyId).setKeyString(password).build();
return LispAuthenticationUtil.validate(mapRegister,byteBuffer, eid, key);
}
*/
package org.opendaylight.lispflowmapping.serializer;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.MapNotifySerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializationException;
byte[] actualAuthenticationData = new byte[20];
bb.get(actualAuthenticationData);
- ArrayAssert.assertEquals(authenticationData, actualAuthenticationData);
+ assertArrayEquals(authenticationData, actualAuthenticationData);
bb.position(bb.position() + 12); /* EID in first record */
assertEquals(0x1, bb.getInt());
mnBuilder.setAuthenticationData(authenticationData);
MapNotify mn = mnBuilder.build();
- ArrayAssert.assertEquals(MapNotifySerializer.getInstance().serialize(mn).array(),
+ assertArrayEquals(MapNotifySerializer.getInstance().serialize(mn).array(),
MapNotifySerializer.getInstance().serialize(MapNotifySerializer.getInstance()
.deserialize(MapNotifySerializer.getInstance().serialize(mn))).array());
assertEquals(0xFFBB000000000000L, mn.getNonce().longValue());
assertEquals(0x0000, mn.getKeyId().shortValue());
byte[] expectedAuthenticationData = {};
- ArrayAssert.assertEquals(expectedAuthenticationData, mn.getAuthenticationData());
+ assertArrayEquals(expectedAuthenticationData, mn.getAuthenticationData());
}
@Test
byte[] expectedAuthenticationData = { (byte) 0x2c, (byte) 0x61, (byte) 0xb9, (byte) 0xc9, (byte) 0x9a,
(byte) 0x20, (byte) 0xba, (byte) 0xd8, (byte) 0xf5, (byte) 0x40, (byte) 0xd3, (byte) 0x55, (byte) 0x6f,
(byte) 0x5f, (byte) 0x6e, (byte) 0x5a, (byte) 0xb2, (byte) 0x0a, (byte) 0xbf, (byte) 0xb5 };
- ArrayAssert.assertEquals(expectedAuthenticationData, mn.getAuthenticationData());
+ assertArrayEquals(expectedAuthenticationData, mn.getAuthenticationData());
}
@Test
(byte) 0x8c, (byte) 0x57, (byte) 0x6d, (byte) 0x68, (byte) 0xa5, (byte) 0xbf, (byte) 0x32, (byte) 0x11,
(byte) 0xc9, (byte) 0x7b, (byte) 0x58, (byte) 0xc4, (byte) 0xb9, (byte) 0x9f, (byte) 0x06, (byte) 0x11,
(byte) 0x23, (byte) 0xb9, (byte) 0x38 };
- ArrayAssert.assertEquals(expectedAuthenticationData, mn.getAuthenticationData());
+ assertArrayEquals(expectedAuthenticationData, mn.getAuthenticationData());
}
}
*/
package org.opendaylight.lispflowmapping.serializer;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.MapRegisterSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.MapRegisterSerializer.Length;
byte[] actualAuthenticationData = new byte[20];
bb.get(actualAuthenticationData);
- ArrayAssert.assertEquals(authenticationData, actualAuthenticationData);
+ assertArrayEquals(authenticationData, actualAuthenticationData);
bb.position(bb.position() + 12); // EID in first record
assertEquals(0x1, bb.getInt());
byte[] actualXtrId = new byte[Length.XTRID_SIZE];
bb.get(actualXtrId);
- ArrayAssert.assertEquals(xtrId.getValue(), actualXtrId);
+ assertArrayEquals(xtrId.getValue(), actualXtrId);
byte[] actualSiteId = new byte[Length.SITEID_SIZE];
bb.get(actualSiteId);
- ArrayAssert.assertEquals(siteId.getValue(), actualSiteId);
+ assertArrayEquals(siteId.getValue(), actualSiteId);
assertEquals(bb.position(), bb.capacity());
}
mrBuilder.setAuthenticationData(authenticationData);
MapRegister mapRegister = mrBuilder.build();
- ArrayAssert.assertEquals(
- MapRegisterSerializer.getInstance().serialize(mapRegister).array(),
+ assertArrayEquals(MapRegisterSerializer.getInstance().serialize(mapRegister).array(),
MapRegisterSerializer.getInstance()
.serialize(MapRegisterSerializer.getInstance().deserialize(MapRegisterSerializer.getInstance()
.serialize(mapRegister), null)).array());
assertEquals(0xFFBB000000000000L, mr.getNonce().longValue());
assertEquals(0x0000, mr.getKeyId().shortValue());
byte[] expectedAuthenticationData = {};
- ArrayAssert.assertEquals(expectedAuthenticationData, mr.getAuthenticationData());
+ assertArrayEquals(expectedAuthenticationData, mr.getAuthenticationData());
}
@Test
assertTrue(mr.getXtrSiteIdPresent());
- ArrayAssert.assertEquals(bb.array(), MapRegisterSerializer.getInstance().serialize(mr).array());
+ assertArrayEquals(bb.array(), MapRegisterSerializer.getInstance().serialize(mr).array());
}
@Test
byte[] expectedAuthenticationData = { (byte) 0x2c, (byte) 0x61, (byte) 0xb9, (byte) 0xc9, (byte) 0x9a,
(byte) 0x20, (byte) 0xba, (byte) 0xd8, (byte) 0xf5, (byte) 0x40, (byte) 0xd3, (byte) 0x55, (byte) 0x6f,
(byte) 0x5f, (byte) 0x6e, (byte) 0x5a, (byte) 0xb2, (byte) 0x0a, (byte) 0xbf, (byte) 0xb5 };
- ArrayAssert.assertEquals(expectedAuthenticationData, mr.getAuthenticationData());
+ assertArrayEquals(expectedAuthenticationData, mr.getAuthenticationData());
}
@Test
(byte) 0x8c, (byte) 0x57, (byte) 0x6d, (byte) 0x68, (byte) 0xa5, (byte) 0xbf, (byte) 0x32, (byte) 0x11,
(byte) 0xc9, (byte) 0x7b, (byte) 0x58, (byte) 0xc4, (byte) 0xb9, (byte) 0x9f, (byte) 0x06, (byte) 0x11,
(byte) 0x23, (byte) 0xb9, (byte) 0x38 };
- ArrayAssert.assertEquals(expectedAuthenticationData, mr.getAuthenticationData());
+ assertArrayEquals(expectedAuthenticationData, mr.getAuthenticationData());
}
}
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import junitx.framework.ArrayAssert;
import org.junit.Ignore;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.MapReplySerializer;
0x08 };
byte[] actual = new byte[16];
packet.get(actual);
- ArrayAssert.assertEquals(expected, actual);
+ assertArrayEquals(expected, actual);
packet.position(packet.position() + 12); // EID in second record
assertEquals(0x08020405, packet.getInt());
*/
package org.opendaylight.lispflowmapping.serializer.address;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
import com.google.common.collect.ImmutableSet;
import java.nio.ByteBuffer;
import java.util.Iterator;
import java.util.Set;
-import junitx.framework.ArrayAssert;
-import junitx.framework.Assert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializationException;
+ "01 00 00 18 "
+ "00 01 AA BB CC DD " // IPv4
+ "00 02 11 22 33 44 11 22 33 44 11 22 33 44 11 22 33 44");
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
@Test
LispAddressSerializer.getInstance().serialize(buf, rb.build());
ByteBuffer expectedBuf = hexToByteBuffer("40 03 00 00 "
+ "01 00 00 00");
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
@Test
.lisp.address.address.afi.list.AfiList address3 = listBuilder.build();
assertEquals(address1, address2);
- Assert.assertNotEquals(address2, address3);
- Assert.assertNotEquals(address1, address3);
+ assertNotEquals(address2, address3);
+ assertNotEquals(address1, address3);
}
}
*/
package org.opendaylight.lispflowmapping.serializer.address;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializationException;
+ "A6 A1 A6 A2 " // local port range
+ "FF DD FF DE " // remote port range
+ "00 01 11 22 33 44"); // AFI=1, IP=0x11223344
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
}
*/
package org.opendaylight.lispflowmapping.serializer.address;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializationException;
ByteBuffer buf = ByteBuffer.allocate(LispAddressSerializer.getInstance().getAddressSize(eb.build()));
LispAddressSerializer.getInstance().serialize(buf, eb.build());
ByteBuffer expectedBuf = hexToByteBuffer("00 11 64 61 76 69 64 00");
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
}
*/
package org.opendaylight.lispflowmapping.serializer.address;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializationException;
+ "0A 00 00 10 "
+ "00 00 00 01 AA BB CC DD " // IPv4
+ "00 00 00 01 11 22 33 44"); // IPv4
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
@Test
LispAddressSerializer.getInstance().serialize(buf, rb.build());
ByteBuffer expectedBuf = hexToByteBuffer("40 03 00 00 "
+ "0A 00 00 00");
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
}
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializerContext;
+ "02 20 00 0A "
+ "00 02 03 04 " // instance ID
+ "00 01 11 22 33 44");
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
}
*/
package org.opendaylight.lispflowmapping.serializer.address;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.exception.LispSerializationException;
+ "0F 00 00 0C "
+ "00 01 11 22 33 44 " // AFI=1, IP=0x11223344
+ "00 01 22 33 44 55"); // AFI=1, IP=0x22334455
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
}
*/
package org.opendaylight.lispflowmapping.serializer.address;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializerContext;
ByteBuffer expectedBuf = hexToByteBuffer("40 03 00 00 "
+ "11 00 00 04 "
+ "00 00 01 FF");
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
}
*/
package org.opendaylight.lispflowmapping.serializer.address;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
-import junitx.framework.ArrayAssert;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializer;
import org.opendaylight.lispflowmapping.lisp.serializer.address.LispAddressSerializerContext;
+ "00 00 08 10 " // reserved + masks
+ "00 01 11 22 33 44 " // AFI=1, IP=0x11223344
+ "00 01 22 33 44 55"); // AFI=1, IP=0x22334455
- ArrayAssert.assertEquals(expectedBuf.array(), buf.array());
+ assertArrayEquals(expectedBuf.array(), buf.array());
}
}
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit-addons</groupId>
- <artifactId>junit-addons</artifactId>
- <version>1.4</version>
- <scope>test</scope>
- </dependency>
</dependencies>
</dependencyManagement>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
</dependency>
- <dependency>
- <groupId>junit-addons</groupId>
- <artifactId>junit-addons</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.lispflowmapping</groupId>
<artifactId>common.unittest.tools</artifactId>
package org.opendaylight.lispflowmapping.southbound.lisp;
import static io.netty.buffer.Unpooled.wrappedBuffer;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
-import junitx.framework.ArrayAssert;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Before;
import org.junit.BeforeClass;
Arrays.copyOfRange(mapRegisterPacket, 36, mapRegisterPacket.length));
byte[] notifyWithoutTypeWithOutAuthenticationData = ArrayUtils.addAll(Arrays.copyOfRange(result, 3, 16),
Arrays.copyOfRange(result, 36, result.length));
- ArrayAssert.assertEquals(registerWithoutTypeWithoutAuthenticationData,
- notifyWithoutTypeWithOutAuthenticationData);
+ assertArrayEquals(registerWithoutTypeWithoutAuthenticationData, notifyWithoutTypeWithOutAuthenticationData);
}
@Ignore
assertEquals(AddressFamily.IpV6.getIntValue(), ByteUtil.getInt(result, MapReplyIpv4SingleLocatorPos.AFI_TYPE));
byte[] expectedIpv6 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
- ArrayAssert.assertEquals(expectedIpv6, Arrays.copyOfRange(result, 24, 40));
+ assertArrayEquals(expectedIpv6, Arrays.copyOfRange(result, 24, 40));
}
@Test
assertEquals(64, result.length);
byte[] expectedIpv6Eid = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
- ArrayAssert.assertEquals(expectedIpv6Eid, Arrays.copyOfRange(result, 24, 40));
+ assertArrayEquals(expectedIpv6Eid, Arrays.copyOfRange(result, 24, 40));
byte[] expectedIpv6Rloc = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 };
- ArrayAssert.assertEquals(expectedIpv6Rloc, Arrays.copyOfRange(result, 48, 64));
+ assertArrayEquals(expectedIpv6Rloc, Arrays.copyOfRange(result, 48, 64));
}
@Ignore
assertEquals(AddressFamily.IpV6.getIntValue(), ByteUtil.getInt(result, MapReplyIpv4SecondLocatorPos.LOC_AFI));
byte[] expectedIpv6Rloc = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
- ArrayAssert.assertEquals(expectedIpv6Rloc, Arrays.copyOfRange(result, MapReplyIpv4SecondLocatorPos.LOCATOR,
+ assertArrayEquals(expectedIpv6Rloc, Arrays.copyOfRange(result, MapReplyIpv4SecondLocatorPos.LOCATOR,
MapReplyIpv4SecondLocatorPos.LOCATOR + 16));
assertEquals(0x01, result[MapReplyIpv4SecondLocatorPos.LOCATOR_RBIT] & 0x01);