I'm not running separate sql during test and real. My problem comes from the fact that I'm trying to use iBatis to set my test data up proior to running the real code. (i.e. in the @BeforeClass part of my unit test). The issue I have is that during testing the resources seem to get loaded from src/test/resources and when running normally from src/main/resources. This means that the .xml files for the "real" code do not seem to be seen when I run my tests
It's quite possible that I have something wrong here in my configuration. Maybe a better question would have been "How do you unit test your iBatis code if you use Maven?" rickcr-2 wrote: > > On Thu, Aug 27, 2009 at 3:53 AM, Richard Bibb > <richard.b...@aimhedge.com>wrote: > >> >> The problem is, when under test how do I distinguish between the Mappers >> under test and those being used to do the testing? At the moment I only >> seem >> to be able to get things to work if I put all the Mapper.xml files in the >> test sqlmaps directory. Clearly this isn't good. >> >> Can someone offer advice to a maven/iBatis novice? >> > > > I'm a bit confused. It sounds like you want to run different SQL > statements > in test vs your real code? The actual SQL itself is going to change? That > seems a bit odd at first glance to me, since I'd think the idea of the > tests > is to make sure that the production Mappers you wrote actually work, so > not > sure I'd see a case to have different ones used in test? Maybe you could > elaborate more on it. (Actually you won't even be able to build a Mapper > class of the same name in a test package that has the same structure. You > could have it use a different mapper.xml file, but not the class name.) > > Can you explain why you want to use different Mappers in Test from your > real > code? > > -- View this message in context: http://www.nabble.com/Maven-and-iBatis-3.0---Excuse-me-for-the-stupid-question-tp25167237p25220912.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org