使用maven对dbunit执行一些测试时遇到问题。
执行下一行时出现错误:
DatabaseOperation.CLEAN_INSERT.execute(connection, dataset);
错误是:
org.dbunit.DatabaseUnitException: Exception processing table name='TABLENAME'
at es.dao.TestDAO.cleanDB(TestDAO.java:63)
Caused by: java.sql.SQLException: The PreparedStatement.setNull(int, int, String) method is not implemented.
如果直接从eclipse中执行测试类,则不会出现错误。
我在依赖项中查找PreparedStatement类,但不是。因此,它必须使用jdk java.sql.PreparedStatement中包含该方法的代码。
我正在使用依赖项
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.5.4</version>
<scope>test</scope>
</dependency>
关于为什么我只有Maven出现错误的任何想法?
谢谢