}
@Test
public void testCreateDeleteLocalBranchWithUnmerged() throws Exception {
final SWTBotView view = getOrOpenView();
SWTBotTreeItem localItem = myRepoViewUtil.getLocalBranchesItem(view
.bot().tree(), repositoryFile);
localItem.expand();
assertEquals("Wrong number of children", 1, localItem.getNodes().size());
assertEquals("master", localItem.getNodes().get(0));
localItem.getNode(0).select();
ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
.getPluginLocalizedValue("CreateBranchCommand"));
SWTBotShell createPage = bot
.shell(UIText.CreateBranchWizard_NewBranchTitle);
createPage.activate();
// getting text with label doesn't work
createPage.bot().textWithId("BranchName").setText("newLocal");
createPage.bot().checkBox(UIText.CreateBranchPage_CheckoutButton)
.select();
createPage.bot().button(IDialogConstants.FINISH_LABEL).click();
TestUtil.joinJobs(JobFamilies.CHECKOUT);
refreshAndWait();
localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
repositoryFile);
localItem.expand();
assertEquals("Wrong number of children", 2, localItem.getNodes().size());
touchAndSubmit("Some more changes");
localItem.getNode(1).select();
assertCheckoutNotAvailable(view);
localItem.getNode(0).select();
ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
.getPluginLocalizedValue("CheckoutCommand"));
TestUtil.joinJobs(JobFamilies.CHECKOUT);
localItem.getNode(1).select();
refreshAndWait();
ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
.getPluginLocalizedValue("RepoViewDeleteBranch.label"));
SWTBotShell confirmPopup = bot
.shell(UIText.UnmergedBranchDialog_Title);
confirmPopup.activate();
confirmPopup.bot().button(IDialogConstants.OK_LABEL).click();
refreshAndWait();
localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
repositoryFile);
localItem.expand();
assertEquals("Wrong number of children", 1, localItem.getNodes().size());
}