use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject in project jbosstools-openshift by jbosstools.
the class PublishChangesTest method waitForRunningApplication.
@BeforeClass
public static void waitForRunningApplication() {
new ProjectExplorer().deleteAllProjects(true);
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.COMPLETE, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(1000));
OpenShiftExplorerView openShiftExplorerView = new OpenShiftExplorerView();
OpenShiftProject project = openShiftExplorerView.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName());
new WaitUntil(new ApplicationPodIsRunning(project), TimePeriod.LONG);
cloneGitRepoAndImportProject();
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject in project jbosstools-openshift by jbosstools.
the class OpenShiftUtils method deleteAllProjects.
public static void deleteAllProjects(Connection connection) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.getOpenShift3Connection(connection).refresh();
new WaitWhile(new JobIsRunning());
List<OpenShiftProject> projects = explorer.getOpenShift3Connection(connection).getAllProjects();
for (OpenShiftProject project : projects) {
if (project != null) {
String projectName = project.getName();
try {
project.delete();
new WaitWhile(new OpenShiftProjectExists(projectName, connection), TimePeriod.LONG);
} catch (CoreLayerException ex) {
// project does not exist - project has been deleted but view has not been
// refreshed
explorer.getOpenShift3Connection(connection).refresh();
}
}
}
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject in project jbosstools-openshift by jbosstools.
the class CreateApplicationOnBuilderImageTest method testCreateApplicationBasedOnBuilderImage.
@Test
public void testCreateApplicationBasedOnBuilderImage() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer();
BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage();
applicationName = new LabeledText("Name: ").getText();
new WaitUntil(new ControlIsEnabled(new FinishButton()));
new FinishButton().click();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY));
CreateApplicationFromTemplateTest.importApplicationAndVerify(projectName);
OpenShiftProject project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject();
project.refresh();
new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120));
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, connectionReq.getConnection()), TimePeriod.LONG, false);
List<OpenShiftResource> buildConfig = project.getOpenShiftResources(Resource.BUILD_CONFIG);
assertTrue("There should be precisely 1 build config for created application, but there is following amount" + " of build configs: " + buildConfig.size(), buildConfig.size() == 1);
List<OpenShiftResource> imageStream = project.getOpenShiftResources(Resource.IMAGE_STREAM);
assertTrue("There should be precisely 1 image stream for created application, but there is following amount" + " of image streams: " + imageStream.size(), imageStream.size() == 1);
List<OpenShiftResource> routes = project.getOpenShiftResources(Resource.ROUTE);
assertTrue("There should be precisely 1 route for created application, but there is following amount" + " of routes:" + routes.size(), routes.size() == 1);
assertTrue("Generated (default) route should contain application name, but it's not contained.", routes.get(0).getName().equals(applicationName));
List<OpenShiftResource> services = project.getOpenShiftResources(Resource.SERVICE);
assertTrue("There should be precisely 1 service for created application, but there is following amount" + " of services: " + services.size(), services.size() == 1);
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject in project jbosstools-openshift by jbosstools.
the class ResourcesTest method verifyResourceExistence.
private void verifyResourceExistence(TreeItem projectItem, Resource resource) {
try {
OpenShiftProject project = new OpenShiftProject(projectItem);
project.select();
project.openProperties();
project.selectTabbedProperty(resource.toString());
} catch (RedDeerException ex) {
fail("Resource " + resource.toString() + " does not exist under a specified project item.");
}
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject in project jbosstools-openshift by jbosstools.
the class InteligentDeleteResourceTest method checkDeletedResourceBoolean.
private boolean checkDeletedResourceBoolean(ResourceOpenShift resource) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
OpenShiftProject openshiftProject = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName());
openshiftProject.refresh();
DeleteResourcesWizard deleteResourcesWizard = new DeleteResourcesWizard(connectionReq.getConnection());
deleteResourcesWizard.openWizardFromExplorer(projectReq.getProjectName());
List<TableItem> items = deleteResourcesWizard.getResourcesByType(resource);
deleteResourcesWizard.cancel();
return items.isEmpty();
}
Aggregations