diff options
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/utils')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/utils/V3poUtilsTest.java | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/utils/V3poUtilsTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/utils/V3poUtilsTest.java index 3cb054ad4..115eb2b9c 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/utils/V3poUtilsTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/utils/V3poUtilsTest.java @@ -1,35 +1,17 @@ package io.fd.honeycomb.v3po.translate.v3po.utils; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertArrayEquals; import org.junit.Test; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; public class V3poUtilsTest { @Test - public void testRemoveIpv4AddressNoZoneFromIpv4WithZone() throws Exception { - String ipWithZone = "1.2.3.4%20"; - String ipNoZone = "1.2.3.4"; - final Ipv4Address expectedIp = new Ipv4Address(ipNoZone); - final Ipv4AddressNoZone actualIp = V3poUtils.removeIpv4AddressNoZone(new Ipv4Address(ipWithZone)); - assertEquals(expectedIp.getValue(), actualIp.getValue()); - } - - @Test - public void testRemoveIpv4AddressNoZoneFromIpv4WithoutZone() throws Exception { - String ipNoZone = "1.2.3.4"; - final Ipv4Address expectedIp = new Ipv4Address(ipNoZone); - final Ipv4AddressNoZone actualIp = V3poUtils.removeIpv4AddressNoZone(expectedIp); - assertEquals(expectedIp.getValue(), actualIp.getValue()); - } - - @Test - public void testRemoveIpv4AddressNoZoneNop() throws Exception { - String ipNoZone = "1.2.3.4"; - final Ipv4Address expectedIp = new Ipv4AddressNoZone(ipNoZone); - final Ipv4AddressNoZone actualIp = V3poUtils.removeIpv4AddressNoZone(expectedIp); - assertEquals(expectedIp, actualIp); + public void testToString() { + final byte[] expected = "test".getBytes(); + final byte[] cString = new byte[expected.length+10]; + System.arraycopy(expected, 0, cString, 0, expected.length); + final String jString = V3poUtils.toString(cString); + assertArrayEquals(expected, jString.getBytes()); } }
\ No newline at end of file |