Diff of /jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
Parent Directory
| Revision Log
| Patch
--- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java 2005/06/03 13:04:54 179783
+++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java 2005/06/03 13:18:34 179784
@@ -109,7 +109,7 @@ public class TestURI extends TestNoHost
}
// the following is an array of arrays in the following order
- // relative URI and resolved( scheme, host, path, query, fragment URI )
+ // relative URI, scheme, host(authority), path, query, fragment, abs. URI
//
// these examples were taken from rfc 2396
String[][] testRelativeURIs = {
@@ -154,7 +154,8 @@ public class TestURI extends TestNoHost
{ "g?y/./x", "http", "a", "/b/c/g", "y/./x", null, "http://a/b/c/g?y/./x" },
{ "g?y/../x", "http", "a", "/b/c/g", "y/../x", null, "http://a/b/c/g?y/../x" },
{ "g#s/./x", "http", "a", "/b/c/g", null, "s/./x", "http://a/b/c/g#s/./x" },
- { "g#s/../x", "http", "a", "/b/c/g", null, "s/../x", "http://a/b/c/g#s/../x" }
+ { "g#s/../x", "http", "a", "/b/c/g", null, "s/../x", "http://a/b/c/g#s/../x" },
+ { ":g", "http", "a", "/b/c/:g", null, null, "http://a/b/c/:g" } // see issue #35148
};
for (int i = 0; i < testRelativeURIs.length; i++) {
URI testURI = null;
@@ -170,12 +171,12 @@ public class TestURI extends TestNoHost
}
try {
- assertEquals( testURI.getScheme(), testRelativeURIs[i][1] );
- assertEquals( testURI.getAuthority(), testRelativeURIs[i][2] );
- assertEquals( testURI.getPath(), testRelativeURIs[i][3] );
- assertEquals( testURI.getQuery(), testRelativeURIs[i][4] );
- assertEquals( testURI.getFragment(), testRelativeURIs[i][5] );
- assertEquals( testURI.getURIReference(), testRelativeURIs[i][6] );
+ assertEquals("array index "+i, testRelativeURIs[i][1], testURI.getScheme());
+ assertEquals("array index "+i, testRelativeURIs[i][2], testURI.getAuthority());
+ assertEquals("array index "+i, testRelativeURIs[i][3], testURI.getPath());
+ assertEquals("array index "+i, testRelativeURIs[i][4], testURI.getQuery());
+ assertEquals("array index "+i, testRelativeURIs[i][5], testURI.getFragment());
+ assertEquals("array index "+i, testRelativeURIs[i][6], testURI.getURIReference());
} catch ( URIException e ) {
fail( "error getting URI property: " + e );
}