Package org.xbill.DNS

Examples of org.xbill.DNS.Name


  }
     
  public void test_ctor_short_escaped_end() throws TextParseException
  {
      try {
    new Name("ab\\12");
    fail("TextParseException not throw");
      }
      catch(TextParseException e){}
  }
View Full Code Here


  }
     
  public void test_ctor_empty_escaped_end() throws TextParseException
  {
      try {
    new Name("ab\\");
    fail("TextParseException not throw");
      }
      catch(TextParseException e){}
  }
View Full Code Here

  }
     
  public void test_ctor_toobig_escaped() throws TextParseException
  {
      try {
    new Name("ab\\256cd");
    fail("TextParseException not throw");
      }
      catch(TextParseException e){}
  }
View Full Code Here

  }

  public void test_ctor_toobig_escaped_end() throws TextParseException
  {
      try {
    new Name("ab\\256");
    fail("TextParseException not throw");
      }
      catch(TextParseException e){}
  }
View Full Code Here

  }

  public void test_ctor_max_label_escaped() throws TextParseException
  {
      // name with a 63 char label containing an escape
      Name n = new Name("aaaa\\100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.b.");
      assertTrue(n.isAbsolute());
      assertFalse(n.isWild());
      assertEquals(3, n.labels());
      assertEquals(67, n.length());
      assertTrue(Arrays.equals(new byte[] { 63, 'a','a','a','a',(byte)100,'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a' },
             n.getLabel(0)));
      assertTrue(Arrays.equals(new byte[] { 1, 'b' },
             n.getLabel(1)));
      assertEquals("b", n.getLabelString(1));
      assertTrue(Arrays.equals(new byte[] { 0 },
             n.getLabel(2)));
      assertEquals("", n.getLabelString(2));
  }
View Full Code Here

  assertEquals(sub, n);
    }

    public void test_relativize_root() throws TextParseException
    {
  Name sub = Name.fromString("a.b.c.");
  Name dom = Name.fromString(".");
  Name exp = Name.fromString("a.b.c");

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

  assertEquals(exp, n);
    }

    public void test_wild() throws TextParseException
    {
  Name sub = Name.fromString("a.b.c.");
  Name exp = Name.fromString("*.b.c.");

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

  assertEquals(exp, n);
    }

    public void test_wild_abs() throws TextParseException
    {
  Name sub = Name.fromString("a.b.c.");
  Name exp = Name.fromString("*.");

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

  assertEquals(exp, n);
    }

    public void test_wild_toobig() throws TextParseException
    {
  Name sub = Name.fromString("a.b.c.");
  try {
      sub.wild(4);
      fail("IllegalArgumentException not thrown");
  }
  catch(IllegalArgumentException e){}
    }
View Full Code Here

  catch(IllegalArgumentException e){}
    }

    public void test_wild_toosmall() throws TextParseException
    {
  Name sub = Name.fromString("a.b.c.");
  try {
      sub.wild(0);
      fail("IllegalArgumentException not thrown");
  }
  catch(IllegalArgumentException e){}
    }
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.