use of org.apache.tika.parser.pkg.PackageParser in project tika by apache.
the class TikaParsersTest method testGetHTML.
@Test
public void testGetHTML() throws Exception {
for (boolean details : new boolean[] { false, true }) {
Response response = WebClient.create(endPoint + getPath(details)).type("text/html").accept("text/html").get();
String text = getStringFromInputStream((InputStream) response.getEntity());
assertContains("<h2>DefaultParser</h2>", text);
assertContains("Composite", text);
assertContains("<h3>OpusParser", text);
assertContains("<h3>PackageParser", text);
assertContains("<h3>OOXMLParser", text);
assertContains(OpusParser.class.getName(), text);
assertContains(PackageParser.class.getName(), text);
assertContains(OOXMLParser.class.getName(), text);
if (details) {
// Should have the mimetypes they handle
assertContains("<li>text/plain", text);
assertContains("<li>application/pdf", text);
assertContains("<li>audio/ogg", text);
} else {
// Shouldn't do
assertNotFound("text/plain", text);
assertNotFound("application/pdf", text);
assertNotFound("audio/ogg", text);
}
}
}
Aggregations