Hi,
I worked on STANBOL-19 today, feedback is welcome on the integration
tests [1], see [2] for the two actual test classes (and the base class
that you can safely ignore) that exist for now.
A few helper classes allow you to write tests like
@Test
public void testSimpleEnhancement() throws Exception {
executor.execute(
builder.buildPostRequest("/engines")
.withHeader("Accept","text/rdf+nt")
.withContent("The Stanbol enhancer can detect famous
cities such as Paris and people such as Bob Marley.")
)
.assertStatus(200)
.assertContentRegexp(
"http://purl.org/dc/terms/creator.*MetaxaEngine",
"http://purl.org/dc/terms/creator.*LangIdEnhancementEngine",
"http://purl.org/dc/terms/language.*en",
"http://purl.org/dc/terms/creator.*LocationEnhancementEngine",
"http://fise.iks-project.eu/ontology/entity-label.*Paris",
"http://purl.org/dc/terms/creator.*NamedEntityExtractionEnhancementEngine",
"http://fise.iks-project.eu/ontology/entity-label.*Bob Marley"
);
}
Which are largely self-explaining and easy to write.
Next steps would be, once we agree on the general idea, to move the
reusable parts to a commons/testing module that we can reuse to enable
similar testing of the other Stanbol modules.
-Bertrand
[1]
https://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/integration-tests/
[2]
https://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/integration-tests/src/test/java/org/apache/stanbol/enhancer/it/