Package org.apache.uima.test.junit_extension

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


      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("variables/RegExAnnotVariables.xml"));

      CAS cas = annotTester.performTest(
            "Monday simple regex with variables Tuesday", "en");

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


      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("variables/RegExAnnotVariables.xml"));

      CAS cas = annotTester.performTest("Tuesday January Sunday test {days}",
            "en");

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

      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("variables/RegExAnnotVariables.xml"));

      CAS cas = annotTester.performTest("Match: Jan. Don't macht Jana", "en");

      // define result interested in
      String[] tofs = { "org.apache.uima.TestAnnot" };

      // compare results
View Full Code Here

  public void testMatchAll() throws Exception {

    // create annotation tester with the regex annotator specifier
    AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("matchStrategy/RegExAnnotMatchStrategy.xml"));
    CAS cas = annotTester.performTest("no mactch matchALL matchALL matchALL no match", "en");

    // define result interested in
    String[] tofs = { "org.apache.uima.TestAnnot" };

    // compare results
View Full Code Here

  public void testMatchFirst() throws Exception {

    // create annotation tester with the regex annotator specifier
    AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("matchStrategy/RegExAnnotMatchStrategy.xml"));
    CAS cas = annotTester.performTest("no mactch matchFirst matchFirst no match", "en");

    // define result interested in
    String[] tofs = { "org.apache.uima.TestAnnot" };

    // compare results
View Full Code Here

  public void testMatchCompleteOK() throws Exception {

    // create annotation tester with the regex annotator specifier
    AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("matchStrategy/RegExAnnotMatchStrategy.xml"));
    CAS cas = annotTester.performTest("matchComplete", "en");

    // define result interested in
    String[] tofs = { "org.apache.uima.TestAnnot" };

    // compare results
View Full Code Here

  public void testMatchCompleteNotOK() throws Exception {

    // create annotation tester with the regex annotator specifier
    AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("matchStrategy/RegExAnnotMatchStrategy.xml"));
    CAS cas = annotTester.performTest("matchComplete is not OK", "en");

    // define result interested in
    String[] tofs = { "org.apache.uima.TestAnnot", "uima.tcas.DocumentAnnotation" };

    // compare results
View Full Code Here

   public void testSimpleFeaturePathMatching() throws Exception {

      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("featurePathMatching/RegExAnnotFeaturePath.xml"));
      CAS cas = annotTester.performTest("My SimpleRegex String", "en");

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

   public void testAdvancedFeaturePathMatching() throws Exception {

      // create annotation tester with the regex annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("featurePathMatching/RegExAnnotFeaturePath.xml"));
      CAS cas = annotTester.performTest("My AdvancedRegex String", "en");

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

      AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
            .getFile("featurePathMatching/RegExAnnotInvalidFeaturePath.xml"));
     
      boolean foundMessage = false;
      try {
         annotTester.performTest("Dummy text", "en");
      }catch(RegexAnnotatorProcessException ex) {
         String message = ex.getCause().getMessage();
         if(message.indexOf("testFeature/invalid/path") > -1){
            foundMessage = true;
         }
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.