Package org.apache.uima.test.junit_extension

Examples of org.apache.uima.test.junit_extension.AnnotatorTester.performTest()


      AnnotationFS annotation = cas.createAnnotation(cas.getAnnotationType(), 0, 9);
      cas.addFsToIndexes(annotation);

      /* execute Solrcas on the created CAS*/
      annotatorTester.performTest(cas);

      /* create a Solr instance to check document has been indexed as expected */
      URL solrURL = this.getClass().getResource("/org/apache/uima/solrcas/");
      System.setProperty("solr.solr.home", new File(solrURL.toURI()).getAbsolutePath());
      CoreContainer.Initializer initializer = new CoreContainer.Initializer();
View Full Code Here


  @Test
  public void integrationTest() {
    try {
      CAS cas = prepareCAS();
      AnnotatorTester annotatorTester = new AnnotatorTester(markupAnnotatorDescPath);
      CAS newCas = annotatorTester.performTest(cas);
      for (Annotation annotation : newCas.getCurrentView().getJCas().getAnnotationIndex(
              org.apache.uima.tika.MarkupAnnotation.type)) {
        Type type = annotation.getType();
        assertTrue(annotation.getType().getName() != null);
        assertTrue(annotation.getBegin() >= 0);
View Full Code Here

    final int max = 20;
    for (int i = 0; i < max; i++) {
      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
          .getFile("conceptFileLocking/repeatDescriptor.xml"));
      CAS cas = annotTester.performTest("Test a regex.", "en");
      // Document annotation and one "a" found.
      assertTrue(cas.getAnnotationIndex().size() == 2);
      try {
        org.apache.commons.io.FileUtils.forceDelete(conceptFile);
        BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(conceptFile));
View Full Code Here

  public void testEmptyRegex() throws Exception {

    // create annotation tester with the regex annotator specifier
    AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
        .getFile("emptyRegex/RegExEmptyRegex.xml"));
    CAS cas = annotTester.performTest("Test an empty regex.", "en");

//    // define result interested in
//    String[] tofs = { "org.apache.uima.TestAnnot", "org.apache.uima.TestAnnot:testFeature",
//        "org.apache.uima.TestAnnot:testFeature1", "org.apache.uima.TestAnnot1",
//        "org.apache.uima.TestAnnot1:testFeature", "org.apache.uima.TestAnnot1:testFeature1",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.