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)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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...)Testtab 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.