assertTrue(step instanceof FinalStep);
}
public void testAddAnalysisEngines() throws Exception {
CAS cas = CasCreationUtils.createCas(new TypeSystemDescription_impl(), null, null);
Flow flow = fixedFlowController.computeFlow(cas);
//two steps in flow
Step step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key1", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key2", ((SimpleStep)step).getAnalysisEngineKey());
//now add two new AEs
//first update AE metadata map
AnalysisEngineMetaData delegateMd = new AnalysisEngineMetaData_impl();
delegateMd.setOperationalProperties(new OperationalProperties_impl());
analysisEngineMetaDataMap.put("key4", delegateMd);
analysisEngineMetaDataMap.put("key5", delegateMd);
//then notify FC
List<String> newAeKeys = new ArrayList<String>();
newAeKeys.add("key4");
newAeKeys.add("key5");
fixedFlowController.addAnalysisEngines(newAeKeys);
//finish flow
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key3", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key4", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key5", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof FinalStep);
//test new flow
flow = fixedFlowController.computeFlow(cas);
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key1", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key2", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key3", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key4", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof SimpleStep);
assertEquals("key5", ((SimpleStep)step).getAnalysisEngineKey());
step = flow.next();
assertTrue(step instanceof FinalStep);
}