@Test
public void testParsing() {

	URI u;
	String scheme = "hdfs";
	String authority = "localhost:8000";
	String path = "/test/test";
	// correct usage
	// hdfs://localhost:8000/test/test
	u = new Path(scheme + "://" + authority + path).toUri();
	assertEquals(scheme, u.getScheme());
	assertEquals(authority, u.getAuthority());
	assertEquals(path, u.getPath());
	// hdfs:///test/test
	u = new Path(scheme + "://" + path).toUri();
	assertEquals(scheme, u.getScheme());
	assertEquals(null, u.getAuthority());
	assertEquals(path, u.getPath());
	// hdfs:/test/test
	u = new Path(scheme + ":" + path).toUri();
	assertEquals(scheme, u.getScheme());
	assertEquals(null, u.getAuthority());
	assertEquals(path, u.getPath());
	// incorrect usage
	// hdfs://test/test
	u = new Path(scheme + ":/" + path).toUri();
	assertEquals(scheme, u.getScheme());
	assertEquals("test", u.getAuthority());
	assertEquals("/test", u.getPath());
	// hdfs:////test/test
	u = new Path(scheme + ":///" + path).toUri();
	assertEquals("hdfs", u.getScheme());
	assertEquals(null, u.getAuthority());
	assertEquals(path, u.getPath());
}