Search in sources :

Example 6 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class PrivilegedModeTest method testPrivilegedMode.

@Test
public void testPrivilegedMode() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(IMAGE_NAME + ":" + IMAGE_TAG);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.setAllocatePseudoTTY();
    firstPage.setKeepSTDINOpen();
    firstPage.setGiveExtendedPrivileges();
    firstPage.finish();
    if (mockitoIsUsed()) {
        runPrivilegedContainer();
        // 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 privilegedProp = propertiesView.getProperty("HostConfig", "Privileged").getPropertyValue();
    assertTrue("Container is not running in privileged mode!", privilegedProp.equals("true"));
}
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 7 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class ContainerTabTest method testContainerTab.

@Test
public void testContainerTab() {
    runContainer(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST, CONTAINER_NAME);
    DockerContainersTab containerTab = new DockerContainersTab();
    containerTab.activate();
    containerTab.refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    // get values from Container Tab
    String nameFromTable = "";
    String imageFromTable = "";
    String createdFromTable = "";
    String commandFromTable = "";
    String portsFromTable = "";
    String statusFromTable = "";
    containerTab.refresh();
    TableItem item = getContainerItem(CONTAINER_NAME, containerTab);
    assertNotNull("Container tab item " + CONTAINER_NAME + " was not found.", item);
    nameFromTable = item.getText();
    imageFromTable = item.getText(1);
    createdFromTable = item.getText(2);
    commandFromTable = item.getText(3);
    portsFromTable = item.getText(4);
    statusFromTable = item.getText(5);
    // get values from Properties view
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    getConnection().getContainer(CONTAINER_NAME).select();
    propertiesView.selectTab("Info");
    String nameProp = propertiesView.getProperty("Names").getPropertyValue();
    String imageProp = propertiesView.getProperty("Image").getPropertyValue();
    String createdProp = propertiesView.getProperty("Created").getPropertyValue();
    String commandProp = propertiesView.getProperty("Command").getPropertyValue();
    String portsProp = propertiesView.getProperty("Ports").getPropertyValue();
    String statusProp = propertiesView.getProperty("Status").getPropertyValue();
    // compare values
    assertTrue("Name in table and in Properties do not match!(" + nameProp + "-" + nameFromTable + ")", nameFromTable.contains(nameProp));
    assertTrue("Image in table and in Properties do not match!(" + imageProp + "-" + imageFromTable + ")", imageProp.equals(imageFromTable));
    assertTrue("Created in table and in Properties do not match!(" + createdProp + "-" + createdFromTable + ")", createdProp.equals(createdFromTable));
    assertTrue("Command in table and in Properties do not match!(" + commandProp + "-" + commandFromTable + ")", commandProp.startsWith(commandFromTable));
    assertTrue("Ports in table and in Properties do not match!(" + portsProp + "-" + portsFromTable + ")", portsProp.startsWith(portsFromTable));
    assertTrue("Status in table and in Properties do not match!(" + statusProp + "-" + statusFromTable + ")", statusProp.startsWith(statusFromTable));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) TableItem(org.eclipse.reddeer.swt.api.TableItem) 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 8 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class ImageTabTest method testImageTab.

@Test
public void testImageTab() {
    pullImage(IMAGE_HELLO_WORLD);
    DockerImagesTab imageTab = new DockerImagesTab();
    imageTab.activate();
    imageTab.refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    String idFromTable = "";
    String repoTagsFromTable = "";
    String createdFromTable = "";
    String sizeFromTable = "";
    for (TableItem item : imageTab.getTableItems()) {
        if (item.getText(1).contains(IMAGE_HELLO_WORLD)) {
            idFromTable = item.getText();
            repoTagsFromTable = item.getText(1);
            createdFromTable = item.getText(2);
            sizeFromTable = item.getText(3).replaceAll(".", "").replaceAll(" MB", "");
            item.click();
        }
    }
    idFromTable = idFromTable.replace("sha256:", "");
    getConnection().getImage(getCompleteImageName(IMAGE_HELLO_WORLD)).select();
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    propertiesView.selectTab("Info");
    String idProp = propertiesView.getProperty("Id").getPropertyValue();
    String repoTagsProp = propertiesView.getProperty("RepoTags").getPropertyValue();
    String createdProp = propertiesView.getProperty("Created").getPropertyValue();
    String sizeProp = propertiesView.getProperty("VirtualSize").getPropertyValue();
    assertTrue("Id in table and in Properties do not match!", idProp.contains(idFromTable));
    assertTrue("RepoTags in table and in Properties do not match!", repoTagsProp.equals(repoTagsFromTable));
    assertTrue("Created in table and in Properties do not match!", createdProp.equals(createdFromTable));
    assertTrue("Size in table and in Properties do not match!", sizeProp.startsWith(sizeFromTable));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) TableItem(org.eclipse.reddeer.swt.api.TableItem) 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)

Example 9 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project jbosstools-openshift by jbosstools.

the class ProjectPropertiesTest method setUp.

@Before
public void setUp() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    project = connection.getProject(DatastoreOS3.TEST_PROJECT);
    project.select();
    project.openProperties();
    propertiesView = new PropertySheet();
}
Also used : PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection) Before(org.junit.Before)

Example 10 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project jbosstools-openshift by jbosstools.

the class OpenShiftProject method openProperties.

/**
 * Opens properties for the specified tree item (project, service or pod) in OpenShift explorer.
 */
public void openProperties(TreeItem treeItem) {
    activateOpenShiftExplorerView();
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.PROPERTIES).select();
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.activate();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)

Aggregations

PropertySheet (org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)18 Test (org.junit.Test)9 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)8 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)7 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)5 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)5 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)3 TableItem (org.eclipse.reddeer.swt.api.TableItem)2 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)2 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)2 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)1 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)1 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)1 Before (org.junit.Before)1