use of org.apache.jena.query.QueryParseException in project jena by apache.
the class TestPath method parse.
private void parse(String string, boolean expectLegal) {
Prologue prologue = new Prologue(pmap);
Path p = null;
try {
p = PathParser.parse(string, prologue);
// System.out.println(PathWriterSSE.asString(p, new Prologue(pmap))) ;
if (!expectLegal)
fail("Expected error; " + string);
} catch (QueryParseException ex) {
if (expectLegal)
fail("Expected success: " + string + ": " + ex.getMessage());
return;
}
String x = p.toString(prologue);
Path p2 = PathParser.parse(x, prologue);
assertEquals(p, p2);
String sse = WriterPath.asString(p, prologue);
Item item = SSE.parseItem(sse, pmap);
p2 = BuilderPath.buildPath(item);
assertEquals(p, p2);
}
Aggregations