Search in sources :

Example 1 with AdapterNodeFactory

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());
}
Also used : DefaultNodeProgressMonitor(org.knime.core.node.DefaultNodeProgressMonitor) AdapterNodeFactory(org.knime.core.node.workflow.node.adapter.AdapterNodeFactory) AdapterNodeFactory(org.knime.core.node.workflow.node.adapter.AdapterNodeFactory) ExecutionMonitor(org.knime.core.node.ExecutionMonitor) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 DefaultNodeProgressMonitor (org.knime.core.node.DefaultNodeProgressMonitor)1 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)1 AdapterNodeFactory (org.knime.core.node.workflow.node.adapter.AdapterNodeFactory)1