Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-04-16 16:55:44 -0400
committerAndrew Gvozdev2012-04-16 16:55:44 -0400
commit8aed5c842713329cd08a9da2ca8c6ce77a663d73 (patch)
tree18ce91b388ddbc5e515d1519a8218fde0cc21a35 /core/org.eclipse.cdt.core.tests
parent7366607b693b6bcb23ecd6017e9b9d34d44aeb05 (diff)
downloadorg.eclipse.cdt-8aed5c842713329cd08a9da2ca8c6ce77a663d73.tar.gz
org.eclipse.cdt-8aed5c842713329cd08a9da2ca8c6ce77a663d73.tar.xz
org.eclipse.cdt-8aed5c842713329cd08a9da2ca8c6ce77a663d73.zip
bug 371797: Let all jobs finish before tearDown() in unit tests
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java
index 8d13f5cb7e..9e1c4c4bad 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java
@@ -23,8 +23,10 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.testplugin.ResourceHelper;
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
+import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsProvidersSerializer;
import org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.jobs.Job;
/**
* Test cases to cover {@link ILanguageSettingsChangeListener} capabilities.
@@ -83,6 +85,12 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
protected void tearDown() throws Exception {
LanguageSettingsManager.unregisterLanguageSettingsChangeListener(mockLseListener);
LanguageSettingsManager.setWorkspaceProviders(null);
+ try {
+ Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_PROJECT, null);
+ Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE, null);
+ } catch (Exception e) {
+ // ignore
+ }
super.tearDown(); // includes ResourceHelper cleanup
}
@@ -557,6 +565,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
}
{
+ // wait until serializing has finished
+ Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE, null);
// close project
project.close(null);
assertEquals(0, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL));

Back to the top