Example #1
0
 @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));
 }
Example #2
0
 @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));
 }
Example #3
0
 @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));
 }
Example #4
0
 @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));
 }
Example #5
0
 @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));
 }