Exemple #1
0
  /** Test create new Struts Project */
  @Test
  public void testCreateNewStrutsProject() {
    eclipse.createNew(EntityType.STRUTS_PROJECT);
    bot.shell(IDELabel.Shell.NEW_STRUTS_PROJECT).activate();
    bot.textWithLabel(IDELabel.NewStrutsProjectDialog.NAME)
        .setText(StrutsAllBotTests.STRUTS_PROJECT_NAME);
    bot.comboBoxWithLabel(IDELabel.NewStrutsProjectDialog.TEMPLATE)
        .setSelection(IDELabel.NewStrutsProjectDialog.TEMPLATE_KICK_START);
    bot.button(IDELabel.Button.NEXT).click();
    bot.sleep(1000L);
    bot.button(IDELabel.Button.NEXT).click();
    bot.button(IDELabel.Button.FINISH).click();
    bot.sleep(1500);

    SWTBot v = eclipse.showView(ViewType.PACKAGE_EXPLORER);
    SWTBotTree tree = v.tree();
    tree.setFocus();
    assertTrue(
        "Project " + StrutsAllBotTests.STRUTS_PROJECT_NAME + " was not created properly.",
        SWTEclipseExt.treeContainsItemWithLabel(tree, StrutsAllBotTests.STRUTS_PROJECT_NAME));
  }
 /*
  * init method "setup()" shows a project explorer view as default, disable
  * folding (to easier source code editing)
  */
 @BeforeClass
 public static void setUpSuite() {
   SWTEclipseExt eclipse = new SWTEclipseExt(new SWTBotExt());
   eclipse.showView(ViewType.PROJECT_EXPLORER);
   SWTEclipseCDIExtUtil.disableFolding();
 }