use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource in project jbosstools-openshift by jbosstools.
the class EditResourceLimitsTest method testViaContextMenuOfService.
public void testViaContextMenuOfService(int index, String defaultSuffix) {
Service service = project.getService(OpenShiftResources.NODEJS_SERVICE);
assertNotNull(service);
OpenShiftResource deploymentConfig = project.getOpenShiftResource(Resource.DEPLOYMENT_CONFIG, OpenShiftResources.NODEJS_APP_DEPLOYMENT_CONFIG);
assertNotNull(deploymentConfig);
String version = deploymentConfig.getPropertyValue("Basic", "Resource Version");
service.select();
incrementLimits(index, defaultSuffix);
new WaitUntil(new ResourceIsUpdated(project.getName(), Resource.DEPLOYMENT_CONFIG, OpenShiftResources.NODEJS_APP_DEPLOYMENT_CONFIG, new String[] { "Basic", "Resource Version" }, not(version), requiredConnection.getConnection()), TimePeriod.getCustom(800));
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource in project jbosstools-openshift by jbosstools.
the class DeleteResourceTest method testDeletePod.
@Test
public void testDeletePod() {
OpenShiftResource applicationPod = OpenShiftUtils.getOpenShiftPod(projectReq.getProjectName(), new StringStartsWith("eap-app-"), connectionReq.getConnection());
String podName = applicationPod.getName();
applicationPod.delete();
try {
OpenShiftResourceExists openShiftResourceExists = new OpenShiftResourceExists(Resource.POD, podName, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection());
new WaitWhile(openShiftResourceExists, TimePeriod.getCustom(15));
} catch (WaitTimeoutExpiredException ex) {
fail("Application pod should be deleted at this point, but it it still present.");
}
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource in project jbosstools-openshift by jbosstools.
the class ApplicationPodIsRunning method test.
@Override
public boolean test() {
project.refresh();
List<OpenShiftResource> pods = project.getOpenShiftResources(Resource.POD);
if (pods.isEmpty()) {
return false;
}
// for
for (OpenShiftResource resource : pods) {
if (!resource.getName().contains("build") && !resource.getName().contains("deploy")) {
if (resource.getStatus().equals(ResourceState.RUNNING.toString())) {
applicationPodName = resource.getName();
return true;
}
}
}
return false;
}
use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource 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.OpenShiftResource in project jbosstools-openshift by jbosstools.
the class ScalingTest method scaleTo0ShouldWarn.
@Test
public void scaleTo0ShouldWarn() {
int pods = requiredService.getReplicationController().getCurrentReplicaCount();
new WaitUntil(new PodsAreDeployed(project, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, pods), TimePeriod.LONG);
OpenShiftResource replicationController = project.getOpenShiftResource(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER);
replicationController.select();
scaleTo(0);
new DefaultShell(OpenShiftLabel.Shell.STOP_ALL_DEPLOYMENTS).setFocus();
new YesButton().click();
assertPodAmountDesiredEqualsCurrent(0, project);
}
Aggregations