Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2005-04-14 14:04:40 +0000
committerDani Megert2005-04-14 14:04:40 +0000
commite786dad715d6849ef37e01e70adc33564c4abd4b (patch)
tree2e28b48b1bdabc81b1b310b957e742d2f5a8ce6d /org.eclipse.core.filebuffers.tests
parent42105e28bcd33993201cdc8484ee6548037f5acb (diff)
downloadeclipse.platform.text-e786dad715d6849ef37e01e70adc33564c4abd4b.tar.gz
eclipse.platform.text-e786dad715d6849ef37e01e70adc33564c4abd4b.tar.xz
eclipse.platform.text-e786dad715d6849ef37e01e70adc33564c4abd4b.zip
Fixed bug 91394: ArithmeticException: / by zero when running FileBuffersTestSuite
Diffstat (limited to 'org.eclipse.core.filebuffers.tests')
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
index ec9b414d5..460a733d7 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
@@ -11,6 +11,8 @@
package org.eclipse.core.filebuffers.tests;
import java.io.File;
+import java.io.PrintStream;
+import java.io.PrintWriter;
import junit.framework.TestCase;
@@ -1076,14 +1078,27 @@ public abstract class FileBufferFunctions extends TestCase {
}
}
+ class ForcedException extends RuntimeException {
+ private static final long serialVersionUID= 1L;
+
+ public void printStackTrace(PrintStream s) {
+ s.println("!FORCED BY TEST: this entry is intentional");
+ }
+
+ public void printStackTrace(PrintWriter s) {
+ s.println("!FORCED BY TEST: this entry is intentional");
+ }
+ }
+
NotifiedListener notifyCounter1= new NotifiedListener();
NotifiedListener notifyCounter2= new NotifiedListener();
+
FileBufferListener failingListener= new FileBufferListener() {
public void bufferCreated(IFileBuffer buffer) {
- int i= 1/0; // force error
+ throw new ForcedException();
}
public void bufferDisposed(IFileBuffer buffer) {
- int i= 1/0; // force error
+ throw new ForcedException();
}
};

Back to the top