Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2017-11-20 06:47:01 -0500
committerThomas Wolf2017-11-20 06:47:25 -0500
commit9d32236c6ab1ffeeb409b5d7fe5e48c931d468e8 (patch)
treea2c0b0618e8cc642dc2298a9bfd504209478d7d4 /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test
parent57165160364942a1e0215cbf63a43863174f285d (diff)
downloadegit-9d32236c6ab1ffeeb409b5d7fe5e48c931d468e8.tar.gz
egit-9d32236c6ab1ffeeb409b5d7fe5e48c931d468e8.tar.xz
egit-9d32236c6ab1ffeeb409b5d7fe5e48c931d468e8.zip
[test stability] CompareActionsTest assumes resource model
The CompareActionsTest uses the synchronize view and expects the resource model to be active. Other tests may have changed that setting, though, and then these tests may fail. Therefore set the active model provider explicitly. All tests using the synchronize view must set the expected model provider(s). Change-Id: Ib3eaadf48e386395a215feed8a350a807236b555 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/team/actions/CompareActionsTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
index f863e9b2f..df76d02b5 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CompareActionsTest.java
@@ -24,6 +24,7 @@ import java.io.File;
import java.util.concurrent.TimeUnit;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.egit.core.op.ResetOperation;
import org.eclipse.egit.core.op.TagOperation;
@@ -55,6 +56,9 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.TeamUI;
+import org.eclipse.team.ui.mapping.ITeamContentProviderDescriptor;
+import org.eclipse.team.ui.mapping.ITeamContentProviderManager;
import org.eclipse.team.ui.synchronize.ISynchronizeManager;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.junit.Before;
@@ -77,6 +81,7 @@ public class CompareActionsTest extends LocalRepositoryTestCase {
Repository repo = lookupRepository(repositoryFile);
disablePerspectiveSwitchPrompt();
+ setEnabledModelProvider(ModelProvider.RESOURCE_MODEL_PROVIDER_ID);
TagBuilder tag = new TagBuilder();
tag.setTag("SomeTag");
@@ -97,6 +102,15 @@ public class CompareActionsTest extends LocalRepositoryTestCase {
repo));
}
+ private static void setEnabledModelProvider(String modelProviderId) {
+ ITeamContentProviderManager contentProviderManager = TeamUI
+ .getTeamContentProviderManager();
+ ITeamContentProviderDescriptor descriptor = contentProviderManager
+ .getDescriptor(modelProviderId);
+ contentProviderManager.setEnabledDescriptors(
+ new ITeamContentProviderDescriptor[] { descriptor });
+ }
+
@SuppressWarnings("restriction")
private static void disablePerspectiveSwitchPrompt() {
// disable perspective synchronize selection

Back to the top