import static com.google.common.net.InetAddresses.forString;
import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
import static org.opendaylight.mdsal.model.ietf.util.Ipv6Utils.fillIpv6Bytes;
-import java.lang.reflect.Constructor;
import org.junit.Test;
public class Ipv6UtilsTest {
assertArrayEquals(test1, bytesForString("0:0:0:0:0:0:13.1.68.3"));
assertArrayEquals(test1, bytesForString("::13.1.68.3"));
- final byte[] test2 = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte)255, (byte)255,
- (byte)129, (byte)144, 52, 38 };
+ final byte[] test2 = new byte[] {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte)255, (byte)255, (byte)129, (byte)144, 52, 38
+ };
assertArrayEquals(test2, bytesForString("0:0:0:0:0:FFFF:129.144.52.38"));
assertArrayEquals(test2, bytesForString("::FFFF:129.144.52.38"));
}
private static void assertEqualResult(final String str) {
assertArrayEquals(forString(str).getAddress(), bytesForString(str));
}
-
- @Test(expected = UnsupportedOperationException.class)
- public void privateConstructTest() throws Throwable {
- final Constructor<Ipv6Utils> constructor = Ipv6Utils.class.getDeclaredConstructor();
- assertFalse(constructor.isAccessible());
- constructor.setAccessible(true);
- try {
- constructor.newInstance();
- fail("Exception should be thrown");
- } catch (Exception e) {
- throw e.getCause();
- }
- }
-}
\ No newline at end of file
+}