Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRüdiger Herrmann2016-10-24 17:22:28 -0400
committerAndrey Loskutov2016-11-05 17:46:58 -0400
commit1c1763096e31aaccc4444dc78cbfb3cbc6979d03 (patch)
tree077a77d40020d6f06318325858c42c9518b24480 /org.eclipse.jface.text.tests
parentc54a6055d460951ecdbcf51eaba19c346370a783 (diff)
downloadeclipse.platform.text-1c1763096e31aaccc4444dc78cbfb3cbc6979d03.tar.gz
eclipse.platform.text-1c1763096e31aaccc4444dc78cbfb3cbc6979d03.tar.xz
eclipse.platform.text-1c1763096e31aaccc4444dc78cbfb3cbc6979d03.zip
Bug 506427 - Insufficient is-disposed check in LineNumberRulerColumn::redraw
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Change-Id: I0ef8ae88f5612cb0c7302bbe37df9836f5f22d27
Diffstat (limited to 'org.eclipse.jface.text.tests')
-rw-r--r--org.eclipse.jface.text.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jface.text.tests/pom.xml2
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/source/LineNumberRulerColumnTest.java47
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java2
4 files changed, 51 insertions, 2 deletions
diff --git a/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF b/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF
index 3fdcd1f40..9cc062550 100644
--- a/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.jface.text.tests
-Bundle-Version: 3.11.0.qualifier
+Bundle-Version: 3.11.100.qualifier
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
Export-Package:
diff --git a/org.eclipse.jface.text.tests/pom.xml b/org.eclipse.jface.text.tests/pom.xml
index 99b043b60..0e785af23 100644
--- a/org.eclipse.jface.text.tests/pom.xml
+++ b/org.eclipse.jface.text.tests/pom.xml
@@ -19,7 +19,7 @@
</parent>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface.text.tests</artifactId>
- <version>3.11.0-SNAPSHOT</version>
+ <version>3.11.100-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<testSuite>${project.artifactId}</testSuite>
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/source/LineNumberRulerColumnTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/source/LineNumberRulerColumnTest.java
new file mode 100644
index 000000000..c3faa2fc3
--- /dev/null
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/source/LineNumberRulerColumnTest.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Rüdiger Herrmann and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Rüdiger Herrmann - Insufficient is-disposed check in LineNumberRulerColumn::redraw - https://bugs.eclipse.org/bugs/show_bug.cgi?id=506427
+ *******************************************************************************/
+package org.eclipse.jface.text.source;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+
+public class LineNumberRulerColumnTest {
+
+ private Shell fParent;
+
+ @Before
+ public void setUp() {
+ fParent= new Shell();
+ }
+
+ @After
+ public void tearDown() {
+ fParent.dispose();
+ }
+
+ @Test
+ public void testRedrawAfterDispose() {
+ LineNumberRulerColumn lineNumberRulerColumn= new LineNumberRulerColumn();
+ CompositeRuler ruler= new CompositeRuler();
+ ruler.addDecorator(0, lineNumberRulerColumn);
+ SourceViewer sourceViewer= new SourceViewer(fParent, ruler, SWT.NONE);
+ lineNumberRulerColumn.getControl().setSize(10, 10);
+
+ sourceViewer.getTextWidget().dispose();
+
+ lineNumberRulerColumn.redraw();
+ }
+
+}
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java
index b8a47db32..35febd98f 100644
--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/JFaceTextTestSuite.java
@@ -14,6 +14,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
+import org.eclipse.jface.text.source.LineNumberRulerColumnTest;
import org.eclipse.jface.text.tests.reconciler.AbstractReconcilerTest;
import org.eclipse.jface.text.tests.rules.DefaultPartitionerTest;
import org.eclipse.jface.text.tests.rules.DefaultPartitionerZeroLengthTest;
@@ -29,6 +30,7 @@ import org.eclipse.jface.text.tests.rules.WordRuleTest;
*/
@RunWith(Suite.class)
@SuiteClasses({
+ LineNumberRulerColumnTest.class,
HTML2TextReaderTest.class,
TextHoverPopupTest.class,
TextPresentationTest.class,

Back to the top