-
1. Re: Annoyance when running unit tests in eclipse
ataylor Sep 18, 2008 7:11 AM (in response to timfox)The test log4j.xml confog files output the logs to the following directory, '${module.output}/logs/messaging-${test.logfile.suffix}.log', the module.output is a system property set in the ant target, so you can set this in you're eclipse test config. Alternatively do what i do and have a generic IDE log4j.xml file that i use in all my projects.
-
2. Re: Annoyance when running unit tests in eclipse
timfox Sep 18, 2008 7:52 AM (in response to timfox)Can't we have it so it works out of the box without having to set system properties like it used to?
-
3. Re: Annoyance when running unit tests in eclipse
ataylor Sep 18, 2008 8:39 AM (in response to timfox)This is how it used to! I just copied what was already there.
I can change it so it uses a local directory if you want, i.e. ./logs/... -
4. Re: Annoyance when running unit tests in eclipse
timfox Sep 18, 2008 8:44 AM (in response to timfox)"ataylor" wrote:
This is how it used to! I just copied what was already there.
Well... we never used to get those exceptions so something has changed. -
5. Re: Annoyance when running unit tests in eclipse
ataylor Sep 18, 2008 11:30 AM (in response to timfox)Ok, Ive fixed it. tests/config was ahead of src/config in the classpath. When i added the log4j file to tests/config it was picked up first. Ive switched these around.
Ive installed an eclipse plugin for intellij so from now on i'll use the same classpath as you eclipse users -
6. Re: Annoyance when running unit tests in eclipse
timfox Sep 20, 2008 3:18 AM (in response to timfox)I'm confused.
I seem to have one log file in tests/output/logs, another one in tests/build/logs neither of which are the output of the unit tests when run in eclipse.
Can't we just have one config and one log file for eclipse.
Also, I thought we got rid of the convention of using output dirs, and use build everywhere?? -
7. Re: Annoyance when running unit tests in eclipse
timfox Sep 20, 2008 3:20 AM (in response to timfox)"ataylor" wrote:
Ok, Ive fixed it. tests/config was ahead of src/config in the classpath. When i added the log4j file to tests/config it was picked up first. Ive switched these around.
But these are tests. Surely they should be using log4j.xml from tests/config *not* src/config!! -
8. Re: Annoyance when running unit tests in eclipse
timfox Sep 20, 2008 3:20 AM (in response to timfox)Seems like this whole test logging thing is a complete mess.. Needs a cleanup.
-
9. Re: Annoyance when running unit tests in eclipse
timfox Sep 20, 2008 3:26 AM (in response to timfox)Ok. so I worked out where logs from running tests in eclipse goes - it uses the main log4g config from src/config so the logs go in trunk/logs.
This is all back to front and upside down.
We should have:
1 main log4j config file which lives in src/config this is used for server logging, not for tests.
1 log4j config file in tests/config - this is used for tests and nothing else. "Tests" include:
a) Tests run in eclipse
b) Tests run using runtest on the command line
c) Tests run using ant from command line (normal test suite)
For consistency test log4j output should go to tests/logs, not tests/output/logs or tests/build/logs or anywhere else. -
10. Re: Annoyance when running unit tests in eclipse
ataylor Sep 22, 2008 4:50 AM (in response to timfox)Ok, let me tidy all this up
-
11. Re: Annoyance when running unit tests in eclipse
ataylor Sep 22, 2008 6:34 AM (in response to timfox)ok, this should work for all test run scenarios now. log written to ./tests/logs
-
12. Re: Annoyance when running unit tests in eclipse
timfox Sep 26, 2008 7:54 AM (in response to timfox)It's still not working,
When I run a test in eclipse, it outputs to tests/logs ok. But the log file appends (which is annoying in itself).
I edited tests/config/log4j.xml to change append to false, but it makes no difference, i then changed the name of the output file name in tests/config/log4j.xml but that makes no difference either,
${deity of choice} only knows where it's getting log4j.xml from......... sigh -
13. Re: Annoyance when running unit tests in eclipse
timfox Sep 26, 2008 8:37 AM (in response to timfox)This was due to eclipse caching the real log4j in a private folder :(