DatabaseRepresentation { public StreamingOutput performQueryOnResource(final String resource, final String query, final Map<QueryParameter, String> otherParams) { final StreamingOutput streamingOutput = new StreamingOutput() { @Override public void write(final OutputStream output) throws IOException, JaxRxException { final String revision = otherParams.get(QueryParameter.REVISION); final String wrap = otherParams.get(QueryParameter.WRAP); final String nodeId = otherParams.get(QueryParameter.OUTPUT); final boolean wrapResult = (wrap == null) ? true : wrap .equalsIgnoreCase(YESSTRING); final boolean nodeid = (nodeId == null) ? false : nodeId .equalsIgnoreCase(YESSTRING); final Integer rev = revision == null ? null : Integer.valueOf(revision); final RestXPathProcessor xpathProcessor = new RestXPathProcessor( mStoragePath); try { xpathProcessor.getXpathResource(resource, query, nodeid, rev, output, wrapResult); } catch (final SirixException exce) { throw new JaxRxException(exce); } } }; return streamingOutput; } DatabaseRepresentation(final File storagePath); void createResource(final InputStream inputStream,
			final String resourceName); StreamingOutput getResource(final String resourceName,
			final Map<QueryParameter, String> queryParams); StreamingOutput performQueryOnResource(final String resource,
			final String query, final Map<QueryParameter, String> otherParams); StreamingOutput getResourcesNames(); boolean add(final InputStream input, final String resource); void deleteResource(final String resourceName); final boolean shred(final InputStream xmlInput, final String resource); long getLastRevision(final String resourceName); OutputStream getModificHistory(
			final String resourceName, // NOPMD this method needs alls these
			// functions
			final String revisionRange, final boolean nodeid,
			final OutputStream output, final boolean wrap); void revertToRevision(final String resourceName,
			final int backToRevision);  }
@Test public void performQueryOnResource() throws WebApplicationException, IOException, ParserConfigurationException, SAXException { final Map<QueryParameter, String> params = new HashMap<QueryParameter, String>(); params.put(QueryParameter.OUTPUT, LITERALTRUE); params.put(QueryParameter.WRAP, LITERALTRUE); final StreamingOutput sOutput = sirix.performQueryOnResource(RESOURCENAME, " final ByteArrayOutputStream output = new ByteArrayOutputStream(); sOutput.write(output); final Document doc = DOMHelper.buildDocument(output); Node node = doc.getElementsByTagName("continent").item(0); assertNotNull("check if continent exists", node); node = doc.getElementsByTagName("country").item(0); assertNull("check for null country object", node); output.close(); }