Esempio n. 1
0
  @Override
  public void confirmShellAddProjects(String projectName, TypeOfCreateProject usingWhichProject)
      throws RemoteException {

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

    SWTBotShell shell = bot.shell(SHELL_ADD_PROJECTS);

    switch (usingWhichProject) {
      case NEW_PROJECT:
        shell.bot().radio(RADIO_CREATE_NEW_PROJECT).click();
        break;
      case EXIST_PROJECT:
        shell.bot().radio(RADIO_USING_EXISTING_PROJECT).click();
        shell.bot().textWithLabel("Project name", 1).setText(projectName);
        break;
      case EXIST_PROJECT_WITH_COPY:
        shell.bot().radio("Use existing project").click();
        shell.bot().checkBox("Create copy for working distributed. New project name:").click();
        break;
    }

    shell.bot().button(FINISH).click();
    bot.waitUntil(Conditions.shellCloses(shell));
  }
Esempio n. 2
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));
  }
Esempio n. 3
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));
 }
Esempio n. 4
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));
 }
Esempio n. 5
0
  @Override
  public void confirmShellSessionInvitationAndShellAddProject(
      String projectName, TypeOfCreateProject usingWhichProject) throws RemoteException {

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

    SWTBotShell invitationShell = bot.shell(SHELL_SESSION_INVITATION);
    invitationShell.bot().button(ACCEPT).click();

    bot.waitUntil(
        Conditions.shellCloses(invitationShell), SarosSWTBotPreferences.SAROS_LONG_TIMEOUT);

    confirmShellAddProjectUsingWhichProject(projectName, usingWhichProject);
    views().sarosView().waitUntilIsInSession();
  }
Esempio n. 6
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);
  }
Esempio n. 7
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));
  }
Esempio n. 8
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));
  }
Esempio n. 9
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));
  }
Esempio n. 10
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));
  }
Esempio 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));
  }
Esempio n. 12
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);
  }
Esempio n. 13
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;
    }
  }
Esempio n. 14
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);
  }
 public void waitForClose() {
   mBot.waitUntil(shellCloses(mShell));
 }
 public StrategyAgentEngine waitForClose() {
   mBot.waitUntil(shellCloses(mShell));
   return mWizard == null ? null : mWizard.getResult();
 }