Author: joern
Date: Tue Feb 8 13:10:52 2011
New Revision: 1068369
URL: http://svn.apache.org/viewvc?rev=1068369&view=rev
Log:
UIMA-2037 Added createCAS method to produce a new CAS instance for testing the
embedded AnalysisEngine
Modified:
uima/uimaj/trunk/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java
Modified:
uima/uimaj/trunk/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java
URL:
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java?rev=1068369&r1=1068368&r2=1068369&view=diff
==============================================================================
---
uima/uimaj/trunk/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java
(original)
+++
uima/uimaj/trunk/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java
Tue Feb 8 13:10:52 2011
@@ -238,6 +238,20 @@ public class AnnotatorTester {
}
/**
+ * Creates a new fresh CAS instance which can be used for testing.
+ * @return
+ * @throws Exception
+ */
+ public CAS createCAS() throws Exception {
+ try {
+ return ae.newCAS();
+ } catch (Exception ex) {
+ JUnitExtension.handleException(ex);
+ return null;
+ }
+ }
+
+ /**
* performs a test on the initialized annotator. The specified document is
* processed with the given language.
*