Package org.xbill.DNS

Examples of org.xbill.DNS.Name


  catch(IllegalArgumentException e){}
    }

    public void test_fromDNAME() throws NameTooLongException, TextParseException
    {
  Name own = new Name("the.owner.");
  Name alias = new Name("the.alias.");
  DNAMERecord dnr = new DNAMERecord(own, DClass.IN, 0xABCD, alias);
  Name sub = new Name("sub.the.owner.");
  Name exp = new Name("sub.the.alias.");

  Name n = sub.fromDNAME(dnr);
  assertEquals(exp, n);
    }
View Full Code Here


  assertEquals(exp, n);
    }

    public void test_fromDNAME_toobig() throws NameTooLongException, TextParseException
    {
  Name own = new Name("the.owner.");
  Name alias = new Name("the.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc.");
  DNAMERecord dnr = new DNAMERecord(own, DClass.IN, 0xABCD, alias);
  Name sub = new Name("ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd.the.owner.");

  try {
      sub.fromDNAME(dnr);
      fail("NameTooLongException not thrown");
  }
  catch(NameTooLongException e){}
    }
View Full Code Here

  catch(NameTooLongException e){}
    }

    public void test_fromDNAME_disjoint() throws NameTooLongException, TextParseException
    {
  Name own = new Name("the.owner.");
  Name alias = new Name("the.alias.");
  DNAMERecord dnr = new DNAMERecord(own, DClass.IN, 0xABCD, alias);
 
  Name sub = new Name("sub.the.other");

  assertNull(sub.fromDNAME(dnr));
    }
View Full Code Here

  assertNull(sub.fromDNAME(dnr));
    }

    public void test_subdomain_abs() throws TextParseException
    {
  Name dom = new Name("the.domain.");
  Name sub = new Name("sub.of.the.domain.");
  assertTrue(sub.subdomain(dom));
  assertFalse(dom.subdomain(sub));
    }
View Full Code Here

  assertFalse(dom.subdomain(sub));
    }

    public void test_subdomain_rel() throws TextParseException
    {
  Name dom = new Name("the.domain");
  Name sub = new Name("sub.of.the.domain");
  assertTrue(sub.subdomain(dom));
  assertFalse(dom.subdomain(sub));
    }
View Full Code Here

  assertFalse(dom.subdomain(sub));
    }

    public void test_subdomain_equal() throws TextParseException
    {
  Name dom = new Name("the.domain");
  Name sub = new Name("the.domain");
  assertTrue(sub.subdomain(dom));
  assertTrue(dom.subdomain(sub));
    }
View Full Code Here

    }

    public void test_toString_abs() throws TextParseException
    {
  String in = "This.Is.My.Absolute.Name.";
  Name n = new Name(in);
 
  assertEquals(in, n.toString());
    }
View Full Code Here

    }

    public void test_toString_rel() throws TextParseException
    {
  String in = "This.Is.My.Relative.Name";
  Name n = new Name(in);
 
  assertEquals(in, n.toString());
    }
View Full Code Here

  assertEquals(in, n.toString());
    }

    public void test_toString_at() throws TextParseException
    {
  Name n = new Name("@", null);
  assertEquals("@", n.toString());
    }
View Full Code Here

    }

    public void test_toString_wild() throws TextParseException
    {
  String in = "*.A.b.c.e";
  Name n = new Name(in);
  assertEquals(in, n.toString());
    }
View Full Code Here

TOP

Related Classes of org.xbill.DNS.Name

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.