How can I profile a JUnit Test, preferentially with Eclipse integrated support? I'm trying to do it using VisualVM but apparently it can't be done.
I'm using Windows 7 x64, Eclipse Indigo, jdk 1.6, jre-j9 and JUnit 3 (I could use v.4)
You can use JVisualVM (%JAVA_HOME%/bin/jvisualvm.exe
), but to use it with JUnit, you need to change the run configuration slightly.
Run->Run Configurations...
)Test
tab check the box 'Keep JUnit running after test when debugging'If you wish to profile a specific section of the test, then setting a breakpoint before and after will enable you to start / stop profiling.