// start wizard from PROJ2
myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand().getNode(
PROJ2).select();
ContextMenuHelper.clickContextMenu(tree, myUtil
.getPluginLocalizedValue("ImportProjectsCommand"));
SWTBotShell shell = bot.shell(wizardTitle);
shell = bot.shell(wizardTitle);
// try import existing project first
bot.radio(UIText.GitSelectWizardPage_ImportExistingButton).click();
TableCollection selected = shell.bot().tree().selection();
String wizardNode = selected.get(0, 0);
// wizard directory should be PROJ2
assertEquals(PROJ2, wizardNode);
shell.bot().button(IDialogConstants.NEXT_LABEL).click();
shell.bot().text(" " + UIText.GitProjectsImportPage_NoProjectsMessage);
assertEquals(0, shell.bot().tree().getAllItems().length);
shell.bot().button(IDialogConstants.BACK_LABEL).click();
// import as general
shell.bot().radio(UIText.GitSelectWizardPage_ImportAsGeneralButton).click();
shell.bot().button(IDialogConstants.NEXT_LABEL).click();
assertEquals(PROJ2, shell.bot().textWithLabel(
UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText());
// switch to a sub directory and see if this is used
shell.bot().button(IDialogConstants.BACK_LABEL).click();
shell.bot().tree().getAllItems()[0].expand().getNode(PROJ2).expand()
.getNode(FOLDER).select();
shell.bot().button(IDialogConstants.NEXT_LABEL).click();
String name = shell.bot().textWithLabel(
UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText();
assertEquals(FOLDER, name);
shell.bot().button(IDialogConstants.BACK_LABEL).click();
// switch back to the root directory
shell.bot().tree().getAllItems()[0].expand().getNode(PROJ2).select();
shell.bot().button(IDialogConstants.NEXT_LABEL).click();
assertEquals(PROJ2, shell.bot().textWithLabel(
UIText.GitCreateGeneralProjectPage_ProjectNameLabel).getText());
shell.bot().button(IDialogConstants.FINISH_LABEL).click();
bot.waitUntil(Conditions.shellCloses(shell));
assertProjectExistence(PROJ2, true);
assertProjectIsShared(PROJ2, true);
}