use of org.knime.core.node.workflow.node.adapter.AdapterNodeFactory in project knime-core by knime.
the class Enh1536_CancelDuringLoad method setUp.
@Before
public void setUp() throws Exception {
m_workflowDirectory = FileUtil.createTempDir(getClass().getSimpleName());
NODE_PROGRESS_THREAD_LOCAL.set(new DefaultNodeProgressMonitor());
final WorkflowCreationHelper creationHelper = new WorkflowCreationHelper();
creationHelper.setWorkflowContext(new WorkflowContext.Factory(m_workflowDirectory).createContext());
WorkflowManager wm = WorkflowManager.ROOT.createAndAddProject(getClass().getSimpleName(), creationHelper);
NodeID sourceNode = wm.addNode(new AdapterNodeFactory(true));
NodeID cancelOnLoadNode = wm.addNode(new CancelDuringLoadInternalsNodeFactory());
NodeID checkLoadInternalNotCalledNode = wm.addNode(new CheckLoadInternalsNotCalledNodeFactory());
wm.addConnection(sourceNode, 1, cancelOnLoadNode, 1);
wm.addConnection(cancelOnLoadNode, 1, checkLoadInternalNotCalledNode, 1);
wm.executeAllAndWaitUntilDone();
assertEquals(wm.printNodeSummary(wm.getID(), 0), InternalNodeContainerState.EXECUTED, wm.getInternalState());
wm.save(m_workflowDirectory, new ExecutionMonitor(), true);
WorkflowManager.ROOT.removeNode(wm.getID());
}
Aggregations