Thursday, May 14, 2009

JUnit, log4j And Eclipse

If you want Eclipse to pick up your log4j configuration file when you run JUnit tests from within Eclipse you can:
  1. Right-click on a test class.
  2. Select Run as --> Run configurations...
  3. Select the Classpath tab
  4. Select the home directory of you project and Advanced
  5. Then Add folder and add the folder with the configuration file and you're done.
This will configure the test file's JUnit run options.

If you want to configure all test classes with the same optoins... uhmm... stay tuned. I'll be back.

No comments: