Search in sources :

Example 51 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class ResourcesTest method testResourcesExistence.

@Test
public void testResourcesExistence() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    OpenShiftProject project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(DatastoreOS3.TEST_PROJECT);
    project.expand();
    TreeItem projectItem = project.getTreeItem();
    verifyResourceExistence(projectItem, Resource.BUILD_CONFIG);
    verifyResourceExistence(projectItem, Resource.BUILD);
    verifyResourceExistence(projectItem, Resource.DEPLOYMENT_CONFIG);
    verifyResourceExistence(projectItem, Resource.IMAGE_STREAM);
    verifyResourceExistence(projectItem, Resource.POD);
    verifyResourceExistence(projectItem, Resource.ROUTE);
    verifyResourceExistence(projectItem, Resource.SERVICE);
}
Also used : OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 52 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class ServerAdapterFromResourceTest method importProject.

@BeforeClass
public static void importProject() {
    explorer = new OpenShiftExplorerView();
    explorer.open();
    project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(DatastoreOS3.TEST_PROJECT);
    project.getServicesWithName(OpenShiftResources.NODEJS_SERVICE).get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    ImportApplicationWizard appWizard = new ImportApplicationWizard();
    try {
        CheckBox checkBox = new CheckBox("Do not clone - use existing repository");
        if (checkBox.isEnabled()) {
            checkBox.toggle(true);
            LOGGER.debug("Using existing project, skipping import");
        }
    } catch (RedDeerException ex) {
        LOGGER.debug("No existing project found, importing");
    }
    try {
        appWizard.finish();
    } catch (WaitTimeoutExpiredException ex) {
        // When running test in suite, it needs to be selected correct build config(in OpenShift instance could be more build configs)
        appWizard.selectExistingBuildConfiguration(OpenShiftResources.NODEJS_APP_DEPLOYMENT_CONFIG);
        appWizard.finish();
    }
    new WaitUntil(new OpenShiftResourceExists(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, ResourceState.UNSPECIFIED, DatastoreOS3.TEST_PROJECT, connectionReq.getConnection()), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) BeforeClass(org.junit.BeforeClass)

Example 53 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class PublishChangesTest method createServerAdapter.

private void createServerAdapter() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getServicesWithName("eap-app").get(0).createServerAdapter();
}
Also used : OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 54 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class CreateResourcesTest method refreshProject.

private void refreshProject() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(testProject).refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 55 with OpenShiftExplorerView

use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.

the class DeleteResourceTest method deleteResourceAndAssert.

private void deleteResourceAndAssert(Resource resource) {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    OpenShiftResource rsrc = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(resource).get(0);
    String resourceName = rsrc.getName();
    rsrc.delete();
    try {
        OpenShiftResourceExists openShiftResourceExists = new OpenShiftResourceExists(resource, resourceName, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection());
        new WaitWhile(openShiftResourceExists, TimePeriod.getCustom(15));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Route " + resource + " should be deleted at this point but it is still present.");
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)

Aggregations

OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)59 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)22 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)19 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)19 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)19 Test (org.junit.Test)18 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)17 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)17 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)16 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)13 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)11 OpenShiftProject (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject)11 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)10 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)9 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)8 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)7 Before (org.junit.Before)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)4 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)4