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;
}
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();
}
}
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"));
}
Aggregations