diff options
author | Michael Valenta | 2004-10-12 19:06:05 +0000 |
---|---|---|
committer | Michael Valenta | 2004-10-12 19:06:05 +0000 |
commit | b251a9ff8f52108354a6bade270497ea42dc6d40 (patch) | |
tree | bc1b56328b6b4183a321fd65c44da43116e51082 /tests | |
parent | dde8197ab0e23cb78d179d14b73aba3cb4cf1ad3 (diff) | |
download | eclipse.platform.team-b251a9ff8f52108354a6bade270497ea42dc6d40.tar.gz eclipse.platform.team-b251a9ff8f52108354a6bade270497ea42dc6d40.tar.xz eclipse.platform.team-b251a9ff8f52108354a6bade270497ea42dc6d40.zip |
Modified tests to dump entire exception and protocol trace when an error occurs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java index 53ada45f6..3fc78af7c 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java @@ -971,5 +971,30 @@ public class EclipseTest extends EclipseWorkspaceTest { } } + /* (non-Javadoc) + * @see junit.framework.TestCase#runTest() + */ + protected void runTest() throws Throwable { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + Policy.recorder = new PrintStream(os); + try { + try { + // Override the runTest method in order to print the entire trace of a + // test that failed due to a CoreException including nested exceptions + super.runTest(); + } catch (CoreException e) { + e.printStackTrace(); + write(e.getStatus(), 0); + throw e; + } + } catch (Throwable e) { + // Transfer the recorded debug info to stdout + Policy.recorder.close(); + System.out.println(new String(os.toByteArray())); + } finally { + Policy.recorder.close(); + Policy.recorder = null; + } + } } |