Package java.net

Examples of java.net.URI.compareTo()


    URI uri1, uri2;

    // URIs whose host names have different casing
    uri1 = new URI("http://MixedCaseHost/path/resource");
    uri2 = new URI("http://mixedcasehost/path/resource");
    assertEquals("Assert 0: host name equality failure", 0, uri1.compareTo(uri2));
    assertEquals("Assert 1: host name equality failure", 0, uri1.compareTo(uri2));

    // URIs with one undefined component (port)
    uri1 = new URI("http://anyhost:80/path/resource");
    uri2 = new URI("http://anyhost/path/resource");
View Full Code Here


    // URIs whose host names have different casing
    uri1 = new URI("http://MixedCaseHost/path/resource");
    uri2 = new URI("http://mixedcasehost/path/resource");
    assertEquals("Assert 0: host name equality failure", 0, uri1.compareTo(uri2));
    assertEquals("Assert 1: host name equality failure", 0, uri1.compareTo(uri2));

    // URIs with one undefined component (port)
    uri1 = new URI("http://anyhost:80/path/resource");
    uri2 = new URI("http://anyhost/path/resource");
    assertTrue("Assert 2: comparison failure", uri1.compareTo(uri2) > 0);
View Full Code Here

    assertEquals("Assert 1: host name equality failure", 0, uri1.compareTo(uri2));

    // URIs with one undefined component (port)
    uri1 = new URI("http://anyhost:80/path/resource");
    uri2 = new URI("http://anyhost/path/resource");
    assertTrue("Assert 2: comparison failure", uri1.compareTo(uri2) > 0);
    assertTrue("Assert 3: comparison failure", uri2.compareTo(uri1) < 0);
   
    // URIs with one undefined component (user-info)
    uri1 = new URI("http://user-info@anyhost/path/resource");
    uri2 = new URI("http://anyhost/path/resource");
View Full Code Here

    assertTrue("Assert 3: comparison failure", uri2.compareTo(uri1) < 0);
   
    // URIs with one undefined component (user-info)
    uri1 = new URI("http://user-info@anyhost/path/resource");
    uri2 = new URI("http://anyhost/path/resource");
    assertTrue("Assert 4: comparison failure", uri1.compareTo(uri2) > 0);
    assertTrue("Assert 5: comparison failure", uri2.compareTo(uri1) < 0);
  }
}
View Full Code Here

        URI uri, uri2;

        // test URIs with host names with different casing
        uri = new URI("http://AbC.cOm/root/news");
        uri2 = new URI("http://aBc.CoM/root/news");
        assertEquals("TestA", 0, uri.compareTo(uri2));
        assertEquals("TestB", 0, uri.compareTo(uri2));

        // test URIs with one undefined component
        uri = new URI("http://abc.com:80/root/news");
        uri2 = new URI("http://abc.com/root/news");
View Full Code Here

        // test URIs with host names with different casing
        uri = new URI("http://AbC.cOm/root/news");
        uri2 = new URI("http://aBc.CoM/root/news");
        assertEquals("TestA", 0, uri.compareTo(uri2));
        assertEquals("TestB", 0, uri.compareTo(uri2));

        // test URIs with one undefined component
        uri = new URI("http://abc.com:80/root/news");
        uri2 = new URI("http://abc.com/root/news");
        assertTrue("TestC", uri.compareTo(uri2) > 0);
View Full Code Here

        assertEquals("TestB", 0, uri.compareTo(uri2));

        // test URIs with one undefined component
        uri = new URI("http://abc.com:80/root/news");
        uri2 = new URI("http://abc.com/root/news");
        assertTrue("TestC", uri.compareTo(uri2) > 0);
        assertTrue("TestD", uri2.compareTo(uri) < 0);

        // test URIs with one undefined component
        uri = new URI("http://user@abc.com/root/news");
        uri2 = new URI("http://abc.com/root/news");
View Full Code Here

        assertTrue("TestD", uri2.compareTo(uri) < 0);

        // test URIs with one undefined component
        uri = new URI("http://user@abc.com/root/news");
        uri2 = new URI("http://abc.com/root/news");
        assertTrue("TestE", uri.compareTo(uri2) > 0);
        assertTrue("TestF", uri2.compareTo(uri) < 0);
    }

    /**
     * @tests java.net.URI#create(java.lang.String)
View Full Code Here

        URI uri, uri2;

        // test URIs with host names with different casing
        uri = new URI("http://AbC.cOm/root/news");
        uri2 = new URI("http://aBc.CoM/root/news");
        assertEquals("TestA", 0, uri.compareTo(uri2));
        assertEquals("TestB", 0, uri.compareTo(uri2));

        // test URIs with one undefined component
        uri = new URI("http://abc.com:80/root/news");
        uri2 = new URI("http://abc.com/root/news");
View Full Code Here

        // test URIs with host names with different casing
        uri = new URI("http://AbC.cOm/root/news");
        uri2 = new URI("http://aBc.CoM/root/news");
        assertEquals("TestA", 0, uri.compareTo(uri2));
        assertEquals("TestB", 0, uri.compareTo(uri2));

        // test URIs with one undefined component
        uri = new URI("http://abc.com:80/root/news");
        uri2 = new URI("http://abc.com/root/news");
        assertTrue("TestC", uri.compareTo(uri2) > 0);
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.