@Test
 public void testRemoveConfiguredModules() {
   ModifyModulesDialog dialog = server.addAndRemoveModules();
   ModifyModulesPage page = new ModifyModulesPage();
   page.add(PROJECT_1, PROJECT_3);
   if (!page.getConfiguredModules().isEmpty()) {
     page.removeAll();
   }
   dialog.finish();
 }
 /**
  * Deploys existing project to given server.
  *
  * @param projectName
  * @param serverName
  */
 public void deployProject(String projectName, String serverName) {
   JBossServerView serversView = new JBossServerView();
   serversView.open();
   ModifyModulesDialog modulesDialog = serversView.getServer(serverName).addAndRemoveModules();
   String moduleName =
       new DefaultTreeItem(new TreeItemTextMatcher(new RegexMatcher(".*" + projectName + ".*")))
           .getText();
   new ModifyModulesPage().add(moduleName);
   modulesDialog.finish();
   new WaitUntil(new WaitForProjectToStartAndSynchronize(moduleName, serverName), TimePeriod.LONG);
 }
  @Test
  public void addTwo_removeAll() {
    ModifyModulesDialog dialog = server.addAndRemoveModules();
    ModifyModulesPage page = new ModifyModulesPage();
    page.add(PROJECT_1, PROJECT_3);
    dialog.finish();

    List<ServerModule> modules = server.getModules();
    assertThat(modules.size(), is(2));
    assertThat(modules.get(0).getLabel().getName(), is(PROJECT_1));
    assertThat(modules.get(1).getLabel().getName(), is(PROJECT_3));

    server.addAndRemoveModules();
    page = new ModifyModulesPage();
    page.removeAll();
    dialog.finish();

    modules = server.getModules();
    assertThat(modules.size(), is(0));
  }