Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

test log4j being picked up in webapp

 
Brian Mulholland
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a webapp and a dependent lib project. The lib project and webapp both have test folders in addition to source folders where I am putting my unit tests. The tests have their own log4j.properties loaded from a propertyconfigurator so that we can figure out what isn't working. The problem is that when I run the actual webapp, I am picking up the log4j's from the test folders. This causes multiple appenders to be defined and double and triple logging.

I am in RAD/Eclipse, and we added the test folder as a source folder (which is probably the root of the problem) but if i do not, then when I try to run the Junit test via the right-click run as... menu, it doesn't find the classes as junit classes.

So I think I am setting my test folders up incorrectly. What is the correct way? Or if this is not wrong, how to I control my log4j problem?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could put the test files in a different project. That way the unit tests (also in that separate project) see it, but the web app does not.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic