### Question:
S4UimaPipeline { private static void runPipeline(S4Endpoints s4Endpoint, String apiKeyId, String apiPassword, String rawTextFilePath, String xmiDir, String descriptorDir, String generateTypeSystemFlag) throws Exception { ComponentConfigurationParameters readerParameters = ComponentConfigurationParameters.newInstance() .withConfigParameter(FileSystemCollectionReader.PARAM_SOURCE_TEXT_FILE_PATH, rawTextFilePath); ComponentConfigurationParameters annotatorParameters = ComponentConfigurationParameters.newInstance() .withConfigParameter(S4DocumentUimaFitAnnotator.PARAM_S4_SERVICE_ENDPOINT, s4Endpoint.toString()) .withConfigParameter(S4DocumentUimaFitAnnotator.PARAM_S4_API_KEY_ID, apiKeyId) .withConfigParameter(S4DocumentUimaFitAnnotator.PARAM_S4_API_PASSWORD, apiPassword) .withConfigParameter(S4DocumentUimaFitAnnotator.PARAM_GENERATE_TYPESYSTEM, generateTypeSystemFlag); ComponentConfigurationParameters xmiWriterParameters = ComponentConfigurationParameters.newInstance() .withConfigParameter(XmiWriterCasConsumer.PARAM_OUTPUT_DIR, xmiDir); CollectionReaderDescription readerDesc = CollectionReaderFactory .createReaderDescription(FileSystemCollectionReader.class, readerParameters.getParametersArray()); AnalysisEngineDescription annotatorDesc = AnalysisEngineFactory .createEngineDescription(S4DocumentUimaFitAnnotator.class, annotatorParameters.getParametersArray()); if (generateTypeSystemFlag.equals("true")) { final String serviceType = s4Endpoint.toString().substring(s4Endpoint.toString().lastIndexOf("/")); TypeSystemUtils.generateTypeSystemDynamically( descriptorDir, readerDesc, annotatorDesc, serviceType, S4DocumentUimaFitAnnotator.cachedTypeSystemDescriptions); return; } AnalysisEngineDescription casWriter = AnalysisEngineFactory.createEngineDescription( XmiWriterCasConsumer.class, xmiWriterParameters.getParametersArray()); AggregateBuilder builder = new AggregateBuilder(); builder.add(annotatorDesc); builder.add(casWriter); SimplePipeline.runPipeline(readerDesc, builder.createAggregateDescription()); }  static void main(String[] args);  }### Answer:
@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: .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()); }