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 2017/08/14 14:38:34 UTC

svn commit: r1805002 - /uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java

Author: schor
Date: Mon Aug 14 14:38:34 2017
New Revision: 1805002

URL: http://svn.apache.org/viewvc?rev=1805002&view=rev
Log:
no Jira, add index like annotation order, but without type order, used in new test case

Modified:
    uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java

Modified: uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java?rev=1805002&r1=1805001&r2=1805002&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java Mon Aug 14 14:38:34 2017
@@ -102,6 +102,8 @@ public class CASTestSetup  implements An
 
   // Index name constants.
   public static final String ANNOT_SET_INDEX = "Annotation Set Index";
+  
+  public static final String ANNOT_SET_INDEX_NO_TYPEORDER = "Annotation Set Index No Type Order";
 
   public static final String ANNOT_BAG_INDEX = "Annotation Bag Index";
 
@@ -180,7 +182,7 @@ public class CASTestSetup  implements An
     TestCase.assertTrue(exc);
   }
 
-  public void initIndexes(FSIndexRepositoryMgr irm, TypeSystem ts) {
+  private FSIndexComparator makeComp(FSIndexRepositoryMgr irm, TypeSystem ts) {
     FSIndexComparator comp = irm.createComparator();
     Type annotation = ts.getType(CAS.TYPE_NAME_ANNOTATION);
     comp.setType(annotation);
@@ -188,6 +190,12 @@ public class CASTestSetup  implements An
             FSIndexComparator.STANDARD_COMPARE);
     comp.addKey(annotation.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_END),
             FSIndexComparator.REVERSE_STANDARD_COMPARE);
+    return comp;
+  }
+  
+  public void initIndexes(FSIndexRepositoryMgr irm, TypeSystem ts) {
+    FSIndexComparator compNoTypeOrder = makeComp(irm, ts);
+    FSIndexComparator comp = makeComp(irm, ts);
     LinearTypeOrderBuilder tob = irm.createTypeSortOrder();
     try {
       tob.add(new String[] { CAS.TYPE_NAME_ANNOTATION, SENT_TYPE, TOKEN_TYPE });
@@ -195,9 +203,13 @@ public class CASTestSetup  implements An
     } catch (CASException e) {
       TestCase.assertTrue(false);
     }
+    
+    
     irm.createIndex(comp, ANNOT_BAG_INDEX, FSIndex.BAG_INDEX);
     irm.createIndex(comp, ANNOT_SET_INDEX, FSIndex.SET_INDEX);
     irm.createIndex(comp, ANNOT_SORT_INDEX, FSIndex.SORTED_INDEX);
+    irm.createIndex(compNoTypeOrder, ANNOT_SET_INDEX_NO_TYPEORDER, FSIndex.SET_INDEX);
+    
 
   }
 }