diff options
author | 2016-09-23 16:39:09 +0200 | |
---|---|---|
committer | 2016-09-23 16:41:57 +0200 | |
commit | 60d69218642cc976fa606fd8a38623d8c035dd86 (patch) | |
tree | a0ccb089d93198ff7c9974eaf3e39e44a1a1f06d /vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/AddressTranslatorTest.java | |
parent | 08cd3ae5fd61d60ec07996179146c956459c084f (diff) |
HONEYCOMB-145 - Utility Class Refactoring
problematic mockito-all changed to mockito-core( https://github.com/mockito/mockito/issues/324)
Translate Utils Splitted to multiple Trait Interfaces
Ipv4Translator - Logic for translation of ipv4-based data
Ipv6Translator - Logic for translation of ipv6-based data
MacTranslator - Logic for translation of mac-based data
AddressTranslator - Aggregation trait for Ipv4/Ipv6/Mac
JvppReplyConsumer - Logic for extracting replies from jvpp calls
ByteDataTranslator - any byte-based conversions
Plus some existing utility classes changed to traits
Change-Id: I342b625954223966802e65dca0fabf8456c89345
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/AddressTranslatorTest.java')
-rw-r--r-- | vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/AddressTranslatorTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/AddressTranslatorTest.java b/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/AddressTranslatorTest.java new file mode 100644 index 000000000..92f58c933 --- /dev/null +++ b/vpp-common/vpp-translate-utils/src/test/java/io/fd/honeycomb/translate/v3po/util/AddressTranslatorTest.java @@ -0,0 +1,20 @@ +package io.fd.honeycomb.translate.v3po.util; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +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.Ipv6Address; + +public class AddressTranslatorTest implements AddressTranslator { + + @Test + public void testRevertAddress() { + assertEquals("1.2.168.192", + reverseAddress(new IpAddress(new Ipv4Address("192.168.2.1"))).getIpv4Address().getValue()); + assertEquals("3473:7003:2e8a::a385:b80d:120", + reverseAddress(new IpAddress(new Ipv6Address("2001:db8:85a3:0:0:8a2e:370:7334"))).getIpv6Address() + .getValue()); + } +}
\ No newline at end of file |