Search in sources :

Example 1 with NewCDK32ServerWizardPage

use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage 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 NewCDK32ServerWizardPage

use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage in project jbosstools-openshift by jbosstools.

the class CDKServerAdapterAbstractTest method addNewCDK32Server.

/**
 * Creates new CDK 3.2+ server adapter via ServersView -> New -> Server
 *
 * @param serverAdapter server adapter name
 * @param hypervisor hypervisor to use
 * @param path path to minishift binary file
 * @param profile what profile to use
 * @param username redhat developers username
 * @param password user password
 */
public static void addNewCDK32Server(String serverAdapter, String hypervisor, String path, String profile, String username, String password) {
    NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK32_SERVER_NAME, serverAdapter);
    // set second new server dialog page
    NewCDK32ServerWizardPage containerPage = new NewCDK32ServerWizardPage();
    containerPage.setCredentials(username, password);
    if (hypervisor != null && !hypervisor.isEmpty()) {
        // $NON-NLS-1$
        log.info("Setting hypervisor to " + hypervisor);
        containerPage.setHypervisor(hypervisor);
    }
    // $NON-NLS-1$
    log.info("Setting minishift binary file folder to " + path);
    containerPage.setMinishiftBinary(path);
    if (!profile.isEmpty()) {
        // $NON-NLS-1$
        log.info("Setting minishift profile to " + profile);
        containerPage.setMinishiftProfile(profile);
    } else {
        log.info("Keeping minishift profile default: " + containerPage.getMinishiftProfile());
    }
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
    // $NON-NLS-1$
    log.info("Finishing Add new server dialog");
    if (!(new FinishButton().isEnabled())) {
        // $NON-NLS-1$
        log.error("Finish button was not enabled");
    }
    dialog.finish();
}
Also used : NewCDK32ServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 3 with NewCDK32ServerWizardPage

use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage in project jbosstools-openshift by jbosstools.

the class CDK32ServerWizardTest method testNewCDK32ServerWizard.

@Test
public void testNewCDK32ServerWizard() {
    NewCDKServerWizard dialog = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
    NewServerWizardPage page = new NewServerWizardPage(dialog);
    page.selectType(SERVER_TYPE_GROUP, CDK32_SERVER_NAME);
    page.setName(getServerAdapter());
    dialog.next();
    NewCDK32ServerWizardPage containerPage = new NewCDK32ServerWizardPage();
    checkWizardPagewidget("Minishift Binary: ", CDK32_SERVER_NAME);
    // just check that default domain is choosen correctly
    assertTrue(containerPage.getDomain().equalsIgnoreCase(CREDENTIALS_DOMAIN));
    assertTrue(containerPage.getMinishiftProfile().getText().equals("minishift"));
    // needs to activate validator
    containerPage.setMinishiftBinary(EXISTING_PATH);
    // first the credentials are checked
    assertSameMessage(dialog, NO_USER);
    containerPage.setCredentials(USERNAME, PASSWORD);
    assertDiffMessage(dialog, NO_USER);
    // checking of minishift binary validation
    // test that existing folder cannot be run
    containerPage.setMinishiftBinary(EXISTING_PATH);
    assertSameMessage(dialog, CANNOT_RUN_PROGRAM);
    containerPage.setMinishiftBinary(NON_EXECUTABLE_FILE);
    assertSameMessage(dialog, NOT_EXECUTABLE);
    containerPage.setMinishiftBinary(NON_EXISTING_PATH);
    assertSameMessage(dialog, DOES_NOT_EXIST);
    containerPage.setMinishiftBinary(EXECUTABLE_FILE);
    assertSameMessage(dialog, CHECK_MINISHIFT_VERSION);
    // check compatibility of cdk version with server adapter
    containerPage.setMinishiftBinary(MOCK_CDK311);
    assertSameMessage(dialog, NOT_COMPATIBLE);
    // Positive test of proper minishift binary
    containerPage.setMinishiftBinary(CDK32_MINISHIFT);
    assertDiffMessage(dialog, CHECK_MINISHIFT_VERSION);
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
    assertTrue("Expected Finish button is not enabled", dialog.isFinishEnabled());
    dialog.cancel();
}
Also used : NewCDK32ServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) NewServerWizardPage(org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage) Test(org.junit.Test)

Example 4 with NewCDK32ServerWizardPage

use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage in project jbosstools-openshift by jbosstools.

the class CDK32ServerEditorTest 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)

Aggregations

NewCDK32ServerWizardPage (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage)4 NewServerWizardPage (org.eclipse.reddeer.eclipse.wst.server.ui.wizard.NewServerWizardPage)3 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2 SystemJobIsRunning (org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning)2 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)2 Test (org.junit.Test)1