Search in sources :

Example 1 with SystemJobIsRunning

use of org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning in project jbosstools-openshift by jbosstools.

the class CDKLaunchConfigurationTest method setupServerWizardPage.

@Override
protected void setupServerWizardPage(NewMenuWizard dialog) {
    NewServerWizardPage page = new NewServerWizardPage(dialog);
    page.selectType(SERVER_TYPE_GROUP, CDK32_SERVER_NAME);
    page.setName(getServerAdapter());
    dialog.next();
    NewCDK32ServerWizardPage containerPage = new NewCDK32ServerWizardPage();
    containerPage.setCredentials(USERNAME, PASSWORD);
    log.info("Setting hypervisor to: " + hypervisor);
    containerPage.setHypervisor(hypervisor);
    log.info("Setting binary to " + CDK32_MINISHIFT);
    containerPage.setMinishiftBinary(CDK32_MINISHIFT);
    // here comes possibility to set profile while creating server adapter
    log.info("Setting profile to: ");
    containerPage.setMinishiftProfile("");
    new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.MEDIUM, false);
}
Also used : NewCDK32ServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) NewServerWizardPage(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage)

Example 2 with SystemJobIsRunning

use of org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning in project jbosstools-openshift by jbosstools.

the class CDKServerWizardAbstractTest method assertSameMessage.

protected void assertSameMessage(final NewMenuWizard dialog, final String message) {
    new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.DEFAULT, false);
    String description = dialog.getMessage();
    assertTrue("Expected page description should contain text: " + message + " but has: " + description, description.contains(message));
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile)

Example 3 with SystemJobIsRunning

use of org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning in project jbosstools-openshift by jbosstools.

the class CDKServer method operateServerState.

@Override
protected void operateServerState(String menuItem, final ServerState resultState) {
    ServerState actualState = this.getLabel().getState();
    MultipleWaitConditionHandler waitConditions = new MultipleWaitConditionHandler(waitConditionMatrix, " one of given wait condition is fulfilled");
    TimePeriod timeout = TimePeriod.VERY_LONG;
    if (menuItem == "Restart") {
        timeout = TimePeriod.getCustom(480);
    }
    log.debug("Operate server's state from: + '" + actualState + "' to '" + menuItem + "'");
    select();
    new ContextMenuItem(menuItem).select();
    // waiting until servers's state has changed from initial state into something else,
    // ie. stopped -> starting or started -> stopping
    new WaitWhile(new ServerHasState(this, actualState), TimePeriod.DEFAULT);
    // we might expect that after the state is changed it should not go back into initial state
    // or that problem dialog appears
    // later on, we might get "Multiple problems have occurred" dialog
    waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
    checkInitialStateChange(actualState);
    // decide if we wait for SSL acceptance dialog
    if ((actualState == ServerState.STOPPING || actualState == ServerState.STOPPED) && !getCertificatedAccepted()) {
        new WaitUntil(waitConditions, TimePeriod.getCustom(1020));
    }
    new WaitUntil(new ServerHasState(this, resultState), timeout);
    waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
    new WaitWhile(new SystemJobIsRunning(new JobMatcher("Inspecting CDK environment")), TimePeriod.DEFAULT);
    log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'");
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ServerHasState(org.eclipse.reddeer.eclipse.condition.ServerHasState) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) JobMatcher(org.jboss.tools.cdk.reddeer.core.matcher.JobMatcher) TimePeriod(org.eclipse.reddeer.common.wait.TimePeriod) ServerState(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersViewEnums.ServerState) MultipleWaitConditionHandler(org.jboss.tools.cdk.reddeer.core.condition.MultipleWaitConditionHandler) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 4 with SystemJobIsRunning

use of org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning in project jbosstools-openshift by jbosstools.

the class CDKServerEditorAbstractTest method checkEditorStateAfterSave.

protected void checkEditorStateAfterSave(String location, boolean canSave) {
    LabeledText label = ((CDKPart) editor).getMinishiftBinaryLabel();
    label.setText(location);
    new WaitUntil(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.SHORT, false);
    new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.DEFAULT, false);
    if (canSave) {
        verifyEditorCanSave();
    } else {
        verifyEditorCannotSave();
    }
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CDKPart(org.jboss.tools.cdk.reddeer.server.ui.editor.CDKPart) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 5 with SystemJobIsRunning

use of org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning in project jbosstools-openshift by jbosstools.

the class CDKServerWizardAbstractTest method assertDiffMessage.

protected void assertDiffMessage(final NewMenuWizard dialog, final String message) {
    new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.DEFAULT, false);
    String description = dialog.getMessage();
    assertFalse("Page descrition should not contain: " + message, description.contains(message));
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile)

Aggregations

WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)9 SystemJobIsRunning (org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning)9 NewServerWizardPage (org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage)4 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 NewCDK32ServerWizardPage (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage)2 TimePeriod (org.eclipse.reddeer.common.wait.TimePeriod)1 ServerHasState (org.eclipse.reddeer.eclipse.condition.ServerHasState)1 ServerState (org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersViewEnums.ServerState)1 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)1 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)1 EditorIsDirty (org.eclipse.reddeer.workbench.condition.EditorIsDirty)1 WorkbenchLayerException (org.eclipse.reddeer.workbench.exception.WorkbenchLayerException)1 MultipleWaitConditionHandler (org.jboss.tools.cdk.reddeer.core.condition.MultipleWaitConditionHandler)1 JobMatcher (org.jboss.tools.cdk.reddeer.core.matcher.JobMatcher)1 CDK3ServerEditor (org.jboss.tools.cdk.reddeer.server.ui.editor.CDK3ServerEditor)1 CDKPart (org.jboss.tools.cdk.reddeer.server.ui.editor.CDKPart)1 NewCDK3ServerWizardPage (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK3ServerWizardPage)1 NewMinishiftServerWizardPage (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewMinishiftServerWizardPage)1