[Yanel-development] Questions re test framework

Josias Thöny josias.thoeny at wyona.com
Thu Nov 30 09:49:31 CET 2006


On Wed, 2006-11-29 at 22:41 +0100, Michael Wechner wrote:
> Dear All
> 
> Thanks to Josias we now have a testing framework :-)
> 
> I have some questions re the result pages and how we could make them 
> available in a more human friendly way:
> 
> ?      src/test/test-results

For each test, an xml file with the results is generated and stored in
this directory. The xml file is created by the standard junit xml
formatter, and actually it doesn't contain a lot of useful information
if a test succeeded. 
The results are more interesting if a test failed. I believe that
cruisecontrol can be set up to display those results, although I'm not
sure. Cruisecontrol is not set up yet to run the tests anyway.

> ?      src/realms/yanel-website/paths/test-xml-resource.html
> ?      src/realms/yanel-website/content/224bf199-f56c-47f6-a78f-41d0741e5304

The test of the xml resource creates this document in order to test
reading and writing to a resource.
Is it ok to have the tests create/change files in the yanel-website
realm?

> 
> Josias, maybe you can explain a bit what it is doing and how it is working.

There is a README.txt in src/test/ which explains the basic ideas. Here
is a quick summary:

To run the tests, you first have to do:
- build yanel
- set the tomcat url in src/test/htmlunit/htmlunit-properties.xml
- start tomcat
- type ./build.sh test 

For adding new tests, I used a "convention instead of configuration"
approach, this means that test classes need to have a special name
(*Test.java) and need to be in special directories:
YANEL_HOME/src/test/(junit|htmlunit)/ 
or 
MY_RESOURCE/src/test/(junit|htmlunit)/

Then they will be executed automatically when running ./build.sh test.

Currently there are only a few example tests. If people think that the
testing framework is ok, it would be good if everyone writes a few tests
for new and existing features...

There are no performance tests yet. Maybe we have to discuss how to do
that. The simplest approach is to measure the time of the normal
junit/htmlunit tests. It's also possible to automatically run jmeter
test plans, but it might require to have a dedicated machine to run the
benchmarks.

Any feedback about the testing framework is welcome...

Josias


> 
> Thanks
> 
> Michi
> 




More information about the Yanel-development mailing list