Search in sources :

Example 6 with WizardPage

use of org.knime.core.node.wizard.page.WizardPage in project knime-core by knime.

the class EnhWEBP674_SinglePageExecution method reexecuteSinglePageAndKeepExecuting.

private void reexecuteSinglePageAndKeepExecuting(WizardExecutionController wec) {
    wec.reexecuteSinglePage(createNodeID(getManager().getID(), 7, 0, 7), createWizardPageInput(400000));
    assertThat(wec.hasCurrentWizardPage(), is(true));
    Awaitility.await().atMost(5, TimeUnit.SECONDS).pollInterval(100, TimeUnit.MILLISECONDS).untilAsserted(() -> {
        WizardPage pc = wec.getCurrentWizardPage();
        assertThat(pc.getPageMap().size(), is(4));
    });
}
Also used : WizardPage(org.knime.core.node.wizard.page.WizardPage)

Example 7 with WizardPage

use of org.knime.core.node.wizard.page.WizardPage in project knime-core by knime.

the class Bug6713_newWizardContainingOldMetanode method testWizardStepThrough.

@Test
public void testWizardStepThrough() throws Exception {
    final WorkflowManager wfm = getManager();
    assertTrue("should have new wizard execution", WebResourceController.hasWizardExecution(wfm));
    WizardExecutionController wizardController = wfm.getWizardExecutionController();
    wizardController.stepFirst();
    waitWhile(wfm, new WizardHold(), -1);
    assertTrue("should have steps", wizardController.hasCurrentWizardPage());
    checkState(m_subnodeFirstPage_6, EXECUTED);
    checkState(m_subnodeSecondPage_7, CONFIGURED_MARKEDFOREXEC);
    checkState(m_javaEdit_3, CONFIGURED_MARKEDFOREXEC);
    // outside loop
    WizardPage currentWizardPage = wizardController.getCurrentWizardPage();
    // TODO: load something real
    wizardController.loadValuesIntoCurrentPage(Collections.<String, String>emptyMap());
    // TODO check IDs
    // assertEquals(m_subnodeFirstPage_6.toString(), currentWizardPage.getPageNodeID());
    wizardController.stepNext();
    waitWhile(wfm, new WizardHold(), -1);
    checkState(wfm, CONFIGURED_MARKEDFOREXEC, UNCONFIGURED_MARKEDFOREXEC);
    checkStateOfMany(EXECUTED, m_subnodeFirstPage_6, m_subnodeSecondPage_7, m_javaEdit_3);
    checkStateOfMany(CONFIGURED_MARKEDFOREXEC, m_metaNode_8, m_javaEdit_InMetaNode_8_4);
    checkStateOfMany(UNCONFIGURED_MARKEDFOREXEC, m_subnodeThirdPage_9);
    assertTrue("should have steps (2nd page)", wizardController.hasCurrentWizardPage());
    // inside loop 1st time
    currentWizardPage = wizardController.getCurrentWizardPage();
    // assertEquals(m_subnodeSecondPage_7.toString(), currentWizardPage.getPageNodeID());
    wizardController.stepNext();
    waitWhile(wfm, new WizardHold(), -1);
    checkState(m_subnodeThirdPage_9, EXECUTED);
    checkState(wfm, EXECUTED);
    assertTrue("should have steps (3rd/last page)", wizardController.hasCurrentWizardPage());
    // inside loop 2nd time
    currentWizardPage = wizardController.getCurrentWizardPage();
    // assertEquals(m_subnodeSecondPage_7.toString(), currentWizardPage.getPageNodeID());
    wizardController.stepNext();
    waitWhile(wfm, new WizardHold(), -1);
    assertFalse("should have no more pages", wizardController.hasCurrentWizardPage());
    checkState(wfm, EXECUTED);
}
Also used : WizardPage(org.knime.core.node.wizard.page.WizardPage) Test(org.junit.Test)

Aggregations

WizardPage (org.knime.core.node.wizard.page.WizardPage)7 Test (org.junit.Test)6 HashMap (java.util.HashMap)1 NodeSettings (org.knime.core.node.NodeSettings)1 ValidationError (org.knime.core.node.web.ValidationError)1 BugWEBP803_OnlyResetNodesToBeReexecuted.createNodeID (org.knime.core.node.workflow.BugWEBP803_OnlyResetNodesToBeReexecuted.createNodeID)1 WizardHold (org.knime.core.node.workflow.TestWizardExec_Loop_Simple.WizardHold)1