    @Test
    public void test() throws Exception {

        ComponentConfigurationParameters readerParameters = ComponentConfigurationParameters.newInstance()
                .withConfigParameter(
                        FileSystemCollectionReader.PARAM_SOURCE_TEXT_FILE_PATH,
                        new File("src/test/resources/input").getAbsolutePath());

        ComponentConfigurationParameters annotatorParameters = ComponentConfigurationParameters.newInstance()
                .withConfigParameter(S4DocumentUimaFitAnnotator.PARAM_S4_SERVICE_ENDPOINT, "http://text.s4.ontotext.com/v1/news")
                .withConfigParameter(S4DocumentUimaFitAnnotator.PARAM_S4_API_KEY_ID, "")
                .withConfigParameter(S4DocumentUimaFitAnnotator.PARAM_S4_API_PASSWORD, "");

        ComponentConfigurationParameters xmiWriterParameters = ComponentConfigurationParameters.newInstance()
                .withConfigParameter
                        (XmiWriterCasConsumer.PARAM_OUTPUT_DIR,
                                new File("src/test/resources/output").getAbsolutePath());

        CollectionReaderDescription readerDesc = CollectionReaderFactory
                .createReaderDescription(FileSystemCollectionReader.class, readerParameters.getParametersArray());

        AnalysisEngineDescription annotatorDesc = AnalysisEngineFactory
                .createEngineDescription(S4DocumentUimaFitAnnotator.class, annotatorParameters.getParametersArray());

        AnalysisEngineDescription casWriter = AnalysisEngineFactory.createEngineDescription(
                XmiWriterCasConsumer.class, xmiWriterParameters.getParametersArray());

        AggregateBuilder builder = new AggregateBuilder();
        builder.add(annotatorDesc);
        builder.add(casWriter);

        SimplePipeline.runPipeline(readerDesc, builder.createAggregateDescription());


    }