private WorkflowCondition testCond;
private static final int defaultPgSz = 20;
public TestLuceneWorkflowInstanceRepository() {
testInst = new WorkflowInstance();
testWkflw = new Workflow();
testTask = new WorkflowTask();
testCond = new WorkflowCondition();
// check to see if catalog path exists: (it may b/c
// the user may run many unit tests)
// if it exists, blow it away
if (new File(catalogPath).exists()) {
try {
FileUtils.deleteDirectory(new File(catalogPath));
} catch (IOException e) {
fail(e.getMessage());
}
}
repo = new LuceneWorkflowInstanceRepository(catalogPath, defaultPgSz);
testWkflw.setName("test.workflow");
testWkflw.setId("test.id");
List tasks = new Vector();
List conds = new Vector();
testCond.setConditionId("test.cond.id");
testCond.setConditionInstanceClassName("test.class");
testCond.setConditionName("test.cond.name");
testCond.setOrder(1);
conds.add(testCond);
testTask.setTaskConfig(new WorkflowTaskConfiguration());
testTask.setTaskId("test.task.id");
testTask.setConditions(conds);
testTask.setOrder(1);
testTask.setTaskInstanceClassName("test.class");
testTask.setTaskName("test.task.name");
tasks.add(testTask);
testWkflw.setTasks(tasks);
testInst = new WorkflowInstance();
testInst.setCurrentTaskId("test.task");
testInst.setStatus(STARTED);
testInst.setWorkflow(testWkflw);
Metadata sharedContext = new Metadata();