Search in sources :

Example 21 with DockerImagesTab

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

the class PushImageTest method pushImage.

@Test
public void pushImage() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    buildImage(IMAGE_NAME, DOCKERFILE_FOLDER, imagesTab);
    assertConsoleSuccess();
    setUpRegister(REGISTRY_URL, dockerHubEmail, dockerHubUsername, dockerHubPassword);
    setSecureStorage("password");
    String seconds = String.valueOf(new java.util.Date().getTime());
    this.imageNewTag = IMAGE_TAG + ":" + seconds;
    addTagToImage(IMAGE_NAME, imageNewTag);
    // new WaitUntil(new JobIsRunning(), TimePeriod.VERY_LONG);
    if (!mockitoIsUsed()) {
        getConnection().getImage(IMAGE_TAG, seconds).pushImage(REGISTRY_ACCOUNT, false, false);
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    deleteImage(IMAGE_TAG, seconds);
    pullImage(IMAGE_TAG, seconds, REGISTRY_URL);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    assertTrue("Image has not been pushed/pulled!", imageIsDeployed(IMAGE_TAG));
}
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)

Example 22 with DockerImagesTab

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

the class MockDockerConnectionManager method configureConnectionManager.

/**
 * Configures the {@link DockerConnectionManager} with the given array of
 * {@link IDockerConnection} (can be mocked) and refreshes the associated
 * {@link DockerExplorerView}.
 *
 * @param connectionStorageManager
 *            the {@link IDockerConnectionStorageManager} to use (can be
 *            mocked)
 */
public static void configureConnectionManager(final IDockerConnectionStorageManager connectionStorageManager) {
    DockerConnectionManager.getInstance().setConnectionStorageManager(connectionStorageManager);
    DockerConnectionManager.getInstance().reloadConnections();
    DockerExplorerView de = new DockerExplorerView();
    de.open();
    de.refreshView();
    DockerImagesTab imageTab = new DockerImagesTab();
    imageTab.activate();
    imageTab.refresh();
    DockerContainersTab containerTab = new DockerContainersTab();
    containerTab.activate();
    containerTab.refresh();
}
Also used : DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) DockerContainersTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)

Example 23 with DockerImagesTab

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

the class ComposeTest method testCompose.

@Test
public void testCompose() {
    // Set up Docker Compose location
    PreferenceDialog dialog = new WorkbenchPreferenceDialog();
    DockerComposePreferencePage composePreference = new DockerComposePreferencePage(dialog);
    dialog.open();
    dialog.select(composePreference);
    composePreference.setPathToDockerCompose(this.dockerComposePath);
    composePreference.apply();
    new PushButton("Apply and Close").click();
    // Build Image
    DockerImagesTab imagesTab = openDockerImagesTab();
    buildImage(IMAGE_NAME, PATH_TEST_COMPOSE, imagesTab);
    assertConsoleSuccess();
    // Import resource folder
    importProject(PATH_TEST_COMPOSE);
    // Run Docker Compose
    runDockerCompose(PROJECT_TEST_COMPOSE, FILE_DOCKER_COMPOSE);
    // Check if application is running
    WebBrowserView browserView = new WebBrowserView();
    browserView.open();
    // Skip browser contents check, if mockito is used
    if (!mockitoIsUsed()) {
        browserView.openPageURL(URL);
        BrowserContentsCheck.checkBrowserForErrorPage(browserView, URL);
    }
}
Also used : WebBrowserView(org.eclipse.reddeer.eclipse.ui.browser.WebBrowserView) PreferenceDialog(org.eclipse.reddeer.jface.preference.PreferenceDialog) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) DockerComposePreferencePage(org.eclipse.linuxtools.docker.reddeer.preferences.DockerComposePreferencePage) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest) Test(org.junit.Test)

Example 24 with DockerImagesTab

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

the class PropertiesViewTest method testContainerPropertiesTab.

@Test
public void testContainerPropertiesTab() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(IMAGE_NAME);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.finish();
    // new WaitWhile(new ContainerIsDeployedCondition(CONTAINER_NAME,
    // getConnection()));
    DockerContainersTab containerTab = new DockerContainersTab();
    containerTab.activate();
    containerTab.refresh();
    new WaitWhile(new JobIsRunning());
    if (mockitoIsUsed()) {
        MockUtils.runContainer(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST, CONTAINER_NAME);
    }
    getConnection();
    // open Properties view
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    containerTab.select(CONTAINER_NAME);
    propertiesView.selectTab("Info");
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) DockerContainersTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 25 with DockerImagesTab

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

the class PropertiesViewTest method testImagePropertiesTab.

@Test
public void testImagePropertiesTab() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.selectImage(IMAGE_NAME);
    // DockerExplorerView de = new DockerExplorerView();
    // de.open();
    // de.getDockerConnectionByName(getConnection().getName()).getImage(IMAGE_NAME).select();
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    propertiesView.selectTab("Info");
}
Also used : PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) 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