首先,做一些setup工作
private MsSqlConnection _dbunitConnection; @Before public void setUp() throws Exception { _dbunitConnection = new MsSqlConnection(DBUnitUtilities.createHsqlDBConnection(), null); //do something setup.. }
重點在這:
IDataSet setup = DBUnitUtilities.getDataSet("datasheet\\Banner11.xml"); DatabaseOperation.CLEAN_INSERT.execute(_dbunitConnection,setup);
沒有留言:
張貼留言