CleartkAnnotator extends JCasAnnotator_ImplBase implements
    Initializable { @Override public void collectionProcessComplete() throws AnalysisEngineProcessException { super.collectionProcessComplete(); if (isTraining()) { dataWriter.finish(); } }  @Override void initialize(UimaContext context); @Override void collectionProcessComplete(); static final String PARAM_CLASSIFIER_FACTORY_CLASS_NAME; static final String PARAM_DATA_WRITER_FACTORY_CLASS_NAME; static final String PARAM_IS_TRAINING; }
@Test public void testDescriptor() throws UIMAException { try { AnalysisEngineFactory.createEngine( StringTestAnnotator.class, CleartkAnnotator.PARAM_DATA_WRITER_FACTORY_CLASS_NAME, DefaultStringTestDataWriterFactory.class.getName()); Assert.fail("expected exception with missing output directory"); } catch (ResourceInitializationException e) { } try { AnalysisEngineFactory.createEngine( StringTestAnnotator.class, DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY, outputDirectoryName); Assert.fail("expected exception with missing classifier jar"); } catch (ResourceInitializationException e) { } AnalysisEngine engine = AnalysisEngineFactory.createEngine( StringTestAnnotator.class, DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY, outputDirectoryName, CleartkAnnotator.PARAM_DATA_WRITER_FACTORY_CLASS_NAME, DefaultStringTestDataWriterFactory.class.getName()); Object dataWriter = engine.getConfigParameterValue(CleartkAnnotator.PARAM_DATA_WRITER_FACTORY_CLASS_NAME); Assert.assertEquals(DefaultStringTestDataWriterFactory.class.getName(), dataWriter); Object outputDir = engine.getConfigParameterValue(DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY); Assert.assertEquals(outputDirectoryName, outputDir); engine.collectionProcessComplete(); }