X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=model%2Fietf%2Frfc6991-ietf-inet-types%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyang%2Fgen%2Fv1%2Furn%2Fietf%2Fparams%2Fxml%2Fns%2Fyang%2Fietf%2Finet%2Ftypes%2Frev130715%2FIpAddressNoZoneBuilderTest.java;h=d55793698dfe5b695a6ddcfbb2b1e47bf467d117;hb=31776f5c9d96892e93b8378ca09dc0c3caa41c2c;hp=bde7e1a61bf29bd9ce88a30a1e763c61fa090db1;hpb=74cbdbc42d704ab98d1dddf4def6bbd7b7361bbc;p=mdsal.git diff --git a/model/ietf/rfc6991-ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilderTest.java b/model/ietf/rfc6991-ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilderTest.java index bde7e1a61b..d55793698d 100644 --- a/model/ietf/rfc6991-ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilderTest.java +++ b/model/ietf/rfc6991-ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IpAddressNoZoneBuilderTest.java @@ -8,22 +8,13 @@ package org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; -import java.lang.reflect.Constructor; import org.junit.Test; public class IpAddressNoZoneBuilderTest { - @Test public void testGetDefaultInstance() throws Exception { - final Constructor constructor = IpAddressNoZoneBuilder.class.getDeclaredConstructor(); - assertFalse(constructor.isAccessible()); - constructor.setAccessible(true); - final IpAddressNoZoneBuilder newInstance = constructor.newInstance(); - assertNotNull(newInstance); - testIpv4("1.1.1.1"); testIpv4("192.168.155.100"); testIpv4("1.192.1.221"); @@ -41,18 +32,16 @@ public class IpAddressNoZoneBuilderTest { testIpv6("::"); } - @Test(expected = IllegalArgumentException.class) + @Test public void testIllegalArgumentException() { - IpAddressNoZoneBuilder.getDefaultInstance("2001:0DB8::CD3/60"); + assertThrows(IllegalArgumentException.class, () -> IetfInetUtil.ipAddressNoZoneFor("2001:0DB8::CD3/60")); } private static void testIpv4(final String ip) { - final IpAddressNoZone defaultInstance = IpAddressNoZoneBuilder.getDefaultInstance(ip); - assertEquals(new IpAddressNoZone(new Ipv4AddressNoZone(ip)), defaultInstance); + assertEquals(new IpAddressNoZone(new Ipv4AddressNoZone(ip)), IetfInetUtil.ipAddressNoZoneFor(ip)); } private static void testIpv6(final String ip) { - final IpAddressNoZone defaultInstance = IpAddressNoZoneBuilder.getDefaultInstance(ip); - assertEquals(new IpAddressNoZone(new Ipv6AddressNoZone(ip)), defaultInstance); + assertEquals(new IpAddressNoZone(new Ipv6AddressNoZone(ip)), IetfInetUtil.ipAddressNoZoneFor(ip)); } } \ No newline at end of file