protected void doBooleanLinksAndStylesheetAndNamespaces(BooleanQueryResultFormat format, boolean input,
List<String> links, String stylesheetUrl, Map<String, String> namespaces)
throws IOException, QueryResultHandlerException, QueryResultParseException,
UnsupportedQueryResultFormatException, QueryEvaluationException
{
ByteArrayOutputStream out = new ByteArrayOutputStream(4096);
BooleanQueryResultWriter writer = QueryResultIO.createBooleanWriter(format, out);
for (String nextPrefix : namespaces.keySet()) {
writer.handleNamespace(nextPrefix, namespaces.get(nextPrefix));
}
writer.startDocument();
writer.handleStylesheet(stylesheetUrl);
writer.startHeader();
writer.handleLinks(links);
writer.handleBoolean(input);
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
boolean output = QueryResultIO.parseBoolean(in, format);
assertEquals(output, input);
}