### Question:
XSPARQLProcessor { public String process(final Reader is) throws RecognitionException, IOException, Exception { CommonTokenStream tokenStream = createTokenStream(is); if (this.numSyntaxErrors > 0) { throw new Exception("Errors for Lexer. Translation aborted."); } CommonTree tree = parse(tokenStream); if (this.numSyntaxErrors > 0) { throw new Exception("Errors for Parser. Translation aborted."); } printAST(tree); tree = rewrite(tokenStream, tree); if (this.numSyntaxErrors > 0) { throw new Exception("Errors for Rewriter. Translation aborted."); } printAST(tree); tree = simplify(tokenStream, tree); if (this.numSyntaxErrors > 0) { throw new Exception("Errors for Simplifier. Translation aborted."); } printAST(tree); String xquery = serialize(tokenStream, tree); if (this.numSyntaxErrors > 0) { throw new Exception("Errors for Serializer. Translation aborted."); } return xquery; } XSPARQLProcessor(); void setXQueryEngine(String xqueryEngine); void setQueryFilename(String name); int getNumberOfSyntaxErrors(); String process(final Reader is); void setWarnIfNestedConstruct(boolean b); void setAst(boolean has); void setDebugLexer(boolean has); void setDebug(boolean has); void setDot(boolean has); void setVerbose(boolean has); void setEndpointURI(String string); void setDebugVersion(boolean has); void setSPARQLEngine(SPARQLEngine se); void setValidating(boolean b); String getOutputMethod(); boolean isDebug(); String getDBDriver(); String getDBName(); String getDBUser(); String getDBPasswd(); void setDBDriver(String driver); void setDBServer(String server); void setDBPort(String port); void setDBName(String name); void setDBInstance(String instance); void setDBUser(String user); void setDBPasswd(String passwd); void setDBConfig(File file); void createDBconnection(); SQLQuery getDBconnection(); void closeDBconnection();  }### Answer:
@Test public void testProcessReaderString() { try { for (String filename : listFiles("examples")) { if (filename.endsWith(".xsparql")) { System.out.println("Testing " + filename + " ..."); Reader queryReader = loadReaderFromClasspath(filename); processor.process(queryReader); } } } catch (RecognitionException e) { fail("Exception: " + e.getMessage()); } catch (Exception e) { ByteArrayOutputStream os = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(os); e.printStackTrace(ps); fail("Exception: " + os.toString()); } }