Community
Participate
Working Groups
See bug 285300. We need more tests to cover all the methods on DebugTrace.
Created attachment 143917 [details] possible solution
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 on attachment 143917 [details] possible solution Thanks Troy! I will look at this for M2.
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?
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).
Thanks, I released the new tests to HEAD.