use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewMinishiftServerWizardPage in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method addNewMinishiftServer.
/**
* Creates new Minishift 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
*/
public static void addNewMinishiftServer(String serverAdapter, String hypervisor, String path, String profile) {
NewCDKServerWizard dialog = setupFirstNewServerWizardPage(MINISHIFT_SERVER_NAME, serverAdapter);
// set second new server dialog page
NewMinishiftServerWizardPage containerPage = new NewMinishiftServerWizardPage();
if (!StringUtils.isEmptyOrNull(hypervisor)) {
// $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);
// $NON-NLS-1$
log.info("Setting minishift profile to " + profile);
containerPage.setMinishiftProfile(profile);
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(TimePeriod.MEDIUM);
}
use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewMinishiftServerWizardPage in project jbosstools-openshift by jbosstools.
the class MinishiftServerWizardTest method testNewMinishiftServerWizard.
@Test
public void testNewMinishiftServerWizard() {
NewCDKServerWizard dialog = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
NewServerWizardPage page = new NewServerWizardPage(dialog);
page.selectType(SERVER_TYPE_GROUP, MINISHIFT_SERVER_NAME);
page.setName(getServerAdapter());
dialog.next();
NewMinishiftServerWizardPage containerPage = new NewMinishiftServerWizardPage();
checkWizardPagewidget("Minishift Binary: ", MINISHIFT_SERVER_NAME);
assertTrue(containerPage.getMinishiftProfile().getText().contains("minishift"));
// 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);
// check compatibility of cdk version with server adapter
containerPage.setMinishiftBinary(MOCK_CDK320);
assertSameMessage(dialog, NOT_COMPATIBLE);
// check compatibility of cdk version with server adapter
containerPage.setMinishiftBinary(MOCK_MINISHIFT131);
assertSameMessage(dialog, NOT_COMPATIBLE);
// Positive test of proper minishift binary
containerPage.setMinishiftBinary(MINISHIFT_PATH);
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();
}
use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewMinishiftServerWizardPage in project jbosstools-openshift by jbosstools.
the class MinishiftServerEditorTest method setupServerWizardPage.
@Override
protected void setupServerWizardPage(NewMenuWizard dialog) {
NewServerWizardPage page = new NewServerWizardPage(dialog);
page.selectType(SERVER_TYPE_GROUP, MINISHIFT_SERVER_NAME);
page.setName(SERVER_ADAPTER_MINISHIFT);
dialog.next();
NewMinishiftServerWizardPage containerPage = new NewMinishiftServerWizardPage();
log.info("Setting hypervisor to: " + hypervisor);
containerPage.setHypervisor(hypervisor);
log.info("Setting binary to " + MINISHIFT_PATH);
containerPage.setMinishiftBinary(MINISHIFT_PATH);
new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.MEDIUM, false);
}
Aggregations