Skip to content

Commit

Permalink
improve recovery test
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvard Fonsell committed Mar 16, 2015
1 parent 31cd6fe commit e4269a4
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ public void recoverWorkflowInstancesFromDeadNodesSetsExecutorIdToNullAndInsertsA
assertThat(workflowInstanceAction.executorId, is(dao.getExecutorId()));
assertThat(workflowInstanceAction.type, is(recovery));
assertThat(workflowInstanceAction.stateText, is("Recovered"));

dao.recoverWorkflowInstancesFromDeadNodes();

executorId = jdbc.queryForObject("select executor_id from nflow_workflow where id = ?", Integer.class, id);
assertThat(executorId, is(nullValue()));

actions = jdbc.query("select * from nflow_workflow_action where workflow_id = ?", new WorkflowInstanceActionRowMapper(
Collections.<Integer, Map<String, String>> emptyMap()), id);
assertThat(actions.size(), is(1));
assertThat(workflowInstanceAction.executorId, is(dao.getExecutorId()));
assertThat(workflowInstanceAction.type, is(recovery));
assertThat(workflowInstanceAction.stateText, is("Recovered"));
}

private void insertCrashedExecutor(int crashedExecutorId) {
Expand Down

0 comments on commit e4269a4

Please sign in to comment.