There is something wrong in this test: XWikiContext context = new XWikiContext(); XWiki xwiki = new XWiki("./xwiki.cfg", context); context.setWiki(xwiki); StoreHibernateTest.cleanUp(new XWikiHibernateStore(StoreHibernateTest.hibpath), context); This uses both configs.. The one from xwiki.cfg comming from the new XWiki() and the one from StoreHibernateTest.hibpath Something like StoreHibernateTest.cleanUp(getHibStore(), context); instead of the last line should work.. Ludovic Vincent Massol a écrit :
-----Original Message----- From: Ludovic Dubost [mailto:[email protected]] Sent: mardi 31 mai 2005 18:44 To: [email protected] Subject: Re: [xwiki-dev] Pb in unit tests with my refactoring...
Some tests load the XWiki object and in this case the xwiki.cfg file will have an impact on the hibernate config.
I'm currently trying to fix the ClassesTest.java tests. They seem to use the XWikiHibernateStore class but the error that I get seems to indicate it's using the value in xwiki.store.hibernate.path property:
org.hibernate.HibernateException: could not find file: hibernate-test.cfg.xml at org.hibernate.cfg.Configuration.configure(Configuration.java:1199) at com.xpn.xwiki.store.XWikiHibernateStore.initHibernate(XWikiHibernateStore.ja va:115) at com.xpn.xwiki.store.XWikiHibernateStore.checkHibernate(XWikiHibernateStore.j ava:250) at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.jav a:466) at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.jav a:549) at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:77) at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:557) at com.xpn.xwiki.XWiki.getUserClass(XWiki.java:1316) at com.xpn.xwiki.test.ClassesTest.testDBListDisplayers(ClassesTest.java:204)
Some tests directly work with XWikiHibernateStore class.. In this case the param is hardcoded in the java..
Try xwiki.store.hibernate.path=/hibernate-test.cfg.xml
I don't see how this could work. You need to use getClss().getResource() to make this work...
-Vincent
_____________________________________________________________________________ Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidéos ! Créez 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