It is quite likely that i am wrong and/or better solutions exist but at
this time and day you have very few options.
Anyway, how about throwing your log4j config in a jar file and adding
it to the test classpath?
The downside to this is that if you want to do this properly, you need a
module or project that produces the jar as an artifact to easily update
in the future... i think ;-)
hth,
Manos
gerold kathan wrote:
hi, i have the following "issue":
* within my code i am referring to log4j configuration sitting at
static
{
DOMConfigurator.configure("log4j.xml");
logger = Logger.getLogger(AppTest.class);
}
* so it should find the config under the root of project
* OK - i learned to put the stuff under src/main/config/ and tell pom.xml
via <testResources> entry that he has to include the log4j.xml
<testResources>
<testResource>
<directory>src/test/config</directory>
<includes>
<include>log4j.xml</include>
</includes>
</testResource>
</testResources>
* OK - when i run "mvn test" everything works as expected => the log4j.xml
is copied under target/test-classes/ (which in fact i assume as being the
root in context of the test runner
* BUT - log4j complains that it cannot find the config file because he is
looking under the "general root" of the project (= the directory where the
pom.xml sits) and NOT within the target/test-classes/ context
any hints on that ?
greetz from vienna,
gerold.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]