ConfigMain { public static ConfigSchema transformTemplateToSchema(InputStream source) throws JAXBException, IOException { try { TemplateDTO templateDTO = (TemplateDTO) JAXBContext.newInstance(TemplateDTO.class).createUnmarshaller().unmarshal(source); FlowSnippetDTOEnricher enricher = new FlowSnippetDTOEnricher(); enricher.enrich(templateDTO.getSnippet(), templateDTO.getEncodingVersion()); ConfigSchema configSchema = new ConfigSchemaFunction().apply(templateDTO); return configSchema; } finally { source.close(); } } ConfigMain();  ConfigMain(PathInputStreamFactory pathInputStreamFactory, PathOutputStreamFactory pathOutputStreamFactory); static void main(String[] args); static void printValidateUsage(); int validate(String[] args); static void printTransformUsage(); static void printUpgradeUsage(); static ConfigSchema transformTemplateToSchema(InputStream source); static ConfigSchema transformVersionedFlowSnapshotToSchema(InputStream source); static ConfigSchema transformVersionedFlowSnapshotToSchema(VersionedFlowSnapshot versionedFlowSnapshot); int upgrade(String[] args); T loadAndPrintValidationErrors(InputStream inputStream, BiFunction<ConfigSchema, Boolean, T> resultHandler); int transform(String[] args); int execute(String[] args); Map<String, Command> createCommandMap(); void printUsage(); static final int ERR_INVALID_ARGS; static final int ERR_UNABLE_TO_OPEN_OUTPUT; static final int ERR_UNABLE_TO_OPEN_INPUT; static final int ERR_UNABLE_TO_READ_TEMPLATE; static final int ERR_UNABLE_TO_PARSE_CONFIG; static final int ERR_INVALID_CONFIG; static final int ERR_UNABLE_TO_CLOSE_CONFIG; static final int ERR_UNABLE_TO_SAVE_CONFIG; static final int SUCCESS; static final String TRANSFORM; static final String TRANSFORM_VFS; static final String VALIDATE; static final String UPGRADE; static final String THERE_ARE_VALIDATION_ERRORS_WITH_THE_TEMPLATE_STILL_OUTPUTTING_YAML_BUT_IT_WILL_NEED_TO_BE_EDITED; }
@Test public void testSuccessTransformProcessGroup() throws IOException, JAXBException, SchemaLoaderException { ConfigMain.transformTemplateToSchema(getClass().getClassLoader().getResourceAsStream("TemplateWithProcessGroup.xml")).toMap(); }
@Test public void testSuccessTransformInputPort() throws IOException, JAXBException, SchemaLoaderException { ConfigMain.transformTemplateToSchema(getClass().getClassLoader().getResourceAsStream("TemplateWithOutputPort.xml")).toMap(); }
@Test public void testSuccessTransformOutputPort() throws IOException, JAXBException, SchemaLoaderException { ConfigMain.transformTemplateToSchema(getClass().getClassLoader().getResourceAsStream("TemplateWithInputPort.xml")).toMap(); }
@Test public void testSuccessTransformFunnel() throws IOException, JAXBException, SchemaLoaderException { ConfigMain.transformTemplateToSchema(getClass().getClassLoader().getResourceAsStream("TemplateWithFunnel.xml")).toMap(); }
@Test public void testSuccessTransformDualRPGs() throws IOException, JAXBException, SchemaLoaderException { ConfigSchema configSchema = ConfigMain.transformTemplateToSchema(getClass().getClassLoader().getResourceAsStream("MINIFI-496/dual_rpgs.xml")); Assert.assertTrue(configSchema.isValid()); }