Search in sources :

Example 1 with Service

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));
}
Also used : ResourceIsUpdated(org.jboss.tools.openshift.reddeer.condition.ResourceIsUpdated) RequiredService(org.jboss.tools.openshift.reddeer.requirement.OpenShiftServiceRequirement.RequiredService) Service(org.jboss.tools.openshift.reddeer.view.resources.Service) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)

Example 2 with Service

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!");
    }
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) RequiredService(org.jboss.tools.openshift.reddeer.requirement.OpenShiftServiceRequirement.RequiredService) Service(org.jboss.tools.openshift.reddeer.view.resources.Service) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 3 with Service

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);
}
Also used : RequiredService(org.jboss.tools.openshift.reddeer.requirement.OpenShiftServiceRequirement.RequiredService) Service(org.jboss.tools.openshift.reddeer.view.resources.Service) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

RequiredService (org.jboss.tools.openshift.reddeer.requirement.OpenShiftServiceRequirement.RequiredService)3 Service (org.jboss.tools.openshift.reddeer.view.resources.Service)3 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)2 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)2 Test (org.junit.Test)2 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 ResourceIsUpdated (org.jboss.tools.openshift.reddeer.condition.ResourceIsUpdated)1 OpenshiftTestInFailureException (org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException)1