use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class AbstractSynchronizeViewTest method launchSynchronization.
protected void launchSynchronization(String projectName, String srcRef, String dstRef, boolean includeLocal) throws IOException {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
RepositoryMapping mapping = assertConnected(project);
Repository repo = mapping.getRepository();
GitSynchronizeData data = new GitSynchronizeData(repo, srcRef, dstRef, includeLocal);
JobJoiner jobJoiner = JobJoiner.startListening(ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60, TimeUnit.SECONDS);
GitModelSynchronize.launch(data, new IResource[] { project });
jobJoiner.join();
}
use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class CommitActionStagingViewTest method assertCommitWithAutoStage.
private void assertCommitWithAutoStage(boolean withUntracked) throws Exception {
Activator.getDefault().getPreferenceStore().setValue(UIPreferences.AUTO_STAGE_ON_COMMIT, true);
boolean initialIncludeUntracked = Activator.getDefault().getPreferenceStore().getBoolean(UIPreferences.COMMIT_DIALOG_INCLUDE_UNTRACKED);
Activator.getDefault().getPreferenceStore().setValue(UIPreferences.COMMIT_DIALOG_INCLUDE_UNTRACKED, withUntracked);
String newFile = "newFile.txt";
try {
setTestFileContent("I have changed this");
touch(PROJ1, newFile, "New file content");
SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
util.getProjectItems(projectExplorerTree, PROJ1)[0].select();
String menuString = util.getPluginLocalizedValue("CommitAction_label");
JobJoiner joiner = JobJoiner.startListening(ADD_TO_INDEX, 10, TimeUnit.SECONDS);
ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team", menuString);
joiner.join();
TestUtil.joinJobs(JobFamilies.INDEX_DIFF_CACHE_UPDATE);
TestUtil.waitUntilViewWithGivenIdShows(StagingView.VIEW_ID);
StagingUtil.assertStaging(PROJ1, FOLDER + '/' + FILE1, true);
StagingUtil.assertStaging(PROJ1, newFile, withUntracked);
} finally {
Activator.getDefault().getPreferenceStore().setValue(UIPreferences.COMMIT_DIALOG_INCLUDE_UNTRACKED, initialIncludeUntracked);
}
}
use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class CompareActionsTest method testCompareWithRef.
@Test
public void testCompareWithRef() throws Exception {
String compareWithRefActionLabel = util.getPluginLocalizedValue("CompareWithBranchOrTagAction.label");
String dialogTitle = UIText.CompareTargetSelectionDialog_WindowTitle;
SWTBotShell dialog = openCompareWithDialog(compareWithRefActionLabel, dialogTitle);
// use the default (the last commit) -> no changes
JobJoiner jobJoiner = JobJoiner.startListening(ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60, TimeUnit.SECONDS);
dialog.bot().button(UIText.CompareTargetSelectionDialog_CompareButton).click();
jobJoiner.join();
closeFirstEmptySynchronizeDialog();
assertSynchronizeNoChange();
// use the tag -> should have a change
dialog = openCompareWithDialog(compareWithRefActionLabel, dialogTitle);
SWTBotTreeItem tags = TestUtil.expandAndWait(dialog.bot().tree().getTreeItem(TAGS));
TestUtil.getChildNode(tags, "SomeTag").select();
jobJoiner = JobJoiner.startListening(ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60, TimeUnit.SECONDS);
dialog.bot().button(UIText.CompareTargetSelectionDialog_CompareButton).click();
jobJoiner.join();
assertSynchronizeFile1Changed();
}
use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class CompareActionsTest method clickCompareWithAndWaitForSync.
private void clickCompareWithAndWaitForSync(String menuLabel) {
JobJoiner jobJoiner = JobJoiner.startListening(ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60, TimeUnit.SECONDS);
clickCompareWith(menuLabel);
jobJoiner.join();
}
use of org.eclipse.egit.ui.test.JobJoiner in project egit by eclipse.
the class FetchAndMergeActionTest method fetch.
private void fetch() throws Exception {
SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
getProjectItem(projectExplorerTree, PROJ1).select();
String menuString = util.getPluginLocalizedValue("FetchFromUpstreamAction.label");
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.FETCH, 20, TimeUnit.SECONDS);
ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team", menuString);
TestUtil.openJobResultDialog(jobJoiner.join());
}
Aggregations