Package org.xbill.DNS

Examples of org.xbill.DNS.Name


      assertTrue(n2.compareTo(n1) < 0);
  }

  public void test_disjoint() throws TextParseException
  {
      Name n1 = new Name("b");
      Name n2 = new Name("c");
     
      assertTrue(n1.compareTo(n2) < 0);
      assertTrue(n2.compareTo(n1) > 0);
  }
View Full Code Here


      assertTrue(n2.compareTo(n1) > 0);
  }

  public void test_label_prefix() throws TextParseException
  {
      Name n1 = new Name("thisIs.a.");
      Name n2 = new Name("thisIsGreater.a.");

      assertTrue(n1.compareTo(n2) < 0);
      assertTrue(n2.compareTo(n1) > 0);
  }
View Full Code Here

      assertTrue(n2.compareTo(n1) > 0);
  }

  public void test_more_labels() throws TextParseException
  {
      Name n1 = new Name("c.b.a.");
      Name n2 = new Name("d.c.b.a.");

      assertTrue(n1.compareTo(n2) < 0);
      assertTrue(n2.compareTo(n1) > 0);
  }
View Full Code Here

  {
      StringBuffer sb = new StringBuffer();
      for(int i=0; i<127; ++i){
    sb.append("a.");
      }
      Name n = new Name(sb.toString());
      assertTrue(n.isAbsolute());
      assertFalse(n.isWild());
      assertEquals(128, n.labels());
      assertEquals(255, n.length());
      for(int i=0; i<127; ++i){
    assertTrue(Arrays.equals(new byte[] { 1, 'a' }, n.getLabel(i)));
    assertEquals("a", n.getLabelString(i));
      }
      assertTrue(Arrays.equals(new byte[] { 0 }, n.getLabel(127)));
      assertEquals("", n.getLabelString(127));
  }
View Full Code Here

  public void test_ctor_toobig_label_escaped_end() throws TextParseException
  {
      try {
    // name with a 64 char label containing an escape at the end
    new Name("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\090.b.");
    fail("TextParseException not thrown");
      }
      catch(TextParseException e){}
  }
View Full Code Here

  public void test_ctor_toobig_label_escaped() throws TextParseException
  {
      try {
    // name with a 64 char label containing an escape at the end
    new Name("aaaaaaaaaaaaaaaaaaaaaaaaaaaa\\001aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.b.");
    fail("TextParseException not thrown");
      }
      catch(TextParseException e){}
  }
View Full Code Here

      catch(TextParseException e){}
  }

  public void test_fromString() throws TextParseException
  {
      Name n = new Name(m_rel, m_abs_origin);
      Name n2 = Name.fromString(m_rel, m_abs_origin);
      assertEquals(n, n2);
  }
View Full Code Here

      assertEquals(n, n2);
  }

  public void test_fromString_at() throws TextParseException
  {
      Name n = Name.fromString("@", m_rel_origin);
      assertSame(m_rel_origin, n);
  }
View Full Code Here

      assertSame(m_rel_origin, n);
  }

  public void test_fromString_dot() throws TextParseException
  {
      Name n = Name.fromString(".");
      assertSame(Name.root, n);
  }
View Full Code Here

      assertSame(Name.root, n);
  }

  public void test_fromConstantString() throws TextParseException
  {
      Name n = new Name(m_abs);
      Name n2 = Name.fromConstantString(m_abs);
      assertEquals(n, n2);
  }
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.