@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.º 2
0
  @Test
  public void shouldUpdateTrackingBranchOnPush() throws Exception {
    makeChangesAndCommit(PROJ1);
    Repository repository = lookupRepository(repositoryFile);
    ObjectId headId = repository.resolve(Constants.HEAD);

    String trackingBranch = Constants.R_REMOTES + "origin/master";
    launchSynchronization(Constants.HEAD, trackingBranch, false);

    SWTBotView viewBot = bot.viewByTitle("Synchronize");
    SWTBotToolbarButton pushButton = viewBot.toolbarButton(UIText.GitActionContributor_Push);
    JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.PUSH, 30, TimeUnit.SECONDS);
    pushButton.click();
    jobJoiner.join();

    String destinationString = repositoryFile.getParentFile().getName() + " - " + "origin";
    SWTBotShell resultDialog =
        bot.shell(NLS.bind(UIText.PushResultDialog_title, destinationString));
    resultDialog.close();

    Repository remoteRepository = lookupRepository(childRepositoryFile);
    ObjectId masterOnRemote = remoteRepository.resolve("master");
    assertThat("Expected push to update branch on remote repository", masterOnRemote, is(headId));

    ObjectId trackingId = repository.resolve(trackingBranch);
    assertThat("Expected tracking branch to be updated", trackingId, is(headId));
  }
Ejemplo n.º 3
0
  @Test
  public void testDeleteMultipleBranches() throws Exception {
    // expand first level
    SWTBotTree tree = getOrOpenView().bot().tree();
    refreshAndWait();
    // open a branch (checkout)
    SWTBotTreeItem localBranchesItem =
        myRepoViewUtil.getLocalBranchesItem(tree, repositoryFile).expand();
    SWTBotTreeItem masterNode = localBranchesItem.getNode("master");
    // create first branch (abc)
    masterNode.select();
    ContextMenuHelper.clickContextMenu(tree, "Create Branch...");
    SWTBotShell createBranchShell = bot.shell(UIText.CreateBranchWizard_NewBranchTitle);
    createBranchShell.bot().textWithId("BranchName").setText("abc");
    createBranchShell.bot().checkBox(UIText.CreateBranchPage_CheckoutButton).deselect();
    createBranchShell.bot().button(IDialogConstants.FINISH_LABEL).click();
    // create second branch (123)
    ContextMenuHelper.clickContextMenu(tree, "Create Branch...");
    createBranchShell = bot.shell(UIText.CreateBranchWizard_NewBranchTitle);
    createBranchShell.bot().textWithId("BranchName").setText("123");
    createBranchShell.bot().checkBox(UIText.CreateBranchPage_CheckoutButton).deselect();
    createBranchShell.bot().button(IDialogConstants.FINISH_LABEL).click();
    refreshAndWait();
    localBranchesItem = myRepoViewUtil.getLocalBranchesItem(tree, repositoryFile).expand();
    // delete both
    localBranchesItem.select("abc", "123");
    ContextMenuHelper.clickContextMenuSync(
        tree, myUtil.getPluginLocalizedValue("RepoViewDeleteBranch.label"));
    refreshAndWait();

    SWTBotTreeItem[] items = myRepoViewUtil.getLocalBranchesItem(tree, repositoryFile).getItems();
    assertEquals("Wrong number of branches", 2, items.length);
    assertEquals("master", items[0].getText());
    assertEquals("stable", items[1].getText());
  }
 @Test
 // (Test Cases for 1.8) test case 6
 public void testNtNumericCacheSizeOKPressed() throws Exception {
   Utility.createProject(Messages.projCache);
   SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1);
   wabot.checkBox().select();
   // Cache size = alphabet
   // typeText and setting focus on OK is IMP.
   wabot.textWithLabel(Messages.cachScaleLbl).setText("");
   wabot.textWithLabel(Messages.cachScaleLbl).typeText("ab");
   wabot.button("OK").setFocus();
   wabot.button("OK").click();
   SWTBotShell errorShell = wabot.shell(Messages.cachPerErrTtl).activate();
   Boolean alphabtErr = errorShell.getText().equals(Messages.cachPerErrTtl);
   wabot.button("OK").click();
   // Cache size = special character
   wabot.textWithLabel(Messages.cachScaleLbl).setText("");
   wabot.textWithLabel(Messages.cachScaleLbl).typeText("#*");
   wabot.button("OK").setFocus();
   wabot.button("OK").click();
   errorShell = wabot.shell(Messages.cachPerErrTtl).activate();
   Boolean splCharErr = errorShell.getText().equals(Messages.cachPerErrTtl);
   wabot.button("OK").click();
   assertTrue("testNtNumericCacheSizeOKPressed", alphabtErr && splCharErr);
   propShell.close();
 }
  @Test
  public void testResetToTag() throws Exception {
    SWTBotTree tree = getOrOpenView().bot().tree();

    String initialContent = getTestFileContent();
    createTag("ResetToFirst", "The first tag");
    touchAndSubmit(null);
    String newContent = getTestFileContent();
    assertFalse("Wrong content", initialContent.equals(newContent));
    createTag("ResetToSecond", "The second tag");
    refreshAndWait();
    myRepoViewUtil.getTagsItem(tree, repositoryFile).expand().getNode("ResetToFirst").select();

    ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("ResetCommand"));

    SWTBotShell resetDialog = bot.shell(UIText.ResetCommand_WizardTitle);
    resetDialog.bot().radio(UIText.ResetTargetSelectionDialog_ResetTypeHardButton).click();
    resetDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
    TestUtil.joinJobs(JobFamilies.RESET);

    bot.shell(UIText.ResetTargetSelectionDialog_ResetQuestion)
        .bot()
        .button(IDialogConstants.YES_LABEL)
        .click();

    Job.getJobManager().join(JobFamilies.RESET, null);

    ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
    assertEquals("Wrong content", initialContent, getTestFileContent());
  }
  @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();
  }
Ejemplo n.º 7
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));
  }
Ejemplo n.º 8
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));
 }
Ejemplo n.º 9
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.º 10
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.º 11
0
 private void checkoutWithDoubleClick(SWTBotTree tree, String branch) throws Exception {
   myRepoViewUtil
       .getLocalBranchesItem(tree, repositoryFile)
       .expand()
       .getNode(branch)
       .doubleClick();
   SWTBotShell shell = bot.shell(UIText.RepositoriesView_CheckoutConfirmationTitle);
   shell.bot().button(IDialogConstants.OK_LABEL).click();
   refreshAndWait();
 }
  @Test
  public void createSeamProject() {

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

    SWTBotShell shell = bot.shell("New");
    shell.bot().tree(0).expandNode("Seam").select("Seam Web Project");
    shell.bot().button(IDELabel.Button.NEXT).click();
    shell.bot().textWithLabel("Project name:").setText(Properties.SEAM_PROJECT_NAME);
    shell.bot().button(IDELabel.Button.NEXT).click();
    shell.bot().button(IDELabel.Button.NEXT).click();
    shell.bot().button(IDELabel.Button.NEXT).click();
    shell.bot().button(IDELabel.Button.NEXT).click();

    shell.bot().comboBoxWithLabel("Database Type:").setSelection("Teiid");
    shell
        .bot()
        .comboBoxWithLabel("Connection profile:")
        .setSelection(Properties.SEAM_CONNPROFILE_NAME);
    shell.bot().checkBoxWithLabel("Create Test Project:").deselect();
    open.finish(shell.bot());

    bot.sleep(TIME_10S);

    assertTrue(SWTTestExt.projectExplorer.existsResource(Properties.SEAM_PROJECT_NAME));
  }
Ejemplo n.º 13
0
  @Test
  public void shareProjectWithExternalRepo() throws Exception {
    String repoName = "ExternalRepositoryForShare";
    createProject(projectName0);
    String location1 = createProject(projectName1);
    String location2 = createProject(projectName2);
    createProject(projectName3);

    ExistingOrNewPage existingOrNewPage = sharingWizard.openWizard(projectName1, projectName2);
    SWTBotShell createRepoDialog = existingOrNewPage.clickCreateRepository();
    String repoDir =
        Activator.getDefault().getPreferenceStore().getString(UIPreferences.DEFAULT_REPO_DIR);
    File repoFolder = new File(repoDir, repoName);
    createRepoDialog
        .bot()
        .textWithLabel(UIText.CreateRepositoryPage_DirectoryLabel)
        .setText(repoFolder.getAbsolutePath());
    createRepoDialog.bot().button(IDialogConstants.FINISH_LABEL).click();

    SWTBotCombo combo = bot.comboBoxWithLabel(UIText.ExistingOrNewPage_ExistingRepositoryLabel);
    assertTrue(combo.getText().startsWith(repoName));
    Repository targetRepo = lookupRepository(new File(repoFolder, Constants.DOT_GIT));

    assertTrue(combo.getText().endsWith(targetRepo.getDirectory().getPath()));
    assertEquals(
        targetRepo.getWorkTree().getPath(),
        bot.textWithLabel(UIText.ExistingOrNewPage_WorkingDirectoryLabel).getText());
    String[][] contents = new String[2][3];
    contents[0][0] = projectName1;
    contents[0][1] = new Path(location1).toString();
    contents[0][2] = new Path(targetRepo.getWorkTree().getPath()).append(projectName1).toString();

    contents[1][0] = projectName2;
    contents[1][1] = new Path(location2).toString();
    contents[1][2] = new Path(targetRepo.getWorkTree().getPath()).append(projectName2).toString();
    existingOrNewPage.assertTableContents(contents);

    existingOrNewPage.setRelativePath("a/b");

    contents[0][2] =
        new Path(targetRepo.getWorkTree().getPath()).append("a/b").append(projectName1).toString();
    contents[1][2] =
        new Path(targetRepo.getWorkTree().getPath()).append("a/b").append(projectName2).toString();
    existingOrNewPage.assertTableContents(contents);

    bot.button(IDialogConstants.FINISH_LABEL).click();
    Thread.sleep(1000);
    String location1Path =
        ResourcesPlugin.getWorkspace().getRoot().getProject(projectName1).getLocation().toString();
    assertEquals(contents[0][2], location1Path);
    String location2Path =
        ResourcesPlugin.getWorkspace().getRoot().getProject(projectName2).getLocation().toString();
    assertEquals(contents[1][2], location2Path);
  }
Ejemplo n.º 14
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.º 15
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);
  }
 private void createTag(String name, String message) throws Exception {
   SWTBotTree tree = getOrOpenView().bot().tree();
   myRepoViewUtil.getTagsItem(tree, repositoryFile).select();
   ContextMenuHelper.clickContextMenu(tree, myUtil.getPluginLocalizedValue("CreateTagCommand"));
   String shellTitle = UIText.CreateTagDialog_NewTag;
   SWTBotShell createDialog = bot.shell(shellTitle).activate();
   TestUtil.joinJobs(JobFamilies.FILL_TAG_LIST);
   createDialog.bot().textWithLabel(UIText.CreateTagDialog_tagName).setText(name);
   createDialog.bot().styledTextWithLabel(UIText.CreateTagDialog_tagMessage).setText(message);
   createDialog.bot().button(IDialogConstants.OK_LABEL).click();
   TestUtil.joinJobs(JobFamilies.TAG);
 }
Ejemplo n.º 17
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();
 }
  @BeforeClass
  public static void beforeClass() {
    openPerspective("Seam (default)");

    bot.menu(IDELabel.Menu.FILE).menu(IDELabel.Menu.NEW).menu(IDELabel.Menu.OTHER).click();
    SWTBotShell shell = bot.shell("New");
    shell.bot().tree(0).expandNode("General").select("Project");
    shell.bot().button(IDELabel.Button.NEXT).click();
    shell.bot().textWithLabel("Project name:").setText(TEMP_PROJECT);
    open.finish(shell.bot());

    setupConnection();
  }
 @Test
 // (Test Cases for 1.8) test case 1
 public void testCachingPagePresent() throws Exception {
   Utility.createProject(Messages.projCache);
   SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1);
   assertTrue(
       "testCachingPagePresent",
       wabot.checkBox().isEnabled()
           && !wabot.checkBox().isChecked()
           && wabot.button("OK").isEnabled()
           && wabot.button("Cancel").isEnabled());
   propShell.close();
 }
 @Test
 // (Test Cases for 1.8) test case 3
 public void testDisableCaching() throws Exception {
   Utility.createProject(Messages.projCache);
   SWTBotShell propShell = Utility.selCacheUsingCnxtMenu(Messages.projCache, Messages.role1);
   // check
   wabot.checkBox().select();
   /*
    * To avoid missing storage account error,
    * type some value. Requires typeText only.
    */
   wabot.textWithLabel(Messages.keyLbl).typeText("a");
   wabot.textWithLabel(Messages.nameLbl).typeText("a");
   Utility.selEndPtPage();
   Boolean endPtPresent =
       wabot
               .table()
               .cell(1, 0)
               .equals(String.format("%s%s", Messages.cachEndPtName, Messages.dfltCachName))
           && wabot.table().cell(1, 1).equals(Messages.typeIntrnl)
           && wabot.table().cell(1, 3).equals("11211");
   Utility.selLclStrPage(Messages.role1);
   Boolean LclStrPresent =
       wabot.table().cell(0, 0).equals(Messages.cachLclStr)
           && wabot.table().cell(0, 1).equals("20000");
   Utility.selCachePage(Messages.role1);
   // un-check
   wabot.checkBox().click();
   Boolean isDisabled =
       !wabot.checkBox().isChecked()
           && !wabot.label(Messages.cachScaleLbl).isEnabled()
           && !wabot.label(Messages.hostLbl).isEnabled()
           && !wabot.button(Messages.roleAddBtn).isEnabled()
           && !wabot.button(Messages.roleEditBtn).isEnabled()
           && !wabot.label(Messages.keyLbl).isEnabled()
           && !wabot.label(Messages.nameLbl).isEnabled()
           && !wabot.table().isEnabled()
           && !wabot.textWithLabel(Messages.cachScaleLbl).isEnabled()
           && !wabot.scale().isEnabled();
   // Once caching disabled, no storage account warning
   Utility.selEndPtPage();
   Boolean endPtRmv =
       !wabot
           .table()
           .containsItem(String.format("%s%s", Messages.cachEndPtName, Messages.dfltCachName));
   propShell = Utility.selLclStrPage(Messages.role1);
   Boolean lclStrRmv = !wabot.table().containsItem(Messages.cachLclStr);
   assertTrue(
       "testDisableCaching", endPtPresent && LclStrPresent && isDisabled && endPtRmv && lclStrRmv);
   propShell.close();
 }
Ejemplo n.º 21
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.º 22
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.º 23
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.º 24
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.º 25
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.º 26
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.º 27
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));
 }
  // DONE!
  public SWTBotGefEditPart addValidate(SWTBotGefEditPart toPart, String name, String... variables) {
    appendActivity(toPart, "Validate", name);
    SWTBot propsBot = propsView.bot();
    propsView.selectTab(1);
    propsBot.button("Add").click();

    SWTBotShell shell = bot.shell("Select Variable").activate();
    SWTBot viewBot = shell.bot();
    SWTBotTable table = viewBot.table();
    table.select(variables);
    viewBot.button("OK").click();

    save();
    SWTBotGefEditPart added = getEditPart(toPart, name);
    //		log.info("Added [part=" + added + ", name=" + name + "]");
    return added;
  }
Ejemplo n.º 29
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.º 30
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));
  }