コード例 #1
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());
  }
コード例 #2
0
 /**
  * Show properties
  *
  * @throws Exception
  */
 @Test
 public void testShowProperties() throws Exception {
   SWTBotTree tree = getOrOpenView().bot().tree();
   SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile);
   item.select();
   ContextMenuHelper.clickContextMenuSync(
       tree, myUtil.getPluginLocalizedValue("ShowIn"), "Properties");
   SWTBotView propertieView = bot.viewById(IPageLayout.ID_PROP_SHEET);
   assertTrue(propertieView.isActive());
 }
コード例 #3
0
 private void runFetch(SWTBotTree tree) {
   JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.FETCH, 60, TimeUnit.SECONDS);
   ContextMenuHelper.clickContextMenuSync(
       tree, myUtil.getPluginLocalizedValue("SimpleFetchCommand"));
   jobJoiner.join();
 }