@Test
  public void testCreateNewDawnEditorSetName() throws Exception {
    getBot().menu("File").menu("New").menu("Other...").click();

    SWTBotShell shell = getBot().shell("New");
    shell.activate();
    getBot().tree().expandNode("Dawn Examples").select(DawnAcoreTestUtil.CREATION_WIZARD_NAME_EMF);
    getBot().button("Next >").click();

    shell = getBot().shell("New");
    shell.activate();

    SWTBotText fileSemanticNameLabel = getBot().textWithLabel(resourceFieldLabel);
    fileSemanticNameLabel.setText("test.acore");
    assertEquals("test.acore", fileSemanticNameLabel.getText());

    getBot().button("Next >").click();

    SWTBotCombo comboBox = getBot().comboBox(0); // bot.ccomboBox(0);
    comboBox.setFocus();
    comboBox.setSelection("ACore Root");

    getBot().button("Finish").click();

    SWTBotEditor editor = getBot().editorByTitle("test.acore");
    assertNotNull(editor);
    editor.close();
  }
  @Test
  public void testCreateNewDawnAcoreEditor() throws Exception {
    getBot().menu("File").menu("New").menu("Other...").click();

    SWTBotShell shell = getBot().shell("New");
    shell.activate();
    getBot().tree().expandNode("Dawn Examples").select(DawnAcoreTestUtil.CREATION_WIZARD_NAME_EMF);
    getBot().button("Next >").click();
    getBot().button("Next >").click();

    shell = getBot().shell("New");
    shell.activate();

    SWTBotCombo comboBox = getBot().comboBox(0); // bot.ccomboBox(0);
    comboBox.setFocus();
    comboBox.setSelection("ACore Root");

    getBot().button("Finish").click();

    sleep(500);

    SWTBotEditor editor = getBot().editorByTitle("default.acore");
    assertNotNull(editor);
    editor.close();
    {
      assertEquals(true, resourceExists("/default.acore"));
    }
  }
Ejemplo n.º 3
0
 // Renames a configuration. Assumes the "Manage Configurations" dialog will
 // be open.
 private void renameConfiguration(String original, String newname) {
   SWTBotShell shell = bot.shell(projectName + ": Manage Configurations");
   shell.activate();
   bot.table().select(original);
   bot.button("Rename...").click();
   shell = bot.shell("Rename Configuration");
   shell.activate();
   bot.textWithLabel("Name:").setText(newname);
   bot.button("OK").click();
   shell = bot.shell(projectName + ": Manage Configurations");
   shell.activate();
 }
Ejemplo n.º 4
0
  // Verify we can do a double rename of configurations, renaming one
  // configuration to
  // another and inheriting the settings properly.
  @Test
  public void t5doubleRenameOk() throws Exception {
    openProperties("Autotools", "Configure Settings");
    SWTBotCombo configs = bot.comboBoxWithLabel("Configuration: ");
    bot.button("Manage Configurations...").click();
    SWTBotShell shell = bot.shell(projectName + ": Manage Configurations");
    shell.activate();
    bot.table().select("debug");
    bot.button("Set Active").click();
    // Rename "debug" to "release" and rename "default" to "debug".
    // The settings should follow the rename operation.
    renameConfiguration("debug", "release");
    renameConfiguration("default", "debug");
    bot.button("OK").click();
    shell = bot.shell("Properties for " + projectName);
    shell.activate();
    bot.button("OK").click();

    // Verify changes have taken effect permanently
    openProperties("Autotools", "Configure Settings");
    configs = bot.comboBoxWithLabel("Configuration: ");
    assertTrue(configs.getText().contains("release"));
    assertTrue(configs.getText().contains("Active"));
    bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
    SWTBotText text = bot.textWithLabel("Additional command-line options");
    String setting = text.getText();
    assertEquals("--enable-jeff", setting);
    configs.setFocus();
    configs.setSelection("debug");
    assertTrue(configs.getText().contains("debug"));
    bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
    text = bot.textWithLabel("Additional command-line options");
    setting = text.getText();
    assertEquals("", setting);

    // Undo the changes made by this test
    configs = bot.comboBoxWithLabel("Configuration: ");
    bot.button("Manage Configurations...").click();
    shell = bot.shell(projectName + ": Manage Configurations");
    shell.activate();
    bot.table().select("Build (GNU)");
    bot.button("Set Active").click();
    renameConfiguration("debug", "default");
    renameConfiguration("release", "debug");
    bot.button("OK").click();
    shell = bot.shell("Properties for " + projectName);
    shell.activate();
    bot.button("OK").click();
    bot.waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 5
0
  public void confirmShellShareProjectFiles(String project, String[] files, JID[] jids) {
    SWTBot bot = new SWTBot();
    SWTBotShell shell = bot.shell(SHELL_SHARE_PROJECT);
    shell.activate();

    // wait for tree update
    bot.sleep(500);

    SWTBotTree tree = shell.bot().tree();

    selectProjectFiles(tree, project, files);

    shell.bot().button(NEXT).click();

    // wait for tree update
    bot.sleep(500);

    tree = shell.bot().tree();

    for (SWTBotTreeItem item : tree.getAllItems()) while (item.isChecked()) item.uncheck();

    for (JID jid : jids)
      WidgetUtil.getTreeItemWithRegex(tree, Pattern.quote(jid.getBase()) + ".*").check();

    shell.bot().button(FINISH).click();
    bot.waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 6
0
 @Override
 public void confirmShellNewSharedFile(String decision) {
   SWTBot bot = new SWTBot();
   SWTBotShell shell = bot.shell(SHELL_NEW_FILE_SHARED);
   shell.activate();
   shell.bot().button(decision).click();
   bot.waitUntil(Conditions.shellCloses(shell));
 }
  @Test
  public void testCreateNewDawnDiagramTypeFolder() throws Exception {
    {
      CDOSession session = openSession();
      ResourceSet resourceSet = new ResourceSetImpl();
      CDOTransaction transaction = session.openTransaction(resourceSet);

      final URI uri = URI.createURI("cdo:/folder/dummy");
      resourceSet.createResource(uri);
      transaction.commit();
    }

    getBot().menu("File").menu("New").menu("Other...").click();

    SWTBotShell shell = getBot().shell("New");
    shell.activate();
    getBot().tree().expandNode("Dawn Examples").select(DawnAcoreTestUtil.CREATION_WIZARD_NAME_EMF);
    getBot().button("Next >").click();

    shell = getBot().shell("New");
    shell.activate();

    SWTBotText fileNameLabel = getBot().textWithLabel(resourceFieldLabel);
    fileNameLabel.setText("test.acore");

    SWTBotText folder = getBot().textWithLabel("Enter or select the parent folder: ");
    folder.setText("/folder");
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";

    getBot().button("Next >").click();

    SWTBotCombo comboBox = getBot().comboBox(0); // bot.ccomboBox(0);
    comboBox.setFocus();
    comboBox.setSelection("ACore Root");

    getBot().button("Finish").click();

    SWTBotEditor editor = getBot().editorByTitle("test.acore");
    assertNotNull(editor);
    editor.close();

    {
      assertEquals(true, resourceExists("/folder/test.acore"));
    }
  }
Ejemplo n.º 8
0
 @Override
 public void confirmShellClosingTheSession() throws RemoteException {
   SWTBotShell shell = new SWTBot().shell(SHELL_CLOSING_THE_SESSION);
   shell.activate();
   shell.bot().button(OK).click();
   shell.bot().waitUntil(Conditions.shellCloses(shell));
   // wait for tree update in the saros session view
   new SWTBot().sleep(500);
 }
Ejemplo n.º 9
0
 @Override
 public void confirmShellNeedBased(String decsision, boolean remember) throws RemoteException {
   SWTBot bot = new SWTBot();
   SWTBotShell shell = bot.shell(SHELL_NEED_BASED_SYNC);
   shell.activate();
   if (remember) shell.bot().checkBox("Remember my decision.").click();
   shell.bot().button(decsision).click();
   bot.waitUntil(Conditions.shellCloses(shell));
 }
Ejemplo n.º 10
0
  @Test
  // Verify we can build and run the info MakeTarget tool
  public void t1canBuildAndAccessInfoTarget() throws Exception {
    clickProjectContextMenu("Build Project");

    // Wait until the project is built
    SWTBotShell shell = bot.shell("Build Project");
    bot.waitUntil(Conditions.shellCloses(shell), 120000);

    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    assertNotNull(workspace);
    IWorkspaceRoot root = workspace.getRoot();
    assertNotNull(root);
    IProject project = root.getProject(projectName);
    assertNotNull(project);
    IPath path = project.getLocation();
    path = path.append("config.status");
    File f = new File(path.toOSString());
    assertTrue(f.exists());
    f = new File(path.toOSString());
    assertTrue(f.exists());

    projectExplorer.bot().tree().getTreeItem(projectName).select();
    clickContextMenu(projectExplorer.bot().tree().select(projectName), "Make Targets", "Build...");
    shell = bot.shell("Make Targets");
    shell.activate();
    bot.table().getTableItem("info").select();
    bot.button("Build").click();

    SWTBotView consoleView = viewConsole("CDT Build Console");
    Pattern p = Pattern.compile(".*make info.*", Pattern.DOTALL);
    bot.waitUntil(consoleTextMatches(consoleView, p));

    // Make Targets using right-click on project.
    clickProjectContextMenu("Make Targets", "Build...");
    shell = bot.shell("Make Targets");
    shell.activate();
    bot.table().getTableItem("check").select();
    bot.button("Build").click();
    consoleView = bot.viewByPartName("Console");
    consoleView.setFocus();
    p = Pattern.compile(".*make check.*Making check in src.*", Pattern.DOTALL);
    bot.waitUntil(consoleTextMatches(consoleView, p));
  }
Ejemplo n.º 11
0
  @Override
  public void confirmShellAddProjectUsingExistProject(String projectName) throws RemoteException {
    SWTBot bot = new SWTBot();
    bot.waitUntil(
        Conditions.shellIsActive(SHELL_ADD_PROJECT), SarosSWTBotPreferences.SAROS_LONG_TIMEOUT);

    SWTBotShell shell = bot.shell(SHELL_ADD_PROJECT);
    shell.activate();

    shell.bot().radio(RADIO_USING_EXISTING_PROJECT).click();
    shell.bot().textWithLabel("Project name", 1).setText(projectName);
    shell.bot().button(FINISH).click();

    // prevent STF from entering an endless loop

    int timeout = 5;
    confirmDialogs:
    while (timeout-- > 0) {
      bot.sleep(2000);

      for (SWTBotShell currentShell : bot.shells()) {
        if (currentShell.getText().equals(SHELL_WARNING_LOCAL_CHANGES_DELETED)
            || currentShell.getText().equals(SHELL_SAVE_RESOURCE)) {
          currentShell.activate();
          currentShell.bot().button(YES).click();
          currentShell.bot().waitUntil(Conditions.shellCloses(currentShell));
          break confirmDialogs;

        } else if (currentShell.getText().equals(SHELL_CONFIRM_SAVE_UNCHANGED_CHANGES)) {
          currentShell.activate();
          currentShell.bot().button(YES).click();
          currentShell.bot().waitUntil(Conditions.shellCloses(currentShell));

          shell.bot().button(FINISH).click();

          continue confirmDialogs;
        }
      }
    }

    shell.bot().waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 12
0
  @Override
  public void confirmShellEditXMPPAccount(String xmppJabberID, String newPassword)
      throws RemoteException {
    SWTBotShell shell = new SWTBot().shell(SHELL_EDIT_XMPP_JABBER_ACCOUNT);
    shell.activate();

    shell.bot().comboBoxWithLabel(LABEL_XMPP_JABBER_ID).setText(xmppJabberID);
    shell.bot().textWithLabel(LABEL_PASSWORD).setText(newPassword);
    shell.bot().button(FINISH).click();
    shell.bot().waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 13
0
  @Override
  public void confirmShellRequestOfSubscriptionReceived() throws RemoteException {

    SWTBot bot = new SWTBot();
    SWTBotShell shell = bot.shell(SHELL_REQUEST_OF_SUBSCRIPTION_RECEIVED);

    shell.activate();
    shell.bot().button(OK).click();
    bot.waitUntil(Conditions.shellCloses(shell));
    // wait for tree update in the saros session view
    bot.sleep(500);
  }
  @Test
  public void testCreateNewDawnEditorWrongResourceName() throws Exception {
    getBot().menu("File").menu("New").menu("Other...").click();

    SWTBotShell shell = getBot().shell("New");
    shell.activate();
    getBot().tree().expandNode("Dawn Examples").select(DawnAcoreTestUtil.CREATION_WIZARD_NAME_EMF);
    getBot().button("Next >").click();

    shell = getBot().shell("New");
    shell.activate();

    SWTBotText fileSemanticNameLabel = getBot().textWithLabel(resourceFieldLabel);
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    Keyboard keyboard = KeyboardFactory.getDefaultKeyboard(fileSemanticNameLabel.widget, null);
    fileSemanticNameLabel.setFocus();
    fileSemanticNameLabel.setText("x");
    // fileSemanticNameLabel.typeText("x", 500);
    keyboard.pressShortcut(Keystrokes.BS);

    assertEquals(false, getBot().button("Next >").isEnabled());
    getBot().button("Cancel").click();
  }
Ejemplo n.º 15
0
  public void create(String projectId) {
    bot.menu().menu("File").menu("New").menu("Project...").click();
    SWTBotShell shell = bot.shell("New Project");
    shell.activate();

    bot.tree().expandNode("SWTBot", "SWTBot Test Plug-in").select();
    bot.button("Next >").click();

    bot.textWithLabel("Plug-in Name:").setText(projectId);
    bot.textWithLabel("Plug-in id:").setText(projectId);
    bot.textWithLabel("Provider:").setText("ACME Corp.");
    bot.button("Finish").click();
    bot.waitUntil(shellCloses(shell));
  }
Ejemplo n.º 16
0
  @Override
  public void confirmShellLeavingClosingSession() throws RemoteException {
    SWTBot bot = new SWTBot();
    SWTBotShell shell;

    if (!Views.getInstance().sarosView().isHost()) {
      shell = bot.shell(SHELL_CONFIRM_LEAVING_SESSION);
    } else {
      shell = bot.shell(SHELL_CONFIRM_CLOSING_SESSION);
    }
    shell.activate();
    shell.bot().button(YES).click();
    Views.getInstance().sarosView().waitUntilIsNotInSession();
  }
Ejemplo n.º 17
0
  // Prepare initial settings that will be tested.
  private static void initConfigParm() {
    // Set the configure parameters to be --enable-jeff via user-defined
    // options
    SWTBotShell shell = openProperties("Autotools", "Configure Settings");
    bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
    SWTBotText text = bot.textWithLabel("Additional command-line options");
    text.typeText("--enable-jeff");
    bot.button("OK").click();
    bot.waitUntil(Conditions.shellCloses(shell), 120000);

    // Create new build configurations that will be used throughout tests
    projectExplorer.bot().tree().select(projectName);
    clickContextMenu(
        projectExplorer.bot().tree().select(projectName), "Build Configurations", "Manage...");
    shell = bot.shell(projectName + ": Manage Configurations");
    shell.activate();
    bot.button("New...").click();
    shell = bot.shell("Create New Configuration");
    shell.activate();
    SWTBotText t = bot.textWithLabel("Name:");
    t.setText("debug");
    AbstractTest.clickRadioButtonInGroup("Existing configuration", "Copy settings from");
    bot.button("OK").click();
    shell = bot.shell(projectName + ": Manage Configurations");
    shell.activate();
    bot.button("New...").click();
    shell = bot.shell("Create New Configuration");
    shell.activate();
    t = bot.textWithLabel("Name:");
    t.setText("default");
    AbstractTest.clickRadioButtonInGroup("Default configuration", "Copy settings from");
    bot.button("OK").click();
    shell = bot.shell(projectName + ": Manage Configurations");
    shell.activate();
    bot.button("OK").click();
    bot.waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 18
0
  @Override
  public void confirmShellAddProjectWithNewProject(String projectName) throws RemoteException {

    SWTBot bot = new SWTBot();
    bot.waitUntil(
        Conditions.shellIsActive(SHELL_ADD_PROJECT), SarosSWTBotPreferences.SAROS_LONG_TIMEOUT);

    SWTBotShell shell = bot.shell(SHELL_ADD_PROJECT);
    shell.activate();

    shell.bot().radio(RADIO_CREATE_NEW_PROJECT).click();
    shell.bot().textWithLabel("Project name", 0).setText(projectName);
    shell.bot().button(FINISH).click();
    shell.bot().waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 19
0
  @Override
  public void confirmShellAddXMPPAccount(JID jid, String password) throws RemoteException {

    SWTBotShell shell = new SWTBot().shell(SHELL_ADD_XMPP_JABBER_ACCOUNT);
    shell.activate();

    /*
     * FIXME with comboBoxInGroup(GROUP_EXISTING_ACCOUNT) you wil get
     * WidgetNoFoundException.
     */
    shell.bot().comboBoxWithLabel(LABEL_XMPP_JABBER_ID).setText(jid.getBase());

    shell.bot().textWithLabel(LABEL_PASSWORD).setText(password);
    shell.bot().button(FINISH).click();
    shell.bot().waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 20
0
  @Override
  public void confirmShellAddProjectUsingExistProjectWithCopy(String projectName)
      throws RemoteException {

    SWTBot bot = new SWTBot();
    bot.waitUntil(
        Conditions.shellIsActive(SHELL_ADD_PROJECT), SarosSWTBotPreferences.SAROS_LONG_TIMEOUT);

    SWTBotShell shell = bot.shell(SHELL_ADD_PROJECT);
    shell.activate();

    shell.bot().radio("Use existing project").click();
    shell.bot().checkBox("Create copy for working distributed. New project name:").click();
    shell.bot().button(FINISH).click();
    shell.bot().waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 21
0
 // Verify we can do a double rename of configurations, renaming one
 // configuration to
 // another and then cancel without changing configuration settings.
 @Test
 public void t4doubleRenameCancel() throws Exception {
   openProperties("Autotools", "Configure Settings");
   SWTBotCombo configs = bot.comboBoxWithLabel("Configuration: ");
   bot.button("Manage Configurations...").click();
   // Rename "debug" to "release" and rename "default" to "debug".
   // The settings should follow the rename operation.
   renameConfiguration("debug", "release");
   renameConfiguration("default", "debug");
   bot.button("OK").click();
   // Verify that "release" has --enable-jeff set and that
   // the new "debug" configuration has no user setting.
   SWTBotShell shell = bot.shell("Properties for " + projectName);
   shell.activate();
   configs = bot.comboBoxWithLabel("Configuration: ");
   bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
   SWTBotText text = bot.textWithLabel("Additional command-line options");
   String setting = text.getText();
   assertEquals("--enable-jeff", setting);
   configs.setFocus();
   configs.setSelection("debug");
   bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
   text = bot.textWithLabel("Additional command-line options");
   setting = text.getText();
   assertEquals("", setting);
   bot.button("Cancel").click();
   // Cancel and then verify that "debug" is back to normal with
   // --enable-jeff set and that "default" is back to normal with
   // no user setting.
   openProperties("Autotools", "Configure Settings");
   configs = bot.comboBoxWithLabel("Configuration: ");
   configs.setSelection("debug");
   assertTrue(configs.getText().contains("debug"));
   bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
   text = bot.textWithLabel("Additional command-line options");
   setting = text.getText();
   assertEquals("--enable-jeff", setting);
   configs.setFocus();
   configs.setSelection("default");
   assertTrue(configs.getText().contains("default"));
   bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
   text = bot.textWithLabel("Additional command-line options");
   setting = text.getText();
   assertEquals("", setting);
   bot.button("OK").click();
   bot.waitUntil(Conditions.shellCloses(shell));
 }
Ejemplo n.º 22
0
  @Override
  public void confirmShellAddProjectToSession(String project, String[] files)
      throws RemoteException {
    SWTBot bot = new SWTBot();
    SWTBotShell shell = bot.shell(SHELL_ADD_PROJECTS_TO_SESSION);
    shell.activate();

    // wait for tree update
    bot.sleep(500);

    SWTBotTree tree = shell.bot().tree();

    selectProjectFiles(tree, project, files);

    shell.bot().button(FINISH).click();
    bot.waitUntil(Conditions.shellCloses(shell));
  }
Ejemplo n.º 23
0
  @Override
  public void confirmShellAddProjectsToSession(String... projectNames) throws RemoteException {

    SWTBot bot = new SWTBot();
    SWTBotShell shell = bot.shell(SHELL_ADD_PROJECTS_TO_SESSION);
    shell.activate();

    // wait for tree update
    bot.sleep(500);

    SWTBotTree tree = shell.bot().tree();

    for (String projectName : projectNames) tree.getTreeItem(projectName).check();

    shell.bot().button(FINISH).click();
    bot.waitUntil(Conditions.shellCloses(shell));
  }
  protected void createProjectAndAssertNoErrorMarker(String projectType) throws CoreException {
    bot.menu("File").menu("New").menu("Project...").click();

    SWTBotShell shell = bot.shell("New Project");
    shell.activate();
    bot.tree().expandNode("Xsemantics").select(projectType);
    bot.button("Next >").click();

    bot.textWithLabel("Project name:").setText(TEST_PROJECT);

    bot.button("Finish").click();

    // creation of a project might require some time
    bot.waitUntil(shellCloses(shell), SHELL_TIMEOUT);
    assertTrue("Project doesn't exist", isProjectCreated(TEST_PROJECT));

    waitForAutoBuild();
    assertNoErrorsInProject();
  }
Ejemplo n.º 25
0
  @Override
  public void confirmShellCreateNewXMPPAccount(JID jid, String password) throws RemoteException {
    SWTBotShell shell = new SWTBot().shell(SHELL_CREATE_XMPP_JABBER_ACCOUNT);
    shell.activate();

    shell.bot().textWithLabel(LABEL_XMPP_JABBER_SERVER).setText(jid.getDomain());
    shell.bot().textWithLabel(LABEL_USER_NAME).setText(jid.getName());
    shell.bot().textWithLabel(LABEL_PASSWORD).setText(password);
    shell.bot().textWithLabel(LABEL_REPEAT_PASSWORD).setText(password);

    shell.bot().button(FINISH).click();
    try {
      shell.bot().waitUntil(Conditions.shellCloses(shell));
    } catch (TimeoutException e) {
      String errorMessage = ((WizardDialog) shell.widget.getData()).getMessage();
      if (errorMessage.matches(ERROR_MESSAGE_TOO_FAST_REGISTER_ACCOUNTS + ".*"))
        throw new RuntimeException("you are not allowed to register accounts so fast");
      else if (errorMessage.matches(ERROR_MESSAGE_ACCOUNT_ALREADY_EXISTS + ".*\n*.*"))
        throw new RuntimeException("the Account " + jid.getBase() + " already exists");
    }
  }
Ejemplo n.º 26
0
  @Test
  public void createProject() throws Exception {
    String projectName = "prjBot-001";

    bot.menu("File").menu("New").click();
    SWTBotShell shell = bot.shell("New");
    shell.activate();
    // From menu open File > New dialog, verify whether the dialog has been opened.

    bot.tree().select("Project");
    SWTBotAssert.assertEnabled(bot.button("Next >"));
    // After selecting Project, the Next button should be enabled.

    bot.button("Next >").click();
    bot.textWithLabel("Project name:").setText(projectName);
    SWTBotAssert.assertEnabled(bot.button("Finish"));
    // Enter the Project Name, then Finish button should be enabled.

    bot.button("Finish").click();
    SWTBotAssert.assertVisible(bot.tree().select(projectName));
    // Click Finish button and verify whether the project's been successfully created.
  }
Ejemplo n.º 27
0
  @Override
  public void confirmShellAddProjectUsingWhichProject(
      String projectName, TypeOfCreateProject usingWhichProject) throws RemoteException {
    SWTBot bot = new SWTBot();
    bot.waitUntil(
        Conditions.shellIsActive(SHELL_ADD_PROJECT), SarosSWTBotPreferences.SAROS_LONG_TIMEOUT);

    SWTBotShell shell = bot.shell(SHELL_ADD_PROJECT);
    shell.activate();

    switch (usingWhichProject) {
      case NEW_PROJECT:
        confirmShellAddProjectWithNewProject(projectName);
        break;
      case EXIST_PROJECT:
        confirmShellAddProjectUsingExistProject(projectName);
        break;
      case EXIST_PROJECT_WITH_COPY:
        confirmShellAddProjectUsingExistProjectWithCopy(projectName);
        break;
    }
  }
Ejemplo n.º 28
0
  @Override
  public void confirmShellAddContactsToSession(String... baseJIDOfinvitees) throws RemoteException {

    SWTBot bot = new SWTBot();
    SWTBotShell shell = bot.shell(SHELL_ADD_CONTACT_TO_SESSION);

    shell.activate();

    // wait for tree update
    bot.sleep(500);

    SWTBotTree tree = shell.bot().tree();

    for (String baseJID : baseJIDOfinvitees)
      WidgetUtil.getTreeItemWithRegex(tree, Pattern.quote(baseJID) + ".*").check();

    shell.bot().button(FINISH).click();
    bot.waitUntil(Conditions.shellCloses(shell));

    // wait for tree update in the saros session view
    bot.sleep(500);
  }
Ejemplo n.º 29
0
  @Override
  public void confirmShellAddContact(JID jid) throws RemoteException {
    SWTBot bot = new SWTBot();
    SWTBotShell shell = bot.shell(SHELL_ADD_CONTACT_WIZARD);
    shell.activate();

    shell.bot().comboBoxWithLabel(LABEL_XMPP_JABBER_ID).setText(jid.getBase());

    shell.bot().button(FINISH).click();

    bot.sleep(500);

    for (SWTBotShell currentShell : bot.shells()) {
      // FIXME HARDCODED !
      if (currentShell.getText().equals("Contact Unknown")) {
        currentShell.bot().button(YES).click();
        break;
      }
    }
    bot.waitUntil(Conditions.shellCloses(shell));

    // wait for tree update in the saros session view
    bot.sleep(500);
  }
  @Test
  public void seamGenerateEntitiesTest() {

    bot.menu(IDELabel.Menu.FILE).menu(IDELabel.Menu.NEW).menu(IDELabel.Menu.OTHER).click();

    SWTBotShell shell = bot.shell("New");
    shell.activate();
    shell.bot().tree(0).expandNode("Seam").select("Seam Generate Entities");
    shell.bot().button(IDELabel.Button.NEXT).click();

    shell.bot().button("Browse...").click();
    shell = bot.shell("Seam Web Projects");
    shell.activate();
    shell.bot().table(0).getTableItem(Properties.SEAM_PROJECT_NAME).click();
    open.finish(shell.bot(), IDELabel.Button.OK);

    shell = bot.shell("Generate Seam Entities");
    shell.activate();
    shell
        .bot()
        .comboBoxWithLabel("Hibernate Console Configuration:")
        .setSelection(Properties.SEAM_PROJECT_NAME);
    shell.bot().radio("Reverse engineer from database").click();
    shell.bot().button(IDELabel.Button.NEXT).click();

    shell.bot().button("Refresh").click();
    shell.bot().sleep(TIME_5S);

    SWTBotTreeItem item = shell.bot().tree(0).getTreeItem("ModeShape");
    item.expand();
    shell.bot().sleep(TIME_5S);
    item = item.getNode("ModeShape");
    item.expand();
    shell.bot().sleep(TIME_5S);
    item = item.getNode("xmi_model");
    item.select();

    shell.bot().button("Include...").click();

    assertTrue(shell.bot().table(0).cell(0, "Catalog").equals("ModeShape"));
    assertTrue(shell.bot().table(0).cell(0, "Schema").equals("ModeShape"));
    assertTrue(shell.bot().table(0).cell(0, "Table").equals("xmi_model"));

    open.finish(shell.bot());

    assertTrue(
        SWTTestExt.projectExplorer.existsResource(
            Properties.SEAM_PROJECT_NAME,
            "src",
            "main",
            "org",
            "domain",
            Properties.SEAM_PROJECT_NAME,
            "entity",
            "XmiModel.java"));

    assertTrue(
        SWTTestExt.projectExplorer.existsResource(
            Properties.SEAM_PROJECT_NAME,
            "src",
            "main",
            "org",
            "domain",
            Properties.SEAM_PROJECT_NAME,
            "entity",
            "XmiModelId.java"));
  }