We have assembled some misc. utility methods that make unit testing
easier to support our UIMA-based project ClearTK. I have come across
several scenarios now where I wish that this code was available as a
separate project so that I don't have to create a dependency on our
entire ClearTK project when I only need a few utility classes for
writing unit tests. So, I am thinking about spinning off a separate
project that just has this unit-test specific code in it. There really
isn't that much code there (I think it's all shoved into one class at
the moment) and would really be just a seed for getting something started.
One thing the code does is simplify initialization of UIMA components
programmatically such that you don't have to use descriptor files in
your unit tests. A unit test might start with something like:
AnalysisEngine engine = TestsUtil.getAnalysisEngine(MyAnnotator.class,
TestsUtil.getTypeSystem(Document.class, Token.class, Sentence.class));
JCas jCas = engine.newJCas();
and then you can go about populating the JCas and testing its contents.
The current code is located here:
http://code.google.com/p/cleartk/source/browse/trunk/test/src/org/cleartk/util/TestsUtil.java
Some example unit tests based on this code can be found here:
http://code.google.com/p/cleartk/source/browse/trunk/test/src/org/cleartk/example/ExamplePOSHandlerTests.java
Is this something that is of interest? Is there already code in UIMA
that helps with this sort of thing?
Thanks,
Philip