You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2007/07/08 04:15:59 UTC
svn commit: r554295 - in
/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test:
AnnotationIteratorTest.java CASTestSetup.java
Author: schor
Date: Sat Jul 7 19:15:58 2007
New Revision: 554295
URL: http://svn.apache.org/viewvc?view=rev&rev=554295
Log:
no Jira - added a test to insure a good error message happens
when trying to get an AnnotationIndex over a type where the
type is not a subtype of Annotation. This was a reported
failure in the IBM Alphaworks forum yesterday. The test case
passed with no fixes needed - that is, doing this generated
a CAS Runtime Exception with a detailed message.
Modified:
incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java
incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java?view=diff&rev=554295&r1=554294&r2=554295
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java Sat Jul 7 19:15:58 2007
@@ -265,6 +265,14 @@
caughtException = true;
}
assertTrue(caughtException);
+
+ caughtException = false;
+ try {
+ AnnotationIndex ai = this.cas.getAnnotationIndex(ts.getType(CASTestSetup.TOKEN_TYPE_TYPE));
+ } catch (CASRuntimeException e) {
+ caughtException = true;
+ }
+ assertTrue(caughtException);
try {
this.cas.getAnnotationIndex(this.tokenType);
} catch (CASRuntimeException e) {
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java?view=diff&rev=554295&r1=554294&r2=554295
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java Sat Jul 7 19:15:58 2007
@@ -117,6 +117,18 @@
/**
* @see org.apache.uima.cas.test.AnnotatorInitializer#initTypeSystem(TypeSystemMgr)
*/
+
+ /* Types:
+ * TOP
+ * Token TOKEN_TYPE
+ * Word
+ * Separator
+ * EndOfSentence
+ * ArrayFSwithSubtype
+ * Annotation
+ * Sentence
+ *
+ */
public void initTypeSystem(TypeSystemMgr tsm) {
// Add new types and features.
Type topType = tsm.getTopType();