use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.
the class RunDockerImageLaunchConfiguration method deleteRunConfiguration.
public void deleteRunConfiguration(String configuratioName) {
selectConfiguration(configuratioName);
new DefaultToolItem(DELETE_LAUNCH_CONFIGURATION_LABEL).click();
Shell deleteShell = new DefaultShell("Confirm Launch Configuration Deletion");
WidgetIsFound deleteButton = new WidgetIsFound(org.eclipse.swt.widgets.Button.class, deleteShell.getSWTWidget(), new WithMnemonicTextMatcher("Delete"));
Button button;
if (deleteButton.test()) {
// photon changed button text
button = new PushButton(deleteShell, "Delete");
} else {
button = new YesButton(deleteShell);
}
button.click();
new WaitWhile(new ShellIsAvailable(deleteShell));
new WaitUntil(new ShellIsAvailable("Run Configurations"));
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.
the class DockerConnection method pullImage.
public void pullImage(String imageName, String imageTag, String dockerRegister) {
if (getImage(imageName, imageTag) == null) {
refreshImages();
treeViewerHandler.getTreeItem(item, "Images").select();
new ContextMenu().getItem("Pull...").select();
new WaitUntil(new ShellIsAvailable("Pull Image"), TimePeriod.DEFAULT);
Shell pullShell = new DefaultShell("Pull Image");
// select register
if (dockerRegister != null) {
Combo combo = new DefaultCombo();
combo.setSelection(dockerRegister);
}
new LabeledText(IMAGE_NAME_LABEL_DIALOG).setFocus();
new LabeledText(IMAGE_NAME_LABEL_DIALOG).setText(imageTag == null ? imageName : imageName + ":" + imageTag);
new WaitUntil(new ControlIsEnabled(new FinishButton()));
new FinishButton(pullShell).click();
new WaitWhile(new ShellIsAvailable(pullShell));
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.
the class DockerConnection method openImageSearchDialog.
public void openImageSearchDialog(String imageName, String imageTag, String dockerRegister) {
refreshImages();
treeViewerHandler.getTreeItem(item, "Images").select();
new ContextMenu().getItem("Pull...").select();
new WaitUntil(new ShellIsAvailable("Pull Image"), TimePeriod.DEFAULT);
// select register
if (dockerRegister != null) {
Combo combo = new DefaultCombo();
combo.setSelection(dockerRegister);
}
new LabeledText(IMAGE_NAME_LABEL_DIALOG).setFocus();
new LabeledText(IMAGE_NAME_LABEL_DIALOG).setText(imageTag == null ? imageName : imageName + ":" + imageTag);
new PushButton("Search...").click();
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.
the class BasicSecurityTest method testBasicSecurity.
@Test
public void testBasicSecurity() {
DockerImagesTab imagesTab = openDockerImagesTab();
imagesTab.runImage(IMAGE_NAME + ":" + IMAGE_TAG);
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
firstPage.setContainerName(CONTAINER_NAME);
firstPage.setAllocatePseudoTTY();
firstPage.setKeepSTDINOpen();
firstPage.setBasicSecurity();
firstPage.finish();
if (mockitoIsUsed()) {
runContainer();
// 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 readonlyProp = propertiesView.getProperty("HostConfig", "ReadonlyRootfs").getPropertyValue();
assertTrue("Container is not running read-only!", readonlyProp.equals("true"));
String tmpfsProp = propertiesView.getProperty("HostConfig", "Tmpfs", "/run").getPropertyValue();
assertTrue("Container /run is not tmpfs rw,exec!", tmpfsProp.equals("rw,exec"));
tmpfsProp = propertiesView.getProperty("HostConfig", "Tmpfs", "/tmp").getPropertyValue();
assertTrue("Container /tmp is not tmpfs rw,exec!", tmpfsProp.equals("rw,exec"));
String capDropProp = propertiesView.getProperty("HostConfig", "CapDrop", "").getPropertyValue();
assertTrue("Container does not have capDrop all!", capDropProp.equals("all"));
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project linuxtools by eclipse.
the class ContainerLogTest method before.
@Before
public void before() {
deleteAllConnections();
getConnection();
pullImage(IMAGE_NAME);
new WaitWhile(new JobIsRunning());
DockerExplorerView explorer = new DockerExplorerView();
explorer.open();
getConnection().refresh();
getConnection().getImage(IMAGE_NAME).run();
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(explorer);
firstPage.setContainerName(CONTAINER_NAME);
firstPage.setAllocatePseudoTTY();
firstPage.setKeepSTDINOpen();
firstPage.finish();
if (mockitoIsUsed()) {
runContainer();
getConnection().refresh();
new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
}
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
}
Aggregations