use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard 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.NewCDKServerWizard in project jbosstools-openshift by jbosstools.
the class CDKServerEditorAbstractTest method addCDKServer.
public void addCDKServer() {
NewCDKServerWizard dialog = CDKTestUtils.openNewServerWizardDialog();
try {
setupServerWizardPage(dialog);
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
dialog.finish(TimePeriod.MEDIUM);
} catch (RedDeerException coreExc) {
new CancelButton().click();
throw new CDKServerException("Exception occured in CDK server wizard, wizard was canceled", coreExc);
}
}
use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard 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();
}
use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method setupFirstNewServerWizardPage.
private static NewCDKServerWizard setupFirstNewServerWizardPage(String serverName, String serverAdapter) {
NewCDKServerWizard dialog = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
NewServerWizardPage page = new NewServerWizardPage(dialog);
// set first dialog page
page.selectType(SERVER_TYPE_GROUP, serverName);
page.setHostName(SERVER_HOST);
page.setName(serverAdapter);
dialog.next();
return dialog;
}
use of org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method addNewCDK3Server.
/**
* Creates new CDK 3.x server adapter via ServersView -> New -> Server
*
* @param serverAdapter server adapter name
* @param hypervisor hypervisor to use
* @param path path to minishift binary file
*/
public static void addNewCDK3Server(String serverAdapter, String hypervisor, String path) {
NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK3_SERVER_NAME, serverAdapter);
// set second new server dialog page
NewCDK3ServerWizardPage containerPage = new NewCDK3ServerWizardPage();
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);
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();
}
Aggregations