@Test
public void testPathFromString() {

	Path p = new Path("/my/path");
	assertEquals("/my/path", p.toUri().getPath());
	assertNull(p.toUri().getScheme());
	p = new Path("/my/path/");
	assertEquals("/my/path", p.toUri().getPath());
	assertNull(p.toUri().getScheme());
	p = new Path("/my//path/");
	assertEquals("/my/path", p.toUri().getPath());
	assertNull(p.toUri().getScheme());
	p = new Path("/my//path//a///");
	assertEquals("/my/path/a", p.toUri().getPath());
	assertNull(p.toUri().getScheme());
	p = new Path("\\my\\path\\\\a\\\\\\");
	assertEquals("/my/path/a", p.toUri().getPath());
	assertNull(p.toUri().getScheme());
	p = new Path("/my/path/ ");
	assertEquals("/my/path", p.toUri().getPath());
	assertNull(p.toUri().getScheme());
	p = new Path("hdfs:///my/path");
	assertEquals("/my/path", p.toUri().getPath());
	assertEquals("hdfs", p.toUri().getScheme());
	p = new Path("hdfs:///my/path/");
	assertEquals("/my/path", p.toUri().getPath());
	assertEquals("hdfs", p.toUri().getScheme());
	p = new Path("file:///my/path");
	assertEquals("/my/path", p.toUri().getPath());
	assertEquals("file", p.toUri().getScheme());
	p = new Path("C:/my/windows/path");
	assertEquals("/C:/my/windows/path", p.toUri().getPath());
	p = new Path("file:/C:/my/windows/path");
	assertEquals("/C:/my/windows/path", p.toUri().getPath());
	try {
		new Path((String)null);
		fail();
	} catch(Exception e) {
		// exception expected
	}
	try {
		new Path("");
		fail();
	} catch(Exception e) {
		// exception expected
	}
	try {
		new Path(" ");
		fail();
	} catch(Exception e) {
		// exception expected
	}
}