Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2021-02-05 11:21:38 +0000
committerLars Vogel2021-02-08 15:05:38 +0000
commit555dde7235b80f210cbb0751189567c41f5aae7f (patch)
tree0f2b4d9ad0749d0bb585f5ce8faf39d3026d3d6c
parent58c6f37451d0efe5488da935db76082937db19f6 (diff)
downloadeclipse.platform.text-555dde7235b80f210cbb0751189567c41f5aae7f.tar.gz
eclipse.platform.text-555dde7235b80f210cbb0751189567c41f5aae7f.tar.xz
eclipse.platform.text-555dde7235b80f210cbb0751189567c41f5aae7f.zip
Bug 570952 - Use new atomic marker creation API in LargeFileTest
The new marker API from Bug 570914 allows to create markers with attributes and therefore avoids sending out resource change events for every attribute change. Change-Id: I6328fadb89a847a5e86511dfe146098e9fca1f09 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/LargeFileTest.java17
2 files changed, 11 insertions, 8 deletions
diff --git a/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF b/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF
index 8ae5c6ea836..bf8e00c9c36 100644
--- a/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.editors.tests/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Require-Bundle:
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.workbench;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
org.eclipse.core.filebuffers.tests;bundle-version="[3.4.100,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="1.7.0",
diff --git a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/LargeFileTest.java b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/LargeFileTest.java
index 2f06ebef453..482890e91f5 100644
--- a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/LargeFileTest.java
+++ b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/LargeFileTest.java
@@ -15,6 +15,7 @@ import static org.junit.Assert.assertTrue;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
+import java.util.Map;
import org.junit.After;
import org.junit.Before;
@@ -108,13 +109,15 @@ public class LargeFileTest {
TestUtil.runEventLoop();
}
// Create a marker on the file
- IMarker marker = fLargeFile.createMarker(IMarker.BOOKMARK);
- marker.setAttribute(IMarker.LOCATION, "line 1");
- marker.setAttribute(IMarker.MESSAGE, "Just a test marker");
- marker.setAttribute(IMarker.LINE_NUMBER, 1);
- marker.setAttribute(IMarker.CHAR_START, 8);
- marker.setAttribute(IMarker.CHAR_END, 12);
- marker.setAttribute(IMarker.USER_EDITABLE, false);
+ Map<String, Object> attributes = Map.of(IMarker.LOCATION, "line 1", //
+ IMarker.MESSAGE, "Just a test marker", //
+ IMarker.LINE_NUMBER, 1, //
+ IMarker.CHAR_START, 8, //
+ IMarker.CHAR_END, 12 ,//
+ IMarker.USER_EDITABLE, false
+ );
+
+ fLargeFile.createMarker(IMarker.BOOKMARK, attributes);
TestUtil.runEventLoop();
// Open it again
long[] withMarker = { System.nanoTime() };

Back to the top