Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/AbstractStagingViewTestCase.java19
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java4
2 files changed, 8 insertions, 15 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/AbstractStagingViewTestCase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/AbstractStagingViewTestCase.java
index 1bc05fa6d..4f00384fc 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/AbstractStagingViewTestCase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/AbstractStagingViewTestCase.java
@@ -14,22 +14,16 @@ import java.io.File;
import org.eclipse.egit.core.JobFamilies;
import org.eclipse.egit.ui.Activator;
-import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
-import org.eclipse.egit.ui.internal.repository.RepositoriesView;
-import org.eclipse.egit.ui.internal.staging.StagingView;
import org.eclipse.egit.ui.test.TestUtil;
-import org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTestUtils;
+import org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTestBase;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.After;
import org.junit.Before;
public abstract class AbstractStagingViewTestCase
- extends LocalRepositoryTestCase {
-
- protected static final GitRepositoriesViewTestUtils repoViewUtil = new GitRepositoriesViewTestUtils();
+ extends GitRepositoriesViewTestBase {
protected File repositoryFile;
@@ -48,8 +42,7 @@ public abstract class AbstractStagingViewTestCase
@After
public void after() {
- TestUtil.hideView(RepositoriesView.VIEW_ID);
- TestUtil.hideView(StagingView.VIEW_ID);
+ repository = null;
Activator.getDefault().getRepositoryUtil().removeDir(repositoryFile);
}
@@ -59,11 +52,9 @@ public abstract class AbstractStagingViewTestCase
}
protected void selectRepositoryNode() throws Exception {
- SWTBotView repositoriesView = TestUtil
- .showView(RepositoriesView.VIEW_ID);
- SWTBotTree tree = repositoriesView.bot().tree();
+ SWTBotTree tree = getOrOpenView().bot().tree();
- SWTBotTreeItem repoNode = repoViewUtil.getRootItem(tree,
+ SWTBotTreeItem repoNode = myRepoViewUtil.getRootItem(tree,
repositoryFile);
repoNode.select();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java
index 1ed9ccf2b..9c7c26ed2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java
@@ -32,6 +32,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
import org.eclipse.jgit.treewalk.filter.TreeFilter;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.progress.UIJob;
/**
@@ -182,7 +183,8 @@ public class FileDiffContentProvider implements IStructuredContentProvider {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
- if (viewer.getControl().isDisposed() || loader != loadJob) {
+ Control control = viewer == null ? null : viewer.getControl();
+ if (control == null || control.isDisposed() || loader != loadJob) {
return Status.CANCEL_STATUS;
}
diff = loadJob.getDiffs();

Back to the top