use of org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult in project knime-core by knime.
the class BugAP3673_CredentialsQF_InheritFromWkf method testExecuteFlow.
/**
* Test credentials that are set during load of workflow.
*/
@Test
public void testExecuteFlow() throws Exception {
final TestWorkflowLoadHelper lH = new TestWorkflowLoadHelper("some-fixed-password");
WorkflowLoadResult loadWorkflow = loadWorkflow(getDefaultWorkflowDirectory(), new ExecutionMonitor(), lH);
setManager(loadWorkflow.getWorkflowManager());
assertThat("Invalid prompt count - only workflow variables are expected to be prompted", lH.getPromptCount(), is(1));
executeAllAndWait();
checkState(getManager(), InternalNodeContainerState.EXECUTED);
}
use of org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult in project knime-core by knime.
the class BugAP3673_CredentialsQF_InheritFromWkf method testExecuteFlowThenChangeCredentials.
/**
* Test credentials that are set after workflow has been loaded (mimics behavior on the server).
*/
@Test
public void testExecuteFlowThenChangeCredentials() throws Exception {
// provides no valid credentials, first execution supposed to fail
WorkflowLoadResult loadWorkflow = loadWorkflow(getDefaultWorkflowDirectory(), new ExecutionMonitor());
WorkflowManager wfm = loadWorkflow.getWorkflowManager();
setManager(wfm);
executeAllAndWait();
checkState(getManager(), InternalNodeContainerState.IDLE);
wfm.resetAndConfigureAll();
wfm.updateCredentials(new Credentials("credentials-input", "some-fixed-username", "some-fixed-password"));
executeAllAndWait();
checkState(getManager(), InternalNodeContainerState.EXECUTED);
}
use of org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult in project knime-core by knime.
the class BugAP5712_CloseWhileStreaming method testSaveLoadWhileExecuting.
@Test(timeout = 3000L)
public void testSaveLoadWhileExecuting() throws Exception {
WorkflowManager manager = getManager();
ReentrantLock execLock = BlockingRepository.get(LOCK_ID);
execLock.lock();
try {
manager.executeAll();
final NodeContainer streamNC = findNodeContainer(m_streamSubnode_5);
waitWhile(streamNC, new Hold() {
@Override
protected boolean shouldHold() {
return !streamNC.getInternalState().isExecutingRemotely();
}
});
checkState(m_streamSubnode_5, EXECUTINGREMOTELY);
checkState(m_tableView_4, UNCONFIGURED_MARKEDFOREXEC);
manager.save(m_workflowDir, new ExecutionMonitor(), true);
assertTrue(manager.canCancelAll());
getLogger().error("Canceling...");
manager.getParent().cancelExecution(manager);
waitWhileInExecution();
} finally {
execLock.unlock();
}
closeWorkflow();
assertNull(getManager());
WorkflowLoadResult loadResult = initWorkflowFromTemp();
assertFalse("should not have errors", loadResult.hasErrors());
// when saving the workflow while executing we can't determine the correct 'safe' state of all nodes
// in the wrapped metanode - most of them are configured but downstream of the transpose they are idle;
// the framework saves them as IDLE and the load-routines will update the state ... and warn.
assertTrue("should have warnings on state - unpredictable during #save", loadResult.hasWarningEntries());
manager = getManager();
}
use of org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult in project knime-core by knime.
the class BugAP6262_FileStoresInPortObjectCell method initWorkflowFromTemp.
private WorkflowLoadResult initWorkflowFromTemp() throws Exception {
// will save the workflow in one of the test ...don't write SVN folder
WorkflowLoadResult loadResult = loadWorkflow(m_workflowDir, new ExecutionMonitor());
setManager(loadResult.getWorkflowManager());
NodeID baseID = getManager().getID();
m_predictorLoopStart_11 = new NodeID(baseID, 11);
return loadResult;
}
use of org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult in project knime-core by knime.
the class BugAP7010_DataLoadedWithSandboxedNodeCreator method initWorkflowFromTemp.
private WorkflowLoadResult initWorkflowFromTemp() throws Exception {
WorkflowLoadResult loadResult = loadWorkflow(m_workflowDir, new ExecutionMonitor());
setManager(loadResult.getWorkflowManager());
NodeID baseID = getManager().getID();
m_tableCreator = new NodeID(baseID, 1);
m_rowSplitter = new NodeID(baseID, 2);
return loadResult;
}
Aggregations