@Test
public void testRenameBranch() throws Exception {
SWTBotShell dialog = openRenameBranchDialog();
SWTBotTreeItem localBranches = dialog.bot().tree()
.getTreeItem(LOCAL_BRANCHES).expand();
TestUtil.getChildNode(localBranches, "stable").select();
dialog.bot().button(UIText.RenameBranchDialog_RenameButtonLabel)
.click();
// rename stable to renamed
SWTBotShell newNameDialog = bot
.shell(UIText.RenameBranchDialog_RenameBranchDialogNewNameInputWindowTitle);
newNameDialog.bot().text().setText("master");
assertFalse(newNameDialog.bot().button(IDialogConstants.OK_LABEL)
.isEnabled());
newNameDialog.bot().text().setText("renamed");
newNameDialog.bot().button(IDialogConstants.OK_LABEL).click();
TestUtil.joinJobs(JobFamilies.CHECKOUT);
dialog = openRenameBranchDialog();
SWTBotTreeItem localBranches2 = dialog.bot().tree().getTreeItem(LOCAL_BRANCHES).expand();
TestUtil.getChildNode(localBranches2, "renamed").select();
dialog.bot().button(UIText.RenameBranchDialog_RenameButtonLabel)
.click();
// rename renamed to stable
newNameDialog = bot
.shell(UIText.RenameBranchDialog_RenameBranchDialogNewNameInputWindowTitle);
newNameDialog.bot().text().setText("stable");
newNameDialog.bot().button(IDialogConstants.OK_LABEL).click();
TestUtil.joinJobs(JobFamilies.CHECKOUT);
dialog = openRenameBranchDialog();
SWTBotTreeItem localBranches3 = dialog.bot().tree()
.getTreeItem(LOCAL_BRANCHES).expand();
TestUtil.getChildNode(localBranches3, "stable").select();
dialog.close();
}