I agree.. When I wrote this code I had issues with making the tests find documents starting with / It was working with servlet tests but not with client side tests.. I was not aware that adding the place where the files where to the execution CP would work. hibernate-test.cfg.xml and xwiki.cfg are almost the only files that are looked for. A few tests might be looking for some attachment files also (.txt files) Go ahead with the changes.. we can fix the tests as it comes.. Ludovic Vincent Massol a écrit :
-----Original Message----- From: Vincent Massol [mailto:[email protected]] Sent: mardi 31 mai 2005 09:58 To: '[email protected]' Subject: RE: [xwiki-dev] [Build] About to move tests
Hi,
It seems that the tests are generating some files during their execution. They seem to generate:
- test/velocity.log - test/xwiki.log - test/hibernate-test.cfg.xml - test/rcs/Test/*
Could someone tell me how I can update the test files so that these generated files go into the build/ directory instead of going into a source directory?
This is pre-requisite before I can make any modification to the directory structure. Actually what should be done is remove the dependency on paths. ATM, I've noticed that several tests are using path to find test resources. I believe this is not right and should be improved by using the classpath to locate the test resources.
In other words, instead of doing something like:
public static final String hibpath = "hibernate-test.cfg.xml"; XWikiHibernateStore hibstore = new XWikiHibernateStore(hibpath);
We should be doing:
public static final String hibLocation = "/hibernate-test.cfg.xml"; URL hibURL = getClass().getResource(hibLocation); XWikiHibernateStore hibstore = new XWikiHibernateStore(hibURL);
And we add src/test/resources to the JUnit execution CP.
What's wrong with paths?
- they are system dependent - they can be absolute or relative and the result will depend from where you execute the code. Thus they are brittle
WDYT?
I don't know the code well so I would need your help in fleshing out the places where paths are used. I've noticed one in AllTests.java (see attached "patch" - I've also added some other comments).
Once we don't rely any more on paths then we'll be able to move /test in src/test/resources.
Thanks for your help -Vincent
Thanks -Vincent
-----Original Message----- From: Vincent Massol [mailto:[email protected]] Sent: mardi 31 mai 2005 09:47 To: [email protected] Subject: [xwiki-dev] [Build] About to move tests
Hi developers,
This is a heads up as I'm about to move test sources and resources as planned in a previous email (see also XWIKI-12).
The following changes will happen:
- trunk/test will go in src/test/resources - trunk/src/test will go in src/test/java - trunk/src/test-cactus will go in src/test/cactus
This means that you'll need to add the src/test/resources directory to your execution classapath in your IDE project files. You'll also need to
change
src/test to src/test/java and src/test-cactus to src/test/cactus.
Please shout if you have an issue with this. I'll be doing it in about 1 hour.
Thanks -Vincent
__________________________________________________________________________
___ Dicouvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidios ! Criez votre Yahoo! Mail sur http://fr.mail.yahoo.com
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic