AnsweredAssumed Answered

Unit testing: Various notes

Question asked by ianpriest on Dec 9, 2005
Latest reply on Dec 9, 2005 by davidc
I've been getting the unit-tests to run on the released version for both Windows and Linux. Here are some notes on the problems I found. I've raised bugs for most of the things I've found, so I've provided links from here and the bug report contains the detail. Hopefully this'll be of help to anyone else trying to run the unit tests.


Will fail on Linux. Details in


Will fail on Linux. Details in

Will fail on Linux. Details in

Missing files quick.doc and farmers_markets_list_2003.doc cause these to fail. See, and thanks to Robin Bramley for his helpful response.

Failed on my Linux system as I had OpenOffice 1.1.2 installed. Upgrading  to 2.0 fixed it. Note that this test won't run and will report success unless the open office demon is accepting connections.

Will fail on Linux. Details in

This failure turned out to be related to the default encoding that I was using on Linux. I was using UTF-8 and the javac was using that encoding when compiling. Running "export LANG=en_GB.ISO-8859-1" and recompiling fixed the problem.

General error that the tests showed up. See
Will fail on all systems. Details at*()
As for StringExtractingContentTransformerTest, this test failed due to the encoding in use for my user on Linux. Running "export LANG=en_GB.ISO-8859-1" and recompiling fixed the problem.
Causes a sigsegv error on my Linux system. I've removed the test for now pending further investigation. I'll post more when I get it.

Caused all following tests to fail by leaving the details for goodUser and badUser in the database, despite the transaction being rolled back. This turned out to be caused by my MySQL Db using InnoDB as the table type when the Alfresco tables were created. I dropped the database, changed MySQL so that the the default engine type was InnoDB and ran the test again and all was fine. See for more info. I'm running MySQL version 4.1.12.

I think that was about the lot. The tests now run through, with the exception of the segv error.

A couple of other test tips. You can run all the tests for a single project as follows:

cd projects/<project-name>
ant -f project-build.xml run-tests

where project name might be "repository" or "core".

You can run a single test case like this:

cd projects/<project-name>
ant -f project-build.xml run-test

Hope all this helps.