Search in sources :

Example 96 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class AbstractImageBotTest method buildImage.

protected void buildImage(String imageName, String dockerFileFolder, DockerImagesTab imageTab) {
    try {
        String dockerFilePath = new File(dockerFileFolder).getCanonicalPath();
        getConnection();
        imageTab.buildImage(imageName, dockerFilePath);
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    } catch (IOException ex) {
        fail("Resource file not found!");
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) IOException(java.io.IOException) File(java.io.File)

Example 97 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class ImageTagTest method testAddRemoveTagToImage.

@Test
public void testAddRemoveTagToImage() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.activate();
    addTagToImage(IMAGE_NAME, IMAGE_TAG);
    new WaitWhile(new JobIsRunning());
    assertTrue("Image tag has not been added", imagesTab.getImageTags(IMAGE_NAME).contains(IMAGE_TAG));
    removeTagFromImage(IMAGE_NAME, IMAGE_TAG);
    new WaitWhile(new JobIsRunning());
    assertTrue("ImageTaghasNotBeenRemoved", !imagesTab.getImageTags(IMAGE_NAME).contains(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 98 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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 99 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project linuxtools by eclipse.

the class ComposeTest method importProject.

private void importProject(String path) {
    new ShellMenu().getItem("File", "Open Projects from File System...").select();
    new LabeledCombo("Import source:").setText(path);
    new FinishButton().click();
    new WaitWhile(new JobIsRunning());
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ShellMenu(org.eclipse.reddeer.swt.impl.menu.ShellMenu)

Example 100 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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)

Aggregations

JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)154 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)142 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)62 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)52 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)46 Test (org.junit.Test)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)31 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)29 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)28 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)23 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)18 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)14 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)14 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)13 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)12 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)10