/**
* Tests conversion from absolute to relative names.
*/
public void testAbsoluteNameConvert() throws Exception
{
final FileName baseName = getReadFolder().getName();
String path = "/test1/test2";
FileName name = getManager().resolveName(baseName, path);
assertEquals(path, name.getPath());
// Try child and descendent names
testRelName(name, "child");
testRelName(name, "child1/child2");
// Try own name
testRelName(name, ".");
// Try parent, and root
testRelName(name, "..");
testRelName(name, "../..");
// Try sibling and descendent of sibling
testRelName(name, "../sibling");
testRelName(name, "../sibling/child");
// Try siblings with similar names
testRelName(name, "../test2_not");
testRelName(name, "../test2_not/child");
testRelName(name, "../test");
testRelName(name, "../test/child");
// Try unrelated
testRelName(name, "../../unrelated");
testRelName(name, "../../test");
testRelName(name, "../../test/child");
// Test against root
path = "/";
name = getManager().resolveName(baseName, path);
assertEquals(path, name.getPath());
// Try child and descendent names (against root)
testRelName(name, "child");
testRelName(name, "child1/child2");