use of org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection in project jbosstools-openshift by jbosstools.
the class ImportApplicationBase method init.
@BeforeClass
public static void init() {
OpenShiftExplorerView openshiftExplorer = new OpenShiftExplorerView();
openshiftExplorer.open();
OpenShift3Connection connection = openshiftExplorer.getOpenShift3Connection(requiredConnection.getConnection());
project = connection.getProject(requiredProject.getProjectName());
project.expand();
project.refresh();
service = (project.getServicesWithName(requiredService.getService().getName())).get(0);
assertNotNull("OpenShift service '" + OpenShiftResources.NODEJS_SERVICE + "' was not found!", service);
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection in project jbosstools-openshift by jbosstools.
the class CreateApplicationOnBuilderImageTest method tearDown.
@After
public void tearDown() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.getProject().delete();
ProjectExplorer projectExplorer = new ProjectExplorer();
if (projectExplorer.containsProject(projectName)) {
projectExplorer.getProject(projectName).delete();
}
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method testOpenshiftConnection.
/**
* Tests Openshift 3 connection and try to refresh it
*
* @param connection
*/
public void testOpenshiftConnection(String server, String username) {
OpenShift3Connection connection = null;
try {
connection = findOpenShiftConnection(server, username);
} catch (OpenShiftToolsException toolsExc) {
fail(toolsExc.getMessage());
}
// usually, when server adapter is not started, openshift connection after refresh should cause
// problem occurred dialog
connection.refresh();
try {
// $NON-NLS-1$
new WaitUntil(new ShellIsAvailable("Problem occurred"), TimePeriod.getCustom(30));
CDKUtils.captureScreenshot("CDKServerAdapterAbstractTest#testOpenshiftConnection");
new DefaultShell("Problem occurred").close();
// $NON-NLS-1$
fail("Problem dialog occured when refreshing OpenShift connection");
} catch (WaitTimeoutExpiredException ex) {
// no dialog appeared, which is ok
// $NON-NLS-1$
log.info("Expected WaitTimeoutExpiredException occured");
}
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection in project jbosstools-openshift by jbosstools.
the class DeleteProjectTest method testDeleteProjectViaManageProjectsShell.
@Test
public void testDeleteProjectViaManageProjectsShell() {
projectExists = true;
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_OS_PROJECTS).select();
new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS);
new DefaultTable().getItem(PROJECT_NAME).select();
new PushButton(OpenShiftLabel.Button.REMOVE).click();
new DefaultShell(OpenShiftLabel.Shell.DELETE_RESOURCE);
new OkButton().click();
projectExists = false;
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_OS_PROJECT), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ControlIsEnabled(new PushButton("Refresh...")), TimePeriod.DEFAULT);
new PushButton("Refresh...").click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ProjectDoesNotExistInManageOSProject(new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), PROJECT_NAME), TimePeriod.LONG);
assertFalse("There should not be present project in the table.", new DefaultTable().containsItem(PROJECT_NAME));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), TimePeriod.LONG);
assertFalse("Project is still presented in OpenShift explorer under a connection.", connection.projectExists(PROJECT_NAME));
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection in project jbosstools-openshift by jbosstools.
the class ConnectionPropertiesTest method testConnectionProperties.
@Test
public void testConnectionProperties() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.PROPERTIES).select();
PropertySheet propertiesView = new PropertySheet();
propertiesView.activate();
assertEquals("Property host is not valid. Was '" + propertiesView.getProperty(PROPERTY_HOST).getPropertyValue() + "' but was expected '" + DatastoreOS3.SERVER + "'", DatastoreOS3.SERVER, propertiesView.getProperty(PROPERTY_HOST).getPropertyValue());
if (DatastoreOS3.AUTH_METHOD.equals(AuthenticationMethod.BASIC)) {
assertEquals("Property user name is not valid. Was '" + propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue() + "' but was expected '" + DatastoreOS3.USERNAME + "'", DatastoreOS3.USERNAME, propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue());
} else {
assertEquals("Property user name is not valid. Was '" + propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue() + "' but was expected '" + connectionReq.getConnection().getUsername() + "'", connectionReq.getConnection().getUsername(), propertiesView.getProperty(PROPERTY_USERNAME).getPropertyValue());
}
}
Aggregations