use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class GitRepositoriesViewFetchAndPushTest method runFetch.
private void runFetch(SWTBotTree tree) {
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.FETCH, 60, TimeUnit.SECONDS);
ContextMenuHelper.clickContextMenuSync(tree, myUtil.getPluginLocalizedValue("SimpleFetchCommand"));
TestUtil.openJobResultDialog(jobJoiner.join());
}
use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class GitRepositoriesViewFetchAndPushTest method runPush.
private void runPush(SWTBotTree tree) {
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.PUSH, 60, TimeUnit.SECONDS);
ContextMenuHelper.clickContextMenuSync(tree, myUtil.getPluginLocalizedValue("SimplePushCommand"));
TestUtil.openJobResultDialog(jobJoiner.join());
}
use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class PushActionTest method pushTo.
private void pushTo(String destination, boolean withConfirmPage) throws Exception, MissingObjectException, IncorrectObjectTypeException, IOException {
Repository repo = lookupRepository(remoteRepositoryFile);
try (RevWalk rw = new RevWalk(repo)) {
String previous = rw.parseCommit(repo.resolve("HEAD")).name();
touchAndSubmit(null);
SWTBotShell pushDialog = openPushDialog();
SWTBotCombo destinationCombo = pushDialog.bot().comboBox();
String[] items = destinationCombo.items();
for (int i = 0; i < items.length; i++) {
if (items[i].startsWith(destination))
destinationCombo.setSelection(i);
}
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
if (withConfirmPage) {
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
}
JobJoiner joiner = JobJoiner.startListening(JobFamilies.PUSH, 20, TimeUnit.SECONDS);
pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
TestUtil.openJobResultDialog(joiner.join());
String title = NLS.bind(UIText.PushResultDialog_title, destination);
bot.waitUntil(Conditions.shellIsActive(title));
SWTBotShell confirm = bot.shell(title);
String result = confirm.bot().tree().getAllItems()[0].getText();
assertTrue("Wrong result", result.contains(previous.substring(0, 7)));
confirm.close();
pushDialog = openPushDialog();
destinationCombo = pushDialog.bot().comboBox();
for (int i = 0; i < items.length; i++) {
if (items[i].startsWith(destination))
destinationCombo.setSelection(i);
}
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
if (withConfirmPage) {
pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
}
joiner = JobJoiner.startListening(JobFamilies.PUSH, 20, TimeUnit.SECONDS);
pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
TestUtil.openJobResultDialog(joiner.join());
bot.waitUntil(Conditions.shellIsActive(title));
confirm = bot.shell(title);
result = confirm.bot().tree().getAllItems()[0].getText();
confirm.close();
assertTrue("Wrong result", result.contains(UIText.PushResultTable_statusUpToDate));
}
}
Aggregations