I am working on a spring webflow project and I am thinking can I use HSQLDB and not my mysql for junit testing?
How can I clone my mysql database into HSQLDB
解决方案
If you are using spring 3.1 or greater you could use spring profiles to achieve this. The default profile is loaded when no active profile is set.
destroy-method="close">
...other datasource properties also create or drop db
destroy-method="close">
...other datasource properties
In your unit test set the active profile by adding the annotation.
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:app-config.xml")
@ActiveProfiles("dev")
public class TransferServiceTest {