Search in sources :

Example 6 with DockerImagesTab

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

the class AbstractImageBotTest method removeTagFromImage.

protected void removeTagFromImage(String imageName, String imageTagToRemove) {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.activate();
    if (mockitoIsUsed()) {
        MockUtils.pullImage(DEFAULT_CONNECTION_NAME, imageName, IMAGE_TAG_LATEST);
    } else {
        imagesTab.removeTagFromImage(imageName, imageTagToRemove);
    }
}
Also used : DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)

Example 7 with DockerImagesTab

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

the class BuildImageTest method testBuildImage.

@Test
public void testBuildImage() {
    getConnection();
    DockerImagesTab imageTab = openDockerImagesTab();
    buildImage(IMAGE_TEST_BUILD, DOCKERFILE_FOLDER, imageTab);
    assertConsoleSuccess();
}
Also used : DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) Test(org.junit.Test)

Example 8 with DockerImagesTab

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

the class EditDockerFileTest method testEditDockerFile.

@Test
public void testEditDockerFile() {
    getConnection();
    DockerImagesTab imageTab = openDockerImagesTab();
    try {
        String dockerFilePath = new File(EDIT_DOCKERFILE_FOLDER).getCanonicalPath();
        getConnection();
        imageTab.activate();
        new DefaultToolItem("Build Image").click();
        new WaitUntil(new ShellIsAvailable("Build a Docker Image"));
        new LabeledText("Image Name:").setText(IMAGE_NAME);
        new LabeledText("Directory:").setText(dockerFilePath);
        new PushButton("Edit Dockerfile").click();
        new WaitUntil(new ShellIsAvailable("Dockerfile Editor"), TimePeriod.LONG);
        DefaultStyledText defaultStyledText = new DefaultStyledText();
        String editorText = defaultStyledText.getText();
        assertTrue("Editor is empty!", StringUtils.isNotEmpty(editorText));
        defaultStyledText.setText(BUILD_IMAGE);
        CTabFolder tabFolder = new DefaultCTabFolder();
        CTabItem tabItem = tabFolder.getSelection();
        KeyboardFactory.getKeyboard().invokeKeyCombination(SWT.CTRL, 'S');
        tabItem.close();
        new DefaultShell("Build a Docker Image").setFocus();
        new FinishButton().click();
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    } catch (IOException ex) {
        fail("Resource file not found!");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) CTabFolder(org.eclipse.reddeer.swt.api.CTabFolder) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) IOException(java.io.IOException) CTabItem(org.eclipse.reddeer.swt.api.CTabItem) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) DefaultCTabFolder(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabFolder) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) File(java.io.File) Test(org.junit.Test)

Example 9 with DockerImagesTab

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

the class ContainerTabTest method runContainer.

private void runContainer(String connectionName, String imageName, String imageTag, String containerName) {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(imageName);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(containerName);
    firstPage.finish();
    if (mockitoIsUsed()) {
        MockUtils.runContainer(connectionName, imageName, imageTag, containerName);
    }
    getConnection().refresh();
    new WaitWhile(new JobIsRunning());
}
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)

Example 10 with DockerImagesTab

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

the class ImageTabTest method testImageTabSearch.

@Test
public void testImageTabSearch() {
    pullImage(IMAGE_HELLO_WORLD);
    DockerImagesTab imageTab = new DockerImagesTab();
    imageTab.activate();
    imageTab.refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    imageTab.searchImage("aaa");
    assertTrue("Search result is not 0!", imageTab.getTableItems().size() == 0);
    imageTab.searchImage("");
    assertTrue("Search result is 0!", imageTab.getTableItems().size() > 0);
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Aggregations

DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)25 Test (org.junit.Test)18 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)16 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)16 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)12 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)7 PropertySheet (org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)7 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)6 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)3 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)3 File (java.io.File)2 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 IOException (java.io.IOException)1 MockDockerTerminal (org.eclipse.linuxtools.docker.integration.tests.mock.MockDockerTerminal)1 DockerComposePreferencePage (org.eclipse.linuxtools.docker.reddeer.preferences.DockerComposePreferencePage)1 DockerExplorerView (org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView)1 DockerImageHierarchyTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImageHierarchyTab)1 DockerTerminal (org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal)1