Search in sources :

Example 1 with ConsoleHasNoChange

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

the class LinkContainersTest method runUhttpServer.

public void runUhttpServer(String imageName, String containerName) {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(imageName);
    ImageRunSelectionPage firstPage = openImageRunSelectionPage(containerName, false, imagesTab);
    firstPage.setContainerName(containerName);
    firstPage.setPublishAllExposedPorts(false);
    firstPage.finish();
    if (mockitoIsUsed()) {
        mockServerContainer();
        new WaitUntil(new ContainerIsDeployedCondition(containerName, getConnection()));
    } else {
        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) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 2 with ConsoleHasNoChange

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

the class VolumeMountTest method testVolumeMount.

@Test
public void testVolumeMount() throws IOException {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(IMAGE_UHTTPD + ":" + IMAGE_TAG_LATEST);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.setPublishAllExposedPorts(true);
    firstPage.next();
    ImageRunResourceVolumesVariablesPage secondPage = new ImageRunResourceVolumesVariablesPage(firstPage);
    String volumePath = (new File(VOLUME_PATH)).getCanonicalPath();
    secondPage.addDataVolumeToHost(CONTAINER_PATH, volumePath);
    secondPage.finish();
    new WaitWhile(new JobIsRunning());
    if (!mockitoIsUsed()) {
        new WaitWhile(new ConsoleHasNoChange());
    } else {
        runServer();
        new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
    }
    String indexPage = getIndexPageContent();
    String indexPageResource = getResourceAsString(INDEX_PAGE_PATH);
    assertEquals(INDEX_PAGE_PATH + " wasnt mounted/displayed properly.", indexPage, indexPageResource);
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) ImageRunResourceVolumesVariablesPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) File(java.io.File) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest) Test(org.junit.Test)

Example 3 with ConsoleHasNoChange

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

the class ComposeTest method runDockerCompose.

private void runDockerCompose(String project, String projectFile) {
    PackageExplorerPart pe = new PackageExplorerPart();
    pe.open();
    pe.getProject(project).getProjectItem(projectFile).select();
    @SuppressWarnings("unchecked") ContextMenuItem contextMenu = new ContextMenuItem(new WithTextMatcher("Run As"), new RegexMatcher(".*Docker Compose"));
    contextMenu.select();
    new OkButton().click();
    try {
        new DefaultShell("Docker Compose");
        new PushButton("Apply and Close").click();
        fail("Docker Compose has not been found! Is it installed and the path is correct?");
    } catch (CoreLayerException ex) {
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    new WaitWhile(new ConsoleHasNoChange());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 4 with ConsoleHasNoChange

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

the class PublishChangesTest method changeProjectAndVerifyAutoPublish.

private void changeProjectAndVerifyAutoPublish() {
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    projectExplorer.getProject(PROJECT_NAME).select();
    ProjectItem projectItem = projectExplorer.getProject(PROJECT_NAME).getProjectItem("Java Resources", "src/main/java", "org.jboss.as.quickstarts.helloworld", "HelloService.java");
    projectItem.select();
    projectItem.open();
    TextEditor textEditor = new TextEditor("HelloService.java");
    textEditor.setText(PUBLISHED_CODE);
    textEditor.close(true);
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    new WaitUntil(new ConsoleHasNoChange(), TimePeriod.VERY_LONG);
    assertTrue("Local changes performed to project have not been autopublished, or at least rsync " + "output in console view does not contain information about sending incremental list of changes," + "specifically with changed class " + changedClass, new ConsoleView().getConsoleText().contains(changedClass));
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ProjectItem(org.eclipse.reddeer.eclipse.core.resources.ProjectItem) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 5 with ConsoleHasNoChange

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

the class CDKServerAdapterAbstractTest method collectConsoleOutput.

/**
 * Prints out console output via logger and returns console content
 *
 * @param log reference to logger
 * @param onFail if true then error log method is used, debug otherwise
 * @return returns console output
 */
public String collectConsoleOutput(Logger log, boolean onFail) {
    String consoleOutput = "Console is empty...";
    ConsoleView view = new ConsoleView();
    view.open();
    if (view.getConsoleText() != null) {
        new WaitWhile(new ConsoleHasNoChange(), TimePeriod.DEFAULT, false);
        consoleOutput = view.getConsoleLabel() + "\n\r" + view.getConsoleText();
        if (onFail) {
            log.info("Loggin console, called from test failure");
            log.error(consoleOutput);
        } else {
            log.info("Logging console for debugging purposes");
            log.debug(consoleOutput);
        }
    }
    return consoleOutput;
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

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