From: Hilmar L. <hl...@ne...> - 2010-01-12 20:16:47
|
JNDI services can be provided by many implementations. There are implementations that use the file system to serialize objects, or that use the memory. Developers will have to have one of those that you can include locally with the test suite (and exclude from deployment), and the unit test setup code will have to include code to instantiate the JNDI service and register the dataSource. That means that the unit tests would not be testing the correct deployment of the dataSource to the application server, but that sounds acceptable to me. -hilmar On Jan 12, 2010, at 3:10 PM, Vladimir Gapeyev wrote: > Youjun has noted that the JNDI update will break the tests: they are > executed on the developer side, where JNDI data sources are not > available. (Technical details: my update will re-define the > dataSource bean in treebase-core/src/main/resources/ > applicationContext- > dao.xml to look itself up in JNDI, instead of creating itself as an > object of class com.mchange.v2.c3p0.ComboPooledDataSource.) > > A correct resolution, I believe, should provide a Spring configuration > file that is an alternative to (new) applicationContext-dao.xml and > configure the tests to use this configuration. > > Anyone has ideas how to make this happen? I, unfortunately, do not > yet know enough about Spring and Maven to figure this out. > > --Vladimir > > > On Jan 11, 2010, at 3:45 PM, Vladimir Gapeyev wrote: > >> It looks like I have figured out how to set up Treebase to use JNDI >> data sources. Surgery on code and on the build procedures is >> surprisingly minor, but if anyone is concerned about effects on their >> not-yet-committed code, react soon. I'll commit my changes and post >> switch instructions Tuesday morning. >> >> A bonus question: TB currently does its Connection pooling via the >> package com.mchange.v2.c3p0.ComboPooledDataSource see treebase-core/ >> src/main/resources/applicationContext-dao.xml. Is anyone aware why >> this (obscure?) choice? Tomcat, by default, uses another pooling >> library (Apache commons-dbcp) behind DataSources that it serves via >> JNDI. I'd rather stick with the Tomcat's default. >> >> --Vladimir >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast >> and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> Treebase-devel mailing list >> Tre...@li... >> https://lists.sourceforge.net/lists/listinfo/treebase-devel > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Treebase-devel mailing list > Tre...@li... > https://lists.sourceforge.net/lists/listinfo/treebase-devel -- =========================================================== : Hilmar Lapp -:- Durham, NC -:- informatics.nescent.org : =========================================================== |