Skip to content

Commit dffccc1

Browse files
committed
Wait for indexer before committing setting changes in CleanUpTestCase
See: #79
1 parent 84eea66 commit dffccc1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTestCase.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
import org.junit.jupiter.api.Assertions;
3030

3131
import org.eclipse.jdt.testplugin.JavaProjectHelper;
32+
import org.eclipse.jdt.testplugin.JavaTestPlugin;
3233
import org.eclipse.jdt.testplugin.TestOptions;
3334

3435
import org.eclipse.core.runtime.CoreException;
3536
import org.eclipse.core.runtime.NullProgressMonitor;
37+
import org.eclipse.core.runtime.Status;
3638
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
3739
import org.eclipse.core.runtime.preferences.InstanceScope;
3840

@@ -74,6 +76,7 @@
7476
import org.eclipse.jdt.ui.PreferenceConstants;
7577
import org.eclipse.jdt.ui.cleanup.CleanUpOptions;
7678
import org.eclipse.jdt.ui.cleanup.ICleanUp;
79+
import org.eclipse.jdt.ui.tests.util.TestUtils;
7780

7881
import org.eclipse.jdt.internal.ui.JavaPlugin;
7982
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
@@ -144,16 +147,19 @@ private void disableAll() throws CoreException {
144147
}
145148

146149
protected void disable(String key) throws CoreException {
150+
JavaTestPlugin.log(Status.info("Disabling: " + key));
147151
fProfile.getSettings().put(key, CleanUpOptions.FALSE);
148152
commitProfile();
149153
}
150154

151155
protected void enable(String key) throws CoreException {
156+
JavaTestPlugin.log(Status.info("Enabling: " + key));
152157
fProfile.getSettings().put(key, CleanUpOptions.TRUE);
153158
commitProfile();
154159
}
155160

156161
private void commitProfile() throws CoreException {
162+
TestUtils.waitForIndexer();
157163
List<Profile> profiles= CleanUpPreferenceUtil.getBuiltInProfiles();
158164
profiles.add(fProfile);
159165

0 commit comments

Comments
 (0)