use of org.apache.http.entity.InputStreamEntity in project stanbol by apache.
the class EngineEnhancementRequestTest method testTikaMetadata.
/**
* Tests an normal enhancement request directed to the tika engine
* @throws Exception
*/
@Test
public void testTikaMetadata() throws Exception {
InputStream in = EngineEnhancementRequestTest.class.getClassLoader().getResourceAsStream("testJPEG_EXIF.jpg");
Assert.assertNotNull("Unable to find test resource 'testJPEG_EXIF.jpg'", in);
executor.execute(builder.buildPostRequest(getEndpoint() + "/engine/tika").withHeader("Accept", "text/rdf+nt").withEntity(new InputStreamEntity(in, -1))).assertStatus(200).assertContentRegexp(//only that the Enhancer REST API works also with engines!
"<http://purl.org/dc/terms/format> \"image/jpeg\"", "<http://www.w3.org/ns/ma-ont#hasKeyword> \"serbor\"", "<http://www.semanticdesktop.org/ontologies/2007/05/10/nexif#isoSpeedRatings> \"400\"");
}
Aggregations