Search in sources :

Example 96 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.

the class NetworkModeTest method checkNetworkMode.

private void checkNetworkMode(String networkMode) {
    if (mockitoIsUsed()) {
        runContainer(networkMode);
        getConnection().refresh();
        new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
    }
    new WaitWhile(new JobIsRunning());
    PropertySheet propertiesView = openPropertiesTabForContainer("Inspect", CONTAINER_NAME);
    String networkProp = propertiesView.getProperty("HostConfig", "NetworkMode").getPropertyValue();
    assertTrue("Container is not running in " + networkMode + " network mode!", networkProp.equals(networkMode));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)

Example 97 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.

the class UnconfinedTest method testUnconfined.

@Test
public void testUnconfined() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(IMAGE_NAME + ":" + IMAGE_TAG);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.setAllocatePseudoTTY();
    firstPage.setKeepSTDINOpen();
    firstPage.setUnconfined();
    firstPage.finish();
    if (mockitoIsUsed()) {
        runUnconfinedContainer();
        // MockDockerClientFactory.addContainer(this.client,
        // this.createdContainer, this.containerInfo);
        getConnection().refresh();
        new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
    }
    new WaitWhile(new JobIsRunning());
    PropertySheet propertiesView = openPropertiesTabForContainer("Inspect", CONTAINER_NAME);
    String securityProp = propertiesView.getProperty("HostConfig", "SecurityOpt", "").getPropertyValue();
    assertTrue("Container is not running in seccomp:unconfined mode!", securityProp.equals("seccomp:unconfined"));
}
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) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 98 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.

the class LaunchDockerImageTest method testLaunchConfiguration.

@Test
public void testLaunchConfiguration() {
    String imageName = getCompleteImageName(IMAGE_HELLO_WORLD);
    RunDockerImageLaunchConfiguration runImageConf = new RunDockerImageLaunchConfiguration();
    try {
        runDockerImageLaunchConfiguration(imageName + NAME_TAG_SEPARATOR + IMAGE_TAG_LATEST, CONTAINER_NAME, CONFIGURATION_NAME, runImageConf);
        if (mockitoIsUsed()) {
            MockUtils.runContainer(DEFAULT_CONNECTION_NAME, imageName, IMAGE_TAG_LATEST, CONTAINER_NAME);
            getConnection().refresh();
            new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
        }
    } catch (WaitTimeoutExpiredException ex) {
        throw ex;
    }
    assertTrue("Container is not deployed!", containerIsDeployed(CONTAINER_NAME));
}
Also used : WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) RunDockerImageLaunchConfiguration(org.eclipse.linuxtools.docker.reddeer.ui.RunDockerImageLaunchConfiguration) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 99 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.

the class NewDockerConnectionPage method open.

public void open() {
    new DockerExplorerView().open();
    new DefaultToolItem("Add Connection").click();
    new WaitUntil(new ShellIsAvailable(NEW_DOCKER_CONNECTION_SHELL), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 100 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.

the class NewDockerConnectionPage method search.

public void search(String connectionName) {
    new PushButton("Search...").click();
    new WaitUntil(new ShellIsAvailable("Docker Connection Selection"));
    Table table = new DefaultTable();
    table.getItem(connectionName).select();
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)178 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)74 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)63 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)59 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)54 Test (org.junit.Test)44 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)40 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)36 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)34 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)30 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)22 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)20 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)18 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)18 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)15 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)12