diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-05-04 10:17:39 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-05-05 08:41:23 +0200 |
commit | f187ae2f6a363616442a8968db1450977ce69078 (patch) | |
tree | 7e3c8799f931a47edbbf3a6ec40494a75a2a7d7f /v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/utils | |
parent | fd5c022142f871c78d29708c89afc941518acbd0 (diff) |
HONEYCOMB-10: Porting v3po2vpp to the new Java API
Change-Id: Ic7166b0f578442165595aa44a587ebbc5db0e75c
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
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 |