use of org.jboss.tools.openshift.reddeer.view.resources.Service 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.Service in project jbosstools-openshift by jbosstools.
the class OSExplorerResourceTest method testDeploymentConfigVisibleAfterServiceDeletion.
/**
* Test if deployment config is visible in OS Explorer, when there is no service.
*/
@Test(expected = OpenshiftTestInFailureException.class)
public void testDeploymentConfigVisibleAfterServiceDeletion() {
this.project.expand();
Service service = this.project.getService(OpenShiftResources.EAP_SERVICE);
assertTrue("Service does not exist!", service != null);
service.select();
new ContextMenuItem("Delete").select();
new DefaultShell("Delete OpenShift Resource");
new OkButton().click();
// assert service is deleted
List<OpenShiftResource> resources = this.project.getOpenShiftResources(Resource.SERVICE);
assertTrue("Service not deleted!", resources.isEmpty());
try {
this.project.getTreeItem().getItem("eap-app selector: deploymentConfig=eap-app");
} catch (CoreLayerException e) {
// TODO: do not throw after JBIDE-24217 is fixed
throw new OpenshiftTestInFailureException("JBIDE-24217");
// TODO: uncomment after JBIDE-24217 is fixed
// fail("Deployment config not visible!");
}
}
use of org.jboss.tools.openshift.reddeer.view.resources.Service in project jbosstools-openshift by jbosstools.
the class ScalingTest method testScaleApplicationViaContextMenuOfService.
@Test
public void testScaleApplicationViaContextMenuOfService() {
Service service = project.getService(OpenShiftResources.NODEJS_SERVICE);
assertNotNull(service);
// ensure we scale
int pods = PodsAreDeployed.getNumberOfCurrentReplicas(project, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER);
if (pods == 1) {
pods = 2;
} else {
pods = 1;
}
service.select();
scaleTo(pods);
assertPodAmountDesiredEqualsCurrent(pods, project);
service.select();
scaleUp();
assertPodAmountDesiredEqualsCurrent(++pods, project);
service.select();
scaleDown();
assertPodAmountDesiredEqualsCurrent(--pods, project);
}
Aggregations