I have a collection of integration tests that have been generated by Spring Roo for my domain objects (and DAO ITDs).
They appear to be fixed to use the "production" applicationContext.xml, which reads the database.properties and connects to the MySQL database schema I have set up for experimenting with the project:
privileged aspect AdvertIntegrationTest_Roo_IntegrationTest {
declare @type: AdvertIntegrationTest: @RunWith
(SpringJUnit4ClassRunner.class);
declare @type: AdvertIntegrationTest: @ContextConfiguration
(locations = "classpath:/META-INF/spring/applicationContext.xml");
The outcome of this is that my demo database is frequently populated with garbage by these tests.
I'd like to change the configuration so that the integration tests use an in-mem database, and leave the MySQL database well alone. At the moment, the only option that I can see is to remove the Roo annotations and manage these tests myself from now on, but I'd rather keep Roo in the loop at the moment.
Is it possible to configure my project, so the "mvn tomcat" and "mvn test" commands use separate databases, without breaking the Spring Roo set-up? Or perhaps there is a better approach for what I want to do?