On 3. Nov 2020, at 11:42, Richard Eckart de Castilho <r...@apache.org> wrote:
> 
>> I checked out the latest from master and installed it, but the unit test 
>> still fails in the same way.
> 
> roger, I'll check it out.
> 
> If you want to do me a favor, please open an issue on Jira and put your test 
> case code there.

I removed the uimaFIT references from your code and dropped it into the
org.apache.uima.cas.impl.SelectFsTest test class in uimaj-core of the
master branch. Instead of the SubType type, I used the "x.y.z.Token" type
which is already available in the uimaj-core test code (inherits from 
Annotation).

For me, the test runs... 

Did I accidentally mutilate your test?

-- Richard
 

  @Test
  public void verify_selectCovered() throws Exception {
    JCas jCas = cas.getJCas();
     Annotation[] fixture = new Annotation[] {
             new Annotation(jCas, 5, 10),
             new Annotation(jCas, 5, 15),
             new Annotation(jCas, 0, 10),
             new Annotation(jCas, 0, 15),
             new Annotation(jCas, 5, 7),
             new Annotation(jCas, 8, 10),
             new Annotation(jCas, 6, 9),
             new Annotation(jCas, 5, 10)
     };
     Stream.of(fixture).forEach(Annotation::addToIndexes);

     List<Annotation> selection1 = jCas.select(Annotation.class)
             .coveredBy(fixture[0])
             .collect(Collectors.toList());

     assertEquals(4, selection1.size());

     Token subType = new Token(jCas, 5, 10);
     subType.addToIndexes();

     List<Annotation> selection2 = jCas.select(Annotation.class)
             .coveredBy(subType)
             .collect(Collectors.toList());

     assertEquals(5, selection2.size()); // Fails!
  } 

Reply via email to