use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.
the class AbstractImageBotTest method removeTagFromImage.
protected void removeTagFromImage(String imageName, String imageTagToRemove) {
DockerImagesTab imagesTab = openDockerImagesTab();
imagesTab.activate();
if (mockitoIsUsed()) {
MockUtils.pullImage(DEFAULT_CONNECTION_NAME, imageName, IMAGE_TAG_LATEST);
} else {
imagesTab.removeTagFromImage(imageName, imageTagToRemove);
}
}
use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.
the class BuildImageTest method testBuildImage.
@Test
public void testBuildImage() {
getConnection();
DockerImagesTab imageTab = openDockerImagesTab();
buildImage(IMAGE_TEST_BUILD, DOCKERFILE_FOLDER, imageTab);
assertConsoleSuccess();
}
use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.
the class EditDockerFileTest method testEditDockerFile.
@Test
public void testEditDockerFile() {
getConnection();
DockerImagesTab imageTab = openDockerImagesTab();
try {
String dockerFilePath = new File(EDIT_DOCKERFILE_FOLDER).getCanonicalPath();
getConnection();
imageTab.activate();
new DefaultToolItem("Build Image").click();
new WaitUntil(new ShellIsAvailable("Build a Docker Image"));
new LabeledText("Image Name:").setText(IMAGE_NAME);
new LabeledText("Directory:").setText(dockerFilePath);
new PushButton("Edit Dockerfile").click();
new WaitUntil(new ShellIsAvailable("Dockerfile Editor"), TimePeriod.LONG);
DefaultStyledText defaultStyledText = new DefaultStyledText();
String editorText = defaultStyledText.getText();
assertTrue("Editor is empty!", StringUtils.isNotEmpty(editorText));
defaultStyledText.setText(BUILD_IMAGE);
CTabFolder tabFolder = new DefaultCTabFolder();
CTabItem tabItem = tabFolder.getSelection();
KeyboardFactory.getKeyboard().invokeKeyCombination(SWT.CTRL, 'S');
tabItem.close();
new DefaultShell("Build a Docker Image").setFocus();
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
} catch (IOException ex) {
fail("Resource file not found!");
}
}
use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.
the class ContainerTabTest method runContainer.
private void runContainer(String connectionName, String imageName, String imageTag, String containerName) {
DockerImagesTab imagesTab = openDockerImagesTab();
imagesTab.runImage(imageName);
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
firstPage.setContainerName(containerName);
firstPage.finish();
if (mockitoIsUsed()) {
MockUtils.runContainer(connectionName, imageName, imageTag, containerName);
}
getConnection().refresh();
new WaitWhile(new JobIsRunning());
}
use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.
the class ImageTabTest method testImageTabSearch.
@Test
public void testImageTabSearch() {
pullImage(IMAGE_HELLO_WORLD);
DockerImagesTab imageTab = new DockerImagesTab();
imageTab.activate();
imageTab.refresh();
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
imageTab.searchImage("aaa");
assertTrue("Search result is not 0!", imageTab.getTableItems().size() == 0);
imageTab.searchImage("");
assertTrue("Search result is 0!", imageTab.getTableItems().size() > 0);
}
Aggregations