dbunit

Is there any way for DBUnit to automatically create tables?

别说谁变了你拦得住时间么 提交于 2019-11-26 16:53:07
问题 I just realized that DBUnit doesn't create tables by itself (see How do I test with DBUnit with plain JDBC and HSQLDB without facing a NoSuchTableException?). Is there any way for DBUnit to automatically create tables from a dataset or dtd? EDIT: For simple testing of an in-memory database like HSQLDB, a crude approach can be used to automatically create tables: private void createHsqldbTables(IDataSet dataSet, Connection connection) throws DataSetException, SQLException { String[] tableNames