@Override public ExecutableFlow fetchExecutableFlow(final int id) throws ExecutorManagerException { return this.executionFlowDao.fetchExecutableFlow(id); }
@Test public void testAdvancedFilter() throws Exception { createTestProject(); final ExecutableFlow flow = createTestFlow(); this.executionFlowDao.uploadExecutableFlow(flow); final List<ExecutableFlow> flowList1 = this.executionFlowDao .fetchFlowHistory("exectest1", "", "", 0, -1, -1, 0, 16); assertThat(flowList1.size()).isEqualTo(1); final ExecutableFlow fetchFlow = this.executionFlowDao.fetchExecutableFlow(flow.getExecutionId()); assertTwoFlowSame(flowList1.get(0), fetchFlow); }
@Test public void fetchFlowHistory() throws Exception { final ExecutableFlow flow = createTestFlow(); this.executionFlowDao.uploadExecutableFlow(flow); final List<ExecutableFlow> flowList1 = this.executionFlowDao.fetchFlowHistory(0, 2); assertThat(flowList1.size()).isEqualTo(1); final List<ExecutableFlow> flowList2 = this.executionFlowDao .fetchFlowHistory(flow.getProjectId(), flow.getId(), 0, 2); assertThat(flowList2.size()).isEqualTo(1); final ExecutableFlow fetchFlow = this.executionFlowDao.fetchExecutableFlow(flow.getExecutionId()); assertTwoFlowSame(flowList1.get(0), flowList2.get(0)); assertTwoFlowSame(flowList1.get(0), fetchFlow); }
@Test public void testUpdateExecutableFlow() throws Exception { final ExecutableFlow flow = createTestFlow(); this.executionFlowDao.uploadExecutableFlow(flow); final ExecutableFlow fetchFlow = this.executionFlowDao.fetchExecutableFlow(flow.getExecutionId()); fetchFlow.setEndTime(System.currentTimeMillis()); fetchFlow.setStatus(Status.SUCCEEDED); this.executionFlowDao.updateExecutableFlow(fetchFlow); final ExecutableFlow fetchFlow2 = this.executionFlowDao.fetchExecutableFlow(flow.getExecutionId()); assertTwoFlowSame(fetchFlow, fetchFlow2); }
@Test public void testUploadAndFetchExecutionFlows() throws Exception { final ExecutableFlow flow = createTestFlow(); this.executionFlowDao.uploadExecutableFlow(flow); final ExecutableFlow fetchFlow = this.executionFlowDao.fetchExecutableFlow(flow.getExecutionId()); assertThat(flow).isNotSameAs(fetchFlow); assertTwoFlowSame(flow, fetchFlow); }
@Override public ExecutableFlow fetchExecutableFlow(final int id) throws ExecutorManagerException { return this.executionFlowDao.fetchExecutableFlow(id); }