pathResolver = new ParsingPathResolver(factory, resolver);
}
public void testParse() throws Exception {
for (int i=0; i<tests.length; i++) {
JcrPath t = tests[i];
long t1 = System.currentTimeMillis();
for (int j=0; j<NUM_TESTS; j++) {
try {
Path p = PathParser.parse(t.path, resolver, factory);
if (t.normalizedPath==null) {
if (!t.isValid()) {
fail("Should throw MalformedPathException: " + t.path);
}
assertEquals("\"" + t.path + "\".create(false)", t.path, pathResolver.getJCRPath(p));
assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
} else {
// check with normalization
p = p.getNormalizedPath();
if (!t.isValid()) {
fail("Should throw MalformedPathException: " + t.path);
}
assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, pathResolver.getJCRPath(p));
assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
}
} catch (RepositoryException e) {
if (t.isValid()) {
System.out.println(t.path);
throw e;
}
}
}