| Author |
test log4j being picked up in webapp
|
Brian Mulholland
Ranch Hand
Joined: Mar 12, 2009
Posts: 56
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
|
|
|
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.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: test log4j being picked up in webapp
|
|
|