@Test public void propertiesAreCorrectlySet() throws Exception { WorkflowConfiguration cfg = parseFile("properties-test"); Workflow wf1 = cfg.findWorkflow(new WorkflowID("workflow-1")); Assert.assertEquals("workflow-1", wf1.getID().toString()); Assert.assertEquals(55, wf1.getMaxRetryCount()); Assert.assertEquals(Workflow.DEFAULT_START_TIME, wf1.getStartTime()); Assert.assertEquals(Workflow.DEFAULT_WAIT_TIMEOUT_SECONDS, wf1.getWaitTimeoutSeconds()); Workflow wf2 = cfg.findWorkflow(new WorkflowID("workflow-2")); Assert.assertEquals("workflow-2", wf2.getID().toString()); Assert.assertEquals(66, wf2.getMaxRetryCount()); Assert.assertEquals(new ScheduledTime("2014-03-10T12:34:56.789Z"), wf2.getStartTime()); Assert.assertEquals(23, wf2.getWaitTimeoutSeconds()); }
void parseFile(File f, StateDatabaseConnection connection) throws Exception { LOGGER.info("Loading file: " + f); FileReader fileReader = new FileReader(f); String fileName = f.toString(); evaluateReader(fileReader, fileName, connection); }
WorkflowConfigurationParser { void parseFile(File f, StateDatabaseConnection connection) throws Exception { LOGGER.info("Loading file: " + f); FileReader fileReader = new FileReader(f); String fileName = f.toString(); evaluateReader(fileReader, fileName, connection); } }
WorkflowConfigurationParser { void parseFile(File f, StateDatabaseConnection connection) throws Exception { LOGGER.info("Loading file: " + f); FileReader fileReader = new FileReader(f); String fileName = f.toString(); evaluateReader(fileReader, fileName, connection); } WorkflowConfigurationParser(File defaultsDir, Map<String, String> additionalJsVariables); }
WorkflowConfigurationParser { void parseFile(File f, StateDatabaseConnection connection) throws Exception { LOGGER.info("Loading file: " + f); FileReader fileReader = new FileReader(f); String fileName = f.toString(); evaluateReader(fileReader, fileName, connection); } WorkflowConfigurationParser(File defaultsDir, Map<String, String> additionalJsVariables); WorkflowConfigurationParser parseConfiguration(File workflowsDir, StateDatabaseConnection connection); WorkflowConfiguration getWorkflowConfiguration(); void importDefaultsIntoScope(String label, Global scope); void addWorkflow(Workflow wf); }
WorkflowConfigurationParser { void parseFile(File f, StateDatabaseConnection connection) throws Exception { LOGGER.info("Loading file: " + f); FileReader fileReader = new FileReader(f); String fileName = f.toString(); evaluateReader(fileReader, fileName, connection); } WorkflowConfigurationParser(File defaultsDir, Map<String, String> additionalJsVariables); WorkflowConfigurationParser parseConfiguration(File workflowsDir, StateDatabaseConnection connection); WorkflowConfiguration getWorkflowConfiguration(); void importDefaultsIntoScope(String label, Global scope); void addWorkflow(Workflow wf); static final String WORKFLOW_FILE_EXTENSION; }