Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: Eclipse - Diff Trace

I've got two versions of a project with a JUnit test. Looking at the diff of the files there's no obvious reason to this, but the test passes on one project but not on the other.

For a while now I've wondered if there was a program that would record a trace through the whole program when it runs and save it to a file. This would be really handy for this exact example where I want a trace through both tests and then I want to diff them together.

Can anyone point me in the direction of a program that might be able to do this, or a way that I could diff the two program's flows?

Cheers

like image 480
Henry B Avatar asked May 05 '26 09:05

Henry B


1 Answers

I'd use Aspects for this. Check out AspectJ for instance, it is very easy to design a rule (point cut) that says "For all methods invoked in my Java code, log method name".

like image 109
Lars Westergren Avatar answered May 07 '26 22:05

Lars Westergren



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!