Examples of AnnotatorTester


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

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

      // create annotation tester with the dictionary annotator specifier
      AnnotatorTester annotTester = new AnnotatorTester(
            JUnitExtension
                  .getFile("DictionaryAnnotatorTests/DictionaryAnnotatorInvalidOutputType.xml"));

      boolean foundMessage = false;
      try {
         annotTester.performTest("Dummy text", "en");
      } catch (DictionaryAnnotatorProcessException ex) {
         String message = ex.getMessage();
         if (message.indexOf("org.apache.uima.DictionaryEntry") > -1) {
            foundMessage = true;
         }
View Full Code Here

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

   public void testDictionaryAnnotatorDictFileNotFound() throws Exception {

      boolean foundMessage = false;
      try {
         // create annotation tester with the dictionary annotator specifier
         new AnnotatorTester(
               JUnitExtension
                     .getFile("DictionaryAnnotatorTests/DictionaryAnnotatorDictFileNotFound.xml"));
      } catch (ResourceInitializationException ex) {
         String message = ex.getCause().getMessage();
         if (message.indexOf("fileNotFound.xml") > -1) {
View Full Code Here

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

      // test annotator configuration with
      // - duplicate concept names
      // - duplicate rule IDs within the same concept
      // - duplicate annotation IDs within the concept file document but not
      // within the same concept
      new AnnotatorTester(JUnitExtension
            .getFile("conceptSyntax/RegExAnnotDuplicateNames.xml"));
   }
View Full Code Here

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

   public void testSyntaxDuplicateAnnotationIds() throws Exception {
      // test annotator configuration with
      // - duplicate annotation IDs within the same concept
      String message = "";
      try {
         new AnnotatorTester(JUnitExtension
               .getFile("conceptSyntax/RegExAnnotDuplicateAnnotId.xml"));
      } catch (ResourceInitializationException ex) {
         message = ex.getCause().getLocalizedMessage();
      }
      Assert
View Full Code Here

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

   public void testSyntaxReferenceAnnotationIdNotAvaliable() throws Exception {
      // test annotator configuration with
      // - missing annotation ID-
      String message = "";
      try {
         new AnnotatorTester(JUnitExtension
               .getFile("conceptSyntax/RegExAnnotReferenceFeature.xml"));
      } catch (ResourceInitializationException ex) {
         message = ex.getCause().getLocalizedMessage();
      }
      Assert.assertTrue(
View Full Code Here

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

      // test annotator configuration with
      // a missing annotation id for the annotation that has - duplicate
      // annotation IDs within the same concept
      String message = "";
      try {
         new AnnotatorTester(JUnitExtension
               .getFile("conceptSyntax/RegExAnnotReferenceFeatureError.xml"));
      } catch (ResourceInitializationException ex) {
         message = ex.getCause().getLocalizedMessage();
      }
      Assert
View Full Code Here

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

      // test annotator configuration with a concept file that could not be
      // found
      // in the UIMA datapath or in the classpath
      String message = "";
      try {
         new AnnotatorTester(JUnitExtension
               .getFile("conceptSyntax/RegExAnnotRuleFileNotFound.xml"));
      } catch (ResourceInitializationException ex) {
         message = ex.getCause().getLocalizedMessage();
      }
      Assert
View Full Code Here

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

   public void testSyntaxNotAllRuleFilesAvailable() throws Exception {
      // test annotator configuration with more than one concept file
      // where one of the concept files could not be found
      String message = "";
      try {
         new AnnotatorTester(JUnitExtension
               .getFile("conceptSyntax/RegExAnnotNotAllRuleFilesAvailable.xml"));
      } catch (ResourceInitializationException ex) {
         message = ex.getCause().getLocalizedMessage();
      }
      Assert
View Full Code Here

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

      // test annotator configuration with a concept file that is loaded
      // using the UIMA datapath
      ResourceManager rscMgr = UIMAFramework.newDefaultResourceManager();
      rscMgr.setDataPath(JUnitExtension.getFile("conceptSyntax")
            .getAbsolutePath());
      new AnnotatorTester(JUnitExtension.getFile(
            "conceptSyntax/RegExAnnotLoadRuleFileUsingDatapath.xml")
            .getAbsolutePath(), rscMgr);
   }
View Full Code Here

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

  
   public void testCustomNormalizationSyntaxError() throws Exception {
      // test annotator configuration with a syntax error for the custom normalizer
      String message = "";
      try {
         new AnnotatorTester(JUnitExtension
               .getFile("conceptSyntax/RegExAnnotCustomNormalizationSyntaxError.xml"));
      } catch (ResourceInitializationException ex) {
         message = ex.getCause().getLocalizedMessage();
      }
      Assert
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.