Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 285341 - Need test coverage for DebugTrace
Summary: Need test coverage for DebugTrace
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 286130
Blocks:
  Show dependency tree
 
Reported: 2009-07-31 18:07 EDT by Thomas Watson CLA
Modified: 2009-08-12 14:08 EDT (History)
1 user (show)

See Also:


Attachments
possible solution (38.81 KB, patch)
2009-08-10 10:39 EDT, Troy Bishop CLA
tjwatson: iplog+
Details | Diff
patch that compiles against a 1.4 JDK (38.49 KB, patch)
2009-08-12 10:59 EDT, Troy Bishop CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2009-07-31 18:07:03 EDT
See bug 285300.  We need more tests to cover all the methods on DebugTrace.
Comment 1 Troy Bishop CLA 2009-08-10 10:39:24 EDT
Created attachment 143917 [details]
possible solution
Comment 2 Troy Bishop CLA 2009-08-10 10:40:14 EDT
Tom,

I am attaching a patch which I think covers your requirements but please let me know if you think otherwise.  The only trace element that is not verified is the line number as that value would change anytime a new line is added or removed from DebugOptionsTestCase.

If you are happy with this patch then please see bug 286130 before committing it as the changes there are required before these tests will succeed.
Comment 3 Thomas Watson CLA 2009-08-10 18:12:17 EDT
Comment on attachment 143917 [details]
possible solution

Thanks Troy!  I will look at this for M2.
Comment 4 Thomas Watson CLA 2009-08-11 18:01:18 EDT
Troy, the patch makes use of the java.lang.StackTraceElement.StackTraceElement(String, String, String, int) constructor which is only part of 1.5.  So far the osgi.tests have only required 1.4.2 and I do run them regularly on that version of the VM.  Is there another approach that could avoid the dependency on JSE 1.5?
Comment 5 Troy Bishop CLA 2009-08-12 10:59:43 EDT
Created attachment 144242 [details]
patch that compiles against a 1.4 JDK

Instead of building the exception I am just creating a new one (new Exception("")), writing it to the trace file, and then ensuring that the it can be read back in, is not null, and that it starts with a pre-defined exception string (rather than comparing the entire contents of the exception).
Comment 6 Thomas Watson CLA 2009-08-12 14:08:17 EDT
Thanks, I released the new tests to HEAD.