Examples of AnnotatorTester


Examples of org.apache.uima.test.junit_extension.AnnotatorTester

    * @throws Exception
    */
   public void testSetFeatureValues2() throws Exception {

      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("setFeatureValues/RegExAnnotFeatureValues.xml"));
      CAS cas = annotTester.performTest("RuleRegex22.4", "en");

      // define result interested in
      String[] tofs = { "uima.tcas.DocumentAnnotation:language",
            "org.apache.uima.TestAnnot",
            "org.apache.uima.TestAnnot:testFeature0",
View Full Code Here

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

    * @throws Exception
    */
   public void testSetFeatureValues3() throws Exception {

      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("setFeatureValues/RegExAnnotFeatureValues.xml"));
      CAS cas = annotTester.performTest("RuleRegex32.4", "en");

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

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

    * @throws Exception
    */
   public void testSetFeatureValuesForConfidenceAndRuleID() throws Exception {

      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("setFeatureValues/RegExAnnotFeatureValues.xml"));
      CAS cas = annotTester.performTest("Minimal Configuration", "en");

      // define result interested in
      String[] tofs = { "org.apache.uima.TestAnnot",
            "org.apache.uima.TestAnnot:confidenceValue",
            "org.apache.uima.TestAnnot:ruleId" };
View Full Code Here

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

  private static final String text = "President Obama vows to \"make BP pay\" for the Gulf oil spill, and says the US must end its fossil fuel \"addiction\"";

  @Test
  public void integrationTest() {
    try {
      AnnotatorTester annotatorTester = new AnnotatorTester(integrationDescPath);
      testAnnotator(annotatorTester);
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
    }
View Full Code Here

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

  }
 
  @Test
  public void unitMockedTest() {
    try {
      AnnotatorTester annotatorTester = new AnnotatorTester(mockedDescPath);
      testAnnotator(annotatorTester);
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
    }
View Full Code Here

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

  @Test
  public void testCASConsumer() {
    try {
      /* create Solrcas tester */
      AnnotatorTester annotatorTester = new AnnotatorTester("src/test/resources/TestSolrcasAE.xml");

      /* create a mock CAS */
      CAS cas = getCAS();

      cas.setDocumentText("Francesco Totti is the best football player");
      cas.setDocumentLanguage("en");

      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

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

  @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

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

  /**
   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception {
    this.annotTester = new AnnotatorTester(JUnitExtension.getFile("SnowballAnnotator.xml"));
  }
View Full Code Here

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

  /**
   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception
  {
    this.annotTester = new AnnotatorTester(JUnitExtension.getFile("WhitespaceTokenizer.xml"));
  }
View Full Code Here

Examples of org.apache.uima.test.junit_extension.AnnotatorTester

  /**
   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception
  {
    this.annotBshTester = new AnnotatorTester(JUnitExtension.getFile("BeanshellTestAnnotator.xml"));
  }
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.