@Test public void ipv4_dash() { final Domain domain = Domain.parse("0-127.10.10.10.in-addr.arpa"); assertThat(domain.getValue(), is(ciString("0-127.10.10.10.in-addr.arpa"))); assertThat((Ipv4Resource) domain.getReverseIp(), is(Ipv4Resource.parse("10.10.10.0/25"))); assertThat(domain.getType(), is(Domain.Type.INADDR)); }
@Test public void valid_ipv4() { final Domain domain = Domain.parse("200.193.193.in-addr.arpa"); assertThat(domain.getValue(), is(ciString("200.193.193.in-addr.arpa"))); assertThat((Ipv4Resource) domain.getReverseIp(), is(Ipv4Resource.parse("193.193.200/24"))); assertThat(domain.getType(), is(Domain.Type.INADDR)); }
@Test public void enum_domain() { final Domain domain = Domain.parse("2.1.2.1.5.5.5.2.0.2.1.e164.arpa"); assertThat(domain.getValue(), is(ciString("2.1.2.1.5.5.5.2.0.2.1.e164.arpa"))); assertNull(domain.getReverseIp()); assertThat(domain.getType(), is(Domain.Type.E164)); }
@Test public void valid_ipv6_trailing_dot() { final Domain domain = Domain.parse("0.0.0.0.8.f.7.0.1.0.0.2.ip6.arpa."); assertThat(domain.getValue(), is(ciString("0.0.0.0.8.f.7.0.1.0.0.2.ip6.arpa"))); assertThat((Ipv6Resource) domain.getReverseIp(), is(Ipv6Resource.parse("2001:7f8::/48"))); assertThat(domain.getType(), is(Domain.Type.IP6)); }
@Test public void ipv4_dash_non_prefix_range() { final Domain domain = Domain.parse("1-2.10.10.10.in-addr.arpa"); assertThat(domain.getValue(), is(ciString("1-2.10.10.10.in-addr.arpa"))); assertThat( (Ipv4Resource) domain.getReverseIp(), is(Ipv4Resource.parse("10.10.10.1-10.10.10.2"))); assertThat(domain.getType(), is(Domain.Type.INADDR)); }
@Test public void ipv4_prefix_32_allowed() { Domain domain = Domain.parse("200.193.193.193.in-addr.arpa."); assertThat(domain.getValue(), is(ciString("200.193.193.193.in-addr.arpa"))); }