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 2016/08/01 21:59:04 UTC

svn commit: r1754801 - /uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/test/java/org/apache/uima/tools/viewer/CasAnnotationViewerTest.java

Author: schor
Date: Mon Aug  1 21:59:04 2016
New Revision: 1754801

URL: http://svn.apache.org/viewvc?rev=1754801&view=rev
Log:
no Jira - fix the test case for V3's reuse of type systems - need to refresh the type and feature handles

Modified:
    uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/test/java/org/apache/uima/tools/viewer/CasAnnotationViewerTest.java

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/test/java/org/apache/uima/tools/viewer/CasAnnotationViewerTest.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/test/java/org/apache/uima/tools/viewer/CasAnnotationViewerTest.java?rev=1754801&r1=1754800&r2=1754801&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/test/java/org/apache/uima/tools/viewer/CasAnnotationViewerTest.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/test/java/org/apache/uima/tools/viewer/CasAnnotationViewerTest.java Mon Aug  1 21:59:04 2016
@@ -42,6 +42,7 @@ import org.apache.uima.cas.admin.CASMgr;
 import org.apache.uima.cas.admin.FSIndexRepositoryMgr;
 import org.apache.uima.cas.admin.TypeSystemMgr;
 import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.TypeSystemImpl;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.resource.metadata.TypeSystemDescription;
 import org.apache.uima.test.junit_extension.JUnitExtension;
@@ -126,7 +127,26 @@ public class CasAnnotationViewerTest ext
             .getType(CAS.TYPE_NAME_DOUBLE_ARRAY), false);
 
     // Commit the type system.
-    ((CASImpl) casMgr).commitTypeSystem();
+    TypeSystemImpl tsi = ((CASImpl) casMgr).commitTypeSystem();
+    if (tsi != tsa) {
+      annotationType = tsi.refreshType(annotationType);
+      exampleType = tsi.refreshType(exampleType);
+      floatFeature = tsi.refreshFeature(floatFeature);
+      stringFeature = tsi.refreshFeature(stringFeature);
+      booleanFeature = tsi.refreshFeature(booleanFeature);
+      byteFeature = tsi.refreshFeature(byteFeature);
+      shortFeature = tsi.refreshFeature(shortFeature);
+      longFeature = tsi.refreshFeature(longFeature);
+      doubleFeature = tsi.refreshFeature(doubleFeature);
+      intArrayFeature = tsi.refreshFeature(intArrayFeature);
+      floatArrayFeature = tsi.refreshFeature(floatArrayFeature);
+      stringArrayFeature = tsi.refreshFeature(stringArrayFeature);
+      booleanArrayFeature = tsi.refreshFeature(booleanArrayFeature);
+      byteArrayFeature = tsi.refreshFeature(byteArrayFeature);
+      shortArrayFeature = tsi.refreshFeature(shortArrayFeature);
+      longArrayFeature = tsi.refreshFeature(longArrayFeature);
+      doubleArrayFeature = tsi.refreshFeature(doubleArrayFeature);     
+    }
 
     // Create the Base indexes.
     casMgr.initCASIndexes();