|
From: <jue...@we...> - 2003-03-14 19:06:00
|
Hi everybody, I'm currently trying to integrate the basic mock objects from the test = tree into the src tree, on the occasion of writing some test suites for = an application project that uses Spring. The rationale behind this is = that most of the mock objects are not just useful for Spring tests but = also for application tests. This demands including them in the Spring = distribution, and thus moving them to the main source tree. Besides, the = "servletapi", "mo.ejb", and "jdbc" package names in the test tree aren't = proper anyway. My main need are the JNDI mocks that allow for building a JNDI tree with = the application's environment, containing JDBC data sources and in our = case Hibernate session factories - completely without any container. To = achieve this, I've created a new SimpleDataSource mock that simply = returns new connections on every getConnection call - which works nicely = with Hibernate (BTW, in contrast to SingleConnectionDataSource that = cannot handle standard Connection.close calls). TestDataSource is now in = com.interface21.jdbc.core in the test tree, derived from = SimpleDataSource. Thus, I've moved the JNDI mocks to com.interface21.jndi.mock, and the = JDBC mocks (SimpleDataSource and SingleConnectionDataSource) to = com.interface21.jdbc.mock. Consequently, I've additionally moved the 2 = EJB mocks to com.interface21.ejb.mock, and the Servlet mocks to = com.interface21.web.mock. I don't use the latter 2 for application tests = currently, but I might choose to do so sometime. Of course, this step adds a few classes to the main source tree and to = the distribution JARS, but that couple of KBs is hardly worth thinking = about. I'd mainly like to know if anyone objects to moving these mock = objects to the main source tree as a matter of principle, and if the new = package names would be OK. Regards, Juergen DI J=FCrgen H=F6ller Senior System Architect __________________________________ werk3ATS - division systementwicklung part of werk3AT internetmedien oeg europaplatz 4 A - 4020 linz t. +43 (0) 732 71 65 29 f. +43 (0) 732 71 65 29 3 jue...@we... www.werk3at.com __________________________________ werk3ATS - WIR ENTWICKELN ERFOLG |