Jim Marino wrote: > Cases are coming up where it would be useful to be able to share mock > objects or convenience classes between unit tests in different > projects, e.g. o.a.t.core and o.a.t.container.java. Do people feel it > is appropriate to allow references in the Maven project files between > unit test directories or should we move the mock classes elsewhere, > such as under .../java? > > Jim >
-1 to cross references between project directories - this will cause a lot of confusion (bad memories here). An alternative would be to have a specific module that contained testing support code and have each project depend on it with a <scope>test</scope> dependency. However, I can see potential for chicken/egg issues as the mock objects may need to implement interfaces defined in the modules themselves. How big a problem is this? Mock objects are often very lightweight or tailored for specific test cases so there is not a lot of overhead/value in duplicating them. I would hate to be in a position where we had a test support library that was so complex that it needed unit testing itself :-) Things may be different when it comes to util/support code. For example, being able to reuse Fuhwei's DOM comparison code might be helpful. I think the difference here is that these are less likely to have dependencies on Tuscany artifacts. -- Jeremy
