use of org.knime.core.node.ExecutionMonitor in project knime-core by knime.
the class TestRecursiveMetaNodeUpdate method testAllUpdateAfterLoad.
@Test
public void testAllUpdateAfterLoad() throws Exception {
getManager().updateMetaNodeLinks(createTemplateLoadHelper(), true, new ExecutionMonitor());
executeAllAndWait();
checkStateOfMany(InternalNodeContainerState.CONFIGURED, m_tableDiff_BeforeUpdate_11, m_tableDiff_BeforeUpdate_13, m_tableDiff_BeforeUpdate_15, m_tableDiff_BeforeUpdate_17, m_tableDiff_BeforeUpdate_21);
checkStateOfMany(InternalNodeContainerState.EXECUTED, m_metaNoUpdateAvail_4, m_metaUpdateOnlyInChild_5, m_metaUpdateTwoChildren_6, m_metaDifferentDefault_7, m_metaHiddenLink_19);
checkStateOfMany(InternalNodeContainerState.EXECUTED, m_tableDiff_AfterUpdate_22, m_tableDiff_AfterUpdate_23, m_tableDiff_AfterUpdate_27, m_tableDiff_AfterUpdate_28, m_tableDiff_AfterUpdate_30);
}
use of org.knime.core.node.ExecutionMonitor in project knime-core by knime.
the class BugAP7982_FutureKNIMEVersion_FutureVersion method loadWorkflow.
private WorkflowLoadResult loadWorkflow(final boolean tryToLoadInsteadOfFail) throws Exception {
File wkfDir = getDefaultWorkflowDirectory();
WorkflowLoadResult loadWorkflow = loadWorkflow(wkfDir, new ExecutionMonitor(), new WorkflowLoadHelper(wkfDir) {
@Override
public UnknownKNIMEVersionLoadPolicy getUnknownKNIMEVersionLoadPolicy(final LoadVersion workflowKNIMEVersion, final Version createdByKNIMEVersion, final boolean isNightlyBuild) {
assertThat("Unexpected KNIME version in file", workflowKNIMEVersion, is(LoadVersion.FUTURE));
assertThat("Nightly flag wrong", isNightlyBuild, is(m_isExpectNightly));
if (tryToLoadInsteadOfFail) {
return UnknownKNIMEVersionLoadPolicy.Try;
} else {
return UnknownKNIMEVersionLoadPolicy.Abort;
}
}
});
return loadWorkflow;
}
use of org.knime.core.node.ExecutionMonitor in project knime-core by knime.
the class Enh1536_CancelDuringLoad method testCancelWhileLoad.
@Test
public void testCancelWhileLoad() throws Exception {
int previousChildCount = WorkflowManager.ROOT.getNodeContainers().size();
LOAD_NODE_STATE_THREAD_LOCAL.set(LoadNodeState.Default);
DefaultNodeProgressMonitor progMon = NODE_PROGRESS_THREAD_LOCAL.get();
try {
final WorkflowLoadHelper loadHelper = new WorkflowLoadHelper(m_workflowDirectory);
WorkflowManager.ROOT.load(m_workflowDirectory, new ExecutionMonitor(progMon), loadHelper, true);
fail("Workflow should not load as it's canceled");
} catch (CanceledExecutionException e) {
assertEquals(LoadNodeState.MiddleNodeCanceled, LOAD_NODE_STATE_THREAD_LOCAL.get());
} finally {
LOAD_NODE_STATE_THREAD_LOCAL.set(null);
}
assertEquals(previousChildCount, WorkflowManager.ROOT.getNodeContainers().size());
}
use of org.knime.core.node.ExecutionMonitor in project knime-core by knime.
the class BlobsInLoops method testLoopExecThenSaveAndLoad.
@Test
public void testLoopExecThenSaveAndLoad() throws Exception {
checkState(m_source8, InternalNodeContainerState.CONFIGURED);
executeAndWait(m_loopEnd14, m_verify15);
checkStateOfMany(InternalNodeContainerState.EXECUTED, m_loopEnd14, m_verify15);
getManager().save(m_workflowDirTemp, new ExecutionMonitor(), true);
closeWorkflow();
Assert.assertThat("Workflow is null", getManager(), IsNull.nullValue());
init();
checkStateOfMany(InternalNodeContainerState.EXECUTED, m_loopEnd14, m_verify15);
reset(m_verify15);
executeAndWait(m_verify15);
checkState(m_verify15, InternalNodeContainerState.EXECUTED);
}
use of org.knime.core.node.ExecutionMonitor in project knime-core by knime.
the class BlobsInLoops method testSimpleExecThenSaveAndLoad.
@Test
public void testSimpleExecThenSaveAndLoad() throws Exception {
checkStateOfMany(InternalNodeContainerState.CONFIGURED, m_create1, m_source3);
executeAndWait(m_create1, m_tableWriter4);
checkStateOfMany(InternalNodeContainerState.EXECUTED, m_create1, m_source3);
getManager().save(m_workflowDirTemp, new ExecutionMonitor(), true);
closeWorkflow();
Assert.assertThat("Workflow is null", getManager(), IsNull.nullValue());
init();
checkStateOfMany(InternalNodeContainerState.EXECUTED, m_create1, m_source3);
checkStateOfMany(InternalNodeContainerState.CONFIGURED, m_verify2, m_tableReader5, m_verify6);
executeAndWait(m_verify6, m_verify2);
checkStateOfMany(InternalNodeContainerState.EXECUTED, m_verify2, m_tableReader5, m_verify6);
}
Aggregations