use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class ConnectionWizardHandlingTest method openConnectionShell.
@Before
public void openConnectionShell() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.openConnectionShell();
new DefaultShell(OpenShiftLabel.Shell.NEW_CONNECTION);
}
use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class OpenShiftServiceRequirement method cleanUp.
@Override
public void cleanUp() {
if (serviceSpec.cleanup()) {
String projectName = TestUtils.getValueOrDefault(serviceSpec.project(), DatastoreOS3.TEST_PROJECT);
final IProject project = OpenShift3NativeResourceUtils.getProject(projectName, connection);
IProjectTemplateProcessing capability = project.getCapability(IProjectTemplateProcessing.class);
ITemplate processed = capability.process(template);
for (IResource resource : processed.getObjects()) {
IResource res = connection.getResource(resource.getKind(), projectName, resource.getName());
try {
connection.deleteResource(res);
} catch (OpenShiftException ex) {
LOGGER.error("Unable to remove " + res.getKind() + " named " + res.getName());
LOGGER.error(StackTraceUtils.stackTraceToString(ex));
}
}
cleanResources(connection, ResourceKind.BUILD, project, template);
cleanResources(connection, ResourceKind.REPLICATION_CONTROLLER, project, template);
cleanResources(connection, ResourceKind.POD, project, template);
new WaitWhile(new AbstractWaitCondition() {
@Override
public boolean test() {
for (IResource resource : project.getResources(ResourceKind.POD)) {
if (resource.getName().startsWith(template.getName())) {
return true;
}
}
return false;
}
@Override
public String description() {
return "at least one application pod is running";
}
}, TimePeriod.LONG);
new OpenShiftExplorerView().getOpenShift3Connection(connection).refresh();
}
}
use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class DeploymentTest method testDeploymentOfApplicationCreatedFromTemplate.
@Test
public void testDeploymentOfApplicationCreatedFromTemplate() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.DEFAULT, false);
try {
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.COMPLETE, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(600), true);
} catch (WaitTimeoutExpiredException ex) {
fail("There should be a successful build of an application, but there is not.");
}
try {
new WaitUntil(new AmountOfResourcesExists(Resource.POD, 2, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(60), true);
} catch (WaitTimeoutExpiredException ex) {
fail("There should be precisely 2 pods. One of the build and one of an running application.");
}
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.ROUTE).get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_WEB_BROWSER).select();
try {
new WaitUntil(new BrowserContainsText("Hello World!"), TimePeriod.VERY_LONG);
new BrowserEditor("helloworld").close();
} catch (WaitTimeoutExpiredException ex) {
fail("Application was not deployed successfully because it is not shown in web browser properly.\n" + ex.getMessage());
}
}
use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView 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.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromTemplateTest method tearDown.
@After
public void tearDown() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
deleteProject(kitchensinkProject);
deleteProject(helloworldProject);
cleanReq.fulfill();
WorkbenchShellHandler.getInstance().closeAllNonWorbenchShells();
}
Aggregations