1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for 235282: DocCommentHighlightingTests needs user interaction on Linux (patch by Emanuel Graf)

This commit is contained in:
Anton Leherbauer 2008-06-03 12:13:00 +00:00
parent 0fb0966c65
commit d25d393211

View file

@ -17,6 +17,7 @@ import junit.framework.Assert;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.IRegion;
@ -35,6 +36,8 @@ import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.testplugin.CProjectHelper; import org.eclipse.cdt.core.testplugin.CProjectHelper;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.cdt.ui.tests.BaseUITestCase; import org.eclipse.cdt.ui.tests.BaseUITestCase;
import org.eclipse.cdt.ui.tests.text.Accessor; import org.eclipse.cdt.ui.tests.text.Accessor;
import org.eclipse.cdt.ui.tests.text.EditorTestHelper; import org.eclipse.cdt.ui.tests.text.EditorTestHelper;
@ -92,11 +95,12 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
fCProject= EditorTestHelper.createCProject(PROJECT, LINKED_FOLDER); fCProject= EditorTestHelper.createCProject(PROJECT, LINKED_FOLDER);
CUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.REMOVE_TRAILING_WHITESPACE, false);
AbstractTextEditor fEditor= (CEditor) EditorTestHelper.openInEditor(ResourceTestHelper.findFile(fTestFilename), true); AbstractTextEditor fEditor= (CEditor) EditorTestHelper.openInEditor(ResourceTestHelper.findFile(fTestFilename), true);
fSourceViewer= EditorTestHelper.getSourceViewer(fEditor); fSourceViewer= EditorTestHelper.getSourceViewer(fEditor);
// source positions depend on Windows line separator // source positions depend on Windows line separator
adjustLineSeparator(fSourceViewer.getDocument(), "\r\n"); adjustLineSeparator(fSourceViewer.getDocument(), "\r\n");
fEditor.doSave(new NullProgressMonitor());
assertTrue(EditorTestHelper.joinReconciler(fSourceViewer, 0, 10000, 100)); assertTrue(EditorTestHelper.joinReconciler(fSourceViewer, 0, 10000, 100));
} }
@ -107,6 +111,7 @@ public class DocCommentHighlightingTest extends BaseUITestCase {
if (fCProject != null) if (fCProject != null)
CProjectHelper.delete(fCProject); CProjectHelper.delete(fCProject);
CUIPlugin.getDefault().getPreferenceStore().setToDefault(PreferenceConstants.REMOVE_TRAILING_WHITESPACE);
super.tearDown(); super.tearDown();
} }