Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2018-08-07 04:01:38 -0400
committerThomas Wolf2018-08-07 04:01:38 -0400
commit6722dd695680ac4cd1e53007c38a788d704615d5 (patch)
tree0d8c52b4f48c4eadbc680c1b57d54ac23ddac7e6 /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test
parent9a2209c3b02a34e8fcd409ea897f9743905cc543 (diff)
downloadegit-6722dd695680ac4cd1e53007c38a788d704615d5.tar.gz
egit-6722dd695680ac4cd1e53007c38a788d704615d5.tar.xz
egit-6722dd695680ac4cd1e53007c38a788d704615d5.zip
[releng] Fix test failures
StagingViewTest also uses the git repositories view and therefore must use the same mechanisms as the other git repositories view tests to avoid leaking references to repository tree nodes across tests. Also fix an NPE during tests in FileDiffContentProvider: make sure the UI update doesn't run if the content provider has been disposed already. Change-Id: Ib08ce78e4f76207adfa0920b3cfa94d55186a706 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/AbstractStagingViewTestCase.java19
1 files changed, 5 insertions, 14 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();
}

Back to the top