DatabaseRepresentation { public void deleteResource(final String resourceName) throws WebApplicationException { synchronized (resourceName) { try (final Database database = Databases.openDatabase(mStoragePath)) { database.truncateResource(resourceName); } catch (final SirixException exc) { throw new JaxRxException(500, "Deletion could not be performed"); } } } 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 deleteResource() throws SirixException, WebApplicationException, IOException, ParserConfigurationException, SAXException { final InputStream input = DatabaseRepresentationTest.class .getResourceAsStream(XMLFILE); sirix.shred(input, RESOURCENAME + "99"); sirix.deleteResource(RESOURCENAME + "99"); final StreamingOutput sOutput = sirix.getResourcesNames(); final ByteArrayOutputStream output = new ByteArrayOutputStream(); sOutput.write(output); final Document doc = DOMHelper.buildDocument(output); final NodeList nodes = doc.getElementsByTagName("resource"); String searchName = null; for (int i = 0; i < nodes.getLength(); i++) { final Attr attribute = (Attr) nodes.item(i).getAttributes() .getNamedItem(NAME); if (attribute.getTextContent().equals(RESOURCENAME + "99")) { searchName = attribute.getTextContent(); break; } } assertNull("Check if the resource has been deleted", searchName); output.close(); }