public void deleteContainers(String dockerServer, String containerName) {
   open();
   ConnectionItem dockerConnection = getConnection(dockerServer);
   TreeItem dc = dockerConnection.getTreeItem();
   dc.select();
   dc.expand();
   TreeItem containersItem = dc.getItem("Containers");
   containersItem.select();
   containersItem.expand();
   for (TreeItem item : containersItem.getItems()) {
     if (item.getText().contains(containerName)) {
       item.select();
       Menu contextMenu = new ContextMenu("Remove");
       if (!contextMenu.isEnabled()) {
         new ContextMenu("Stop").select();
         new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
         item.select();
         contextMenu = new ContextMenu("Remove");
       }
       contextMenu.select();
       new WaitUntil(new ShellWithTextIsAvailable("Confirm Remove Container"), TimePeriod.NORMAL);
       new PushButton("OK").click();
       new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
     }
   }
 }
 public void build() {
   select();
   Menu menu = new ShellMenu("Project", "Build Project");
   if (menu.isEnabled()) {
     menu.select();
   }
   new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
 }
Esempio n. 3
0
 @Test
 public void preferencesMenuTest() {
   log.info("Preferences menu test");
   new DefaultShell();
   Menu m = new ShellMenu("Window", "Preferences");
   m.select();
   Shell s = new DefaultShell("Preferences");
   s.close();
 }
Esempio n. 4
0
 @Test
 public void menuWithMnemonicTest() {
   log.info("menu with mnemonic test");
   new DefaultShell();
   Menu m = new ShellMenu("File", "New", "Other...");
   m.select();
   Shell s = new DefaultShell("New");
   s.close();
 }
Esempio n. 5
0
 @Test
 public void autoBuildingTest() {
   Menu menu = new ShellMenu("Project", "Build Automatically");
   assertEquals(menu.isSelected(), PreferencesUtil.isAutoBuildingOn());
   PreferencesUtil.setAutoBuildingOff();
   assertEquals(menu.isSelected(), false);
   assertEquals(menu.isSelected(), PreferencesUtil.isAutoBuildingOn());
   PreferencesUtil.setAutoBuildingOn();
   assertEquals(menu.isSelected(), true);
   assertEquals(menu.isSelected(), PreferencesUtil.isAutoBuildingOn());
 }
Esempio n. 6
0
  @Test
  public void contextMenuTest() {

    ProjectExplorer pe = new ProjectExplorer();
    pe.open();

    Menu menu = new ContextMenu("New", "Project...");
    menu.select();
    Shell s = new DefaultShell("New Project");
    s.close();
  }
Esempio n. 7
0
  @Test
  public void contextMenuItemTextTest() {
    // make sure shell is focused
    new DefaultShell();

    ProjectExplorer pe = new ProjectExplorer();
    pe.open();

    Menu menu = new ContextMenu("New", "Project...");
    assertTrue("Menuitem text not expected to be empty", !menu.getText().equals(""));
  }
Esempio n. 8
0
 @Test
 public void aboutMenuTest() {
   log.info("About menu test");
   new DefaultShell();
   @SuppressWarnings("unchecked")
   Menu m =
       new ShellMenu(
           new WithMnemonicTextMatcher("Help"), new WithTextMatcher(new RegexMatcher("About.*")));
   m.select();
   Shell s = new DefaultShell();
   s.close();
 }
Esempio n. 9
0
 @Override
 public void setUp() {
   super.setUp();
   // Open Internal Web Browser
   // TODO: should be replaced with Internal Web Browses view once it's implemented
   new DefaultShell();
   RegexMatchers m = new RegexMatchers("Window.*", "Show View.*", "Other...*");
   Menu menu = new ShellMenu(m.getMatchers());
   menu.select();
   new DefaultShell("Show View");
   new DefaultTreeItem("General", "Internal Web Browser").select();
   new PushButton("OK").click();
 }
  private void configureRestSupport(String wsProjectName, boolean enableRestSupport) {
    new ProjectExplorer().getProject(wsProjectName).select();

    Menu menu =
        new ContextMenu(
            "Configure",
            enableRestSupport
                ? RestFullLabels.REST_SUPPORT_MENU_LABEL_ADD.getLabel()
                : RestFullLabels.REST_SUPPORT_MENU_LABEL_REMOVE.getLabel());
    menu.select();

    new WaitUntil(new JobIsRunning(), TimePeriod.NORMAL, false);
  }
  private void generateJPAHibernateAnnotationsContextMenu() {
    PackageExplorer pe = new PackageExplorer();
    pe.selectProjects(prj);

    TreeItem item = new DefaultTreeItem(prj, "src", pckg, "Dog.java");
    item.select();

    Menu menu = new ContextMenu("Source", "Generate Hibernate/JPA annotations");
    menu.select();

    new DefaultShell("Hibernate: add JPA annotations");
    new PushButton("Next >").click();
    new PushButton("Finish").click();

    new WorkbenchShell();
    new DefaultTreeItem(prj, "src", pckg, "Dog.java");
    item.doubleClick();

    TextEditor editor = new TextEditor("Dog.java");
    StringHelper sh = new StringHelper(editor.getText());
    sh.getPositionAfter("@Entity");
  }
Esempio n. 12
0
 @Test
 public void shellMenuItemTextTest() {
   new DefaultShell();
   Menu menu = new ShellMenu("Window", "Preferences");
   assertTrue("Menuitem text not expected to be empty", !menu.getText().equals(""));
 }