Search in sources :

Example 1 with DockerTerminal

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal in project linuxtools by eclipse.

the class ContainerLogTest method getContainerLog.

private String getContainerLog() {
    new ContextMenu().getItem("Display Log").select();
    String consoleText;
    if (mockitoIsUsed()) {
        ConsoleView consoleView = new ConsoleView();
        consoleView.open();
        consoleView = MockUtils.getConsoleViewText(CONSOLE_TEXT);
        consoleText = consoleView.getConsoleText();
    } else {
        DockerTerminal dockerTerminal = new DockerTerminal();
        dockerTerminal.activate();
        consoleText = dockerTerminal.getTextFromPage(CONTAINER_NAME);
    }
    return consoleText;
}
Also used : ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) DockerTerminal(org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu)

Example 2 with DockerTerminal

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal in project linuxtools by eclipse.

the class ContainerLogTest method cleanDockerTerminal.

private void cleanDockerTerminal() {
    if (!mockitoIsUsed()) {
        DockerTerminal dockerTerminal = new DockerTerminal();
        dockerTerminal.activate();
        CTabItem tabItem = dockerTerminal.getPage(CONTAINER_NAME);
        tabItem.close();
        dockerTerminal.close();
    }
}
Also used : DockerTerminal(org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal) CTabItem(org.eclipse.reddeer.swt.api.CTabItem)

Example 3 with DockerTerminal

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal in project linuxtools by eclipse.

the class LinkContainersTest method runAlpineLinux.

public void runAlpineLinux(String imageName, String containerName) {
    String serverAddress = getHttpServerAddress(CONTAINER_NAME_HTTP_SERVER);
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(imageName);
    ImageRunSelectionPage firstPage = openImageRunSelectionPage(containerName, false, imagesTab);
    firstPage.setContainerName(containerName);
    firstPage.setCommand(serverAddress + ":80");
    firstPage.addLinkToContainer(CONTAINER_NAME_HTTP_SERVER, "http_server");
    firstPage.setPublishAllExposedPorts(false);
    firstPage.setAllocatePseudoTTY();
    firstPage.setKeepSTDINOpen();
    firstPage.finish();
    new WaitWhile(new JobIsRunning());
    DockerTerminal dt = new DockerTerminal();
    dt.open();
    if (mockitoIsUsed()) {
        mockServerContainer();
        dt = MockDockerTerminal.setText("text").build();
    }
    String terminalText = dt.getTextFromPage("/" + containerName);
    assertTrue("No output from terminal!", !terminalText.isEmpty());
    assertTrue("Containers are not linked!", !terminalText.contains("Connection refused"));
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) MockDockerTerminal(org.eclipse.linuxtools.docker.integration.tests.mock.MockDockerTerminal) DockerTerminal(org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Aggregations

DockerTerminal (org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal)3 MockDockerTerminal (org.eclipse.linuxtools.docker.integration.tests.mock.MockDockerTerminal)1 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)1 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 ConsoleView (org.eclipse.reddeer.eclipse.ui.console.ConsoleView)1 CTabItem (org.eclipse.reddeer.swt.api.CTabItem)1 ContextMenu (org.eclipse.reddeer.swt.impl.menu.ContextMenu)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1