Dbunit的几种数据格式
其他:
xml的数据准备和维护太复杂
xls的格式什么的一点不对就报错
比较一下,还是CSV的比较靠谱
用在Spring里集成DbUnit写一测试基类,同时使用CSV作为准备数据源
/**
* 测试基类.
*
* @author buming.pl
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={
"classpath:/springbeans-data-source-test.xml",
"classpath:/springbeans-rpt-ds-test.xml",
"classpath:/ehcache.xml",
"classpath:/springbeans-web-manager.xml",
"classpath:/springbeans-dozer.xml",
"classpath:/springbeans-hsf-remote.xml",
"classpath:/springbeans-tbuic-client-test.xml",
"classpath:/springbeans-web-bo.xml"
})
@TransactionConfiguration(transactionManager="txManager",defaultRollback=true)
@Transactional
@ITestDataSet
public abstract class BaseTestCase extends AbstractTransactionalDataSourceSpring