Curt Arnold wrote:
On Jun 2, 2005, at 12:33 AM, Mark Womack wrote:
I am running the test cases against the 1.2.11 code, and the minimum
case fails right off the bat:
Minimum:
[junit] Running org.apache.log4j.MinimumTestCase
[junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.501 sec
[junit] Testsuite: org.apache.log4j.MinimumTestCase
[junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.501 sec
[junit] ------------- Standard Output ---------------
[junit] Files [output/filtered] and [witness/simple] differ on
line 28
[junit] One reads: [ at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)].
[junit] Other reads:[ at java.lang.reflect.Method.invoke
(Native Method)].
[junit] ------------- ---------------- ---------------
There are a couple of issues, your JVM uses 3 sun.reflect calls when
the reference uses one java.lang.reflect call and Ant has added another
layer. If the number of calls in the stack were equal then it might be
fairly simple to add another regex transform (like LineNumberFilter and
AbsoluteDateTimeFilter) that would translate sun.reflect... into the
same calls as in the witness file. However, things probably get
complicated by the mismatch in number of calls in the stack. It might
be possible to write a regex transform that matches one line and emits
multiple lines which would suggest rewriting the witness file with the
lengthier stack trace and then write a regex transform that converts
the shorter into the longer one.
I would think the Ant call depth would be constant for any particular
version of Ant and am surprised that we haven't heard a complaint from
Gump on that one. The call stack on a reflecting method invocation is
apparently and not surprising JVM specific. The JUnit stack would also
be subject to change but fortunately for this test, its depth doesn't
appear to have changed.
My first impression of this is that a unit test based on the stack trace
output of third party code is too fragile to be useful. Personally, I
would try to remove the lines not related to log4j from the output
before comparing. (I don't know if this is feasible and I'm shooting
from the hip, so apologies if I am off base.)
Ray
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]