Search in sources :

Example 16 with OpenShiftResource

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

the class OpenShiftUtils method getOpenShiftPod.

public static OpenShiftResource getOpenShiftPod(String projectName, Resource resource, Matcher<String> matcher, Connection connection) {
    assertTrue(!StringUtils.isBlank(projectName));
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    List<OpenShiftResource> pods = explorer.getOpenShift3Connection(connection).getProject(projectName).getOpenShiftResources(resource);
    for (OpenShiftResource pod : pods) {
        if (matcher.matches(pod.getName())) {
            return pod;
        }
    }
    fail("Pod with matcher:" + matcher.toString() + " for project " + projectName + " was not found");
    return null;
}
Also used : OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)

Aggregations

OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)16 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)9 Test (org.junit.Test)9 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)8 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)7 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)7 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)6 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)5 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)4 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)3 Matcher (org.hamcrest.Matcher)3 StringStartsWith (org.hamcrest.core.StringStartsWith)3 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)2 ConsoleHasText (org.eclipse.reddeer.eclipse.condition.ConsoleHasText)2 ConsoleView (org.eclipse.reddeer.eclipse.ui.console.ConsoleView)2 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)2