Package org.xbill.DNS

Examples of org.xbill.DNS.Name.compareTo()


    {
  public void test_notName() throws TextParseException
  {
      Name n = new Name("A.Name");
      try {
    n.compareTo(new Object());
    fail("ClassCastException not thrown");
      }
      catch(ClassCastException e ){}
  }
View Full Code Here


  }

  public void test_same() throws TextParseException
  {
      Name n = new Name("A.Name");
      assertEquals(0, n.compareTo(n));
  }

  public void test_equal() throws TextParseException
  {
      Name n1 = new Name("A.Name.");
View Full Code Here

  {
      Name n1 = new Name("A.Name.");
      Name n2 = new Name("a.name.");

      assertEquals(0, n1.compareTo(n2));
      assertEquals(0, n2.compareTo(n1));
  }

  public void test_close() throws TextParseException
  {
      Name n1 = new Name("a.name");
View Full Code Here

  {
      Name n1 = new Name("a.name");
      Name n2 = new Name("a.name.");

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

  public void test_disjoint() throws TextParseException
  {
      Name n1 = new Name("b");
View Full Code Here

  {
      Name n1 = new Name("b");
      Name n2 = new Name("c");
     
      assertTrue(n1.compareTo(n2) < 0);
      assertTrue(n2.compareTo(n1) > 0);
  }

  public void test_label_prefix() throws TextParseException
  {
      Name n1 = new Name("thisIs.a.");
View Full Code Here

  {
      Name n1 = new Name("thisIs.a.");
      Name n2 = new Name("thisIsGreater.a.");

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

  public void test_more_labels() throws TextParseException
  {
      Name n1 = new Name("c.b.a.");
View Full Code Here

  {
      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);
  }
    }

    public static Test suite()
    {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.