Search in sources :

Example 6 with ConsoleHasNoChange

use of org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange in project linuxtools by eclipse.

the class DockerContainerTest method testRunDockerContainer.

@Test
public void testRunDockerContainer() {
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    assertTrue("Image has not been found!", imageIsDeployed(getCompleteImageName(IMAGE_NAME)));
    DockerExplorerView explorer = new DockerExplorerView();
    getConnection().getImage(getCompleteImageName(IMAGE_NAME)).run();
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(explorer);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.finish();
    if (mockitoIsUsed()) {
        MockUtils.runContainer(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST, CONTAINER_NAME);
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    new WaitWhile(new ConsoleHasNoChange());
    assertTrue("Container does not exists!", containerIsDeployed(CONTAINER_NAME));
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 7 with ConsoleHasNoChange

use of org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange in project linuxtools by eclipse.

the class ExposePortTest method runContainer.

private void runContainer(String imageName, String imageTag, String containerName, DockerImagesTab imagesTab) {
    imagesTab.runImage(imageName + ":" + imageTag);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(containerName);
    firstPage.setPublishAllExposedPorts(false);
    firstPage.finish();
    new WaitWhile(new JobIsRunning());
    new WaitWhile(new ConsoleHasNoChange());
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 8 with ConsoleHasNoChange

use of org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange in project linuxtools by eclipse.

the class AbstractImageBotTest method assertConsoleContains.

protected void assertConsoleContains(String text) {
    new WaitWhile(new ConsoleHasNoChange());
    ConsoleView consoleView = new ConsoleView();
    consoleView.open();
    if (mockitoIsUsed()) {
        consoleView = MockUtils.getConsoleViewText(text);
    }
    assertFalse("Console has no output!", consoleView.getConsoleText().isEmpty());
    assertTrue("Build has not been successful", consoleView.getConsoleText().contains(text));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 9 with ConsoleHasNoChange

use of org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange in project jbosstools-openshift by jbosstools.

the class LogsTest method shouldShowLogFromApplicationPodContextMenu.

@Test
public void shouldShowLogFromApplicationPodContextMenu() {
    new WaitUntil(new OpenShiftResourceExists(Resource.POD, new StringStartsWith("eap-app-"), ResourceState.RUNNING, requiredProject.getProjectName(), requiredConnection.getConnection()), TimePeriod.VERY_LONG);
    this.consoleView = new ConsoleView();
    this.consoleView.open();
    OpenShiftResource pod = OpenShiftUtils.getOpenShiftPod(requiredProject.getProjectName(), new StringStartsWith("eap-app-"), requiredConnection.getConnection());
    String podName = pod.getName();
    pod.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.POD_LOG).select();
    new WaitUntil(new ConsoleHasText(), TimePeriod.DEFAULT);
    new WaitUntil(new ConsoleHasNoChange(TimePeriod.getCustom(WAIT_CONSOLE_NO_CHANGE)), TimePeriod.VERY_LONG);
    assertTrue("Console label is incorrect, it should contains project name and pod name.\n" + "but label is: " + consoleView.getConsoleLabel(), consoleView.getConsoleLabel().contains(requiredProject.getProjectName() + "\\" + podName));
    assertTrue("Console text should contain output from EAP runtime", consoleView.getConsoleText().contains("Admin console is not enabled"));
}
Also used : StringStartsWith(org.hamcrest.core.StringStartsWith) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ConsoleHasText(org.eclipse.reddeer.eclipse.condition.ConsoleHasText) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange) 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 10 with ConsoleHasNoChange

use of org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange in project jbosstools-openshift by jbosstools.

the class LogsTest method shouldShowLogFromBuildPodContextMenu.

@Test
public void shouldShowLogFromBuildPodContextMenu() {
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, new StringStartsWith("eap-app-"), ResourceState.RUNNING, requiredProject.getProjectName(), requiredConnection.getConnection()), TimePeriod.VERY_LONG);
    this.consoleView = new ConsoleView();
    this.consoleView.open();
    OpenShiftResource pod = OpenShiftUtils.getOpenShiftPod(requiredProject.getProjectName(), Resource.BUILD, new StringStartsWith("eap-app-"), requiredConnection.getConnection());
    String podName = pod.getName();
    pod.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.BUILD_LOG).select();
    new WaitUntil(new ConsoleHasText(), TimePeriod.LONG);
    new WaitUntil(new ConsoleHasNoChange(TimePeriod.getCustom(WAIT_CONSOLE_NO_CHANGE)), TimePeriod.VERY_LONG);
    assertTrue("Console label is incorrect, it should contain project name and name of build pod.\n" + "but label is: " + consoleView.getConsoleLabel(), consoleView.getConsoleLabel().contains(requiredProject.getProjectName() + "\\" + podName));
    try {
        new WaitUntil(new ConsoleHasText("Push successful"), TimePeriod.getCustom(WAIT_CONSOLE_PUSH_SUCCESS));
    } catch (WaitTimeoutExpiredException ex) {
        fail("There should be output of succesful build in console log, but there is not.\n" + "Check whether output has not changed. Assumed output in the end of log is 'Push successful'");
    }
}
Also used : StringStartsWith(org.hamcrest.core.StringStartsWith) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ConsoleHasText(org.eclipse.reddeer.eclipse.condition.ConsoleHasText) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange) 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)

Aggregations

ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)10 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)6 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 ConsoleView (org.eclipse.reddeer.eclipse.ui.console.ConsoleView)5 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)4 Test (org.junit.Test)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)2 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)2 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)2 ConsoleHasText (org.eclipse.reddeer.eclipse.condition.ConsoleHasText)2 StringStartsWith (org.hamcrest.core.StringStartsWith)2 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)2 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)2 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)2 File (java.io.File)1 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)1 DockerExplorerView (org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView)1 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1