Java DBUnit当前线程被中断
我正在使用maven dbunit插件(经过调整的版本1.0-beta-3) 在我的Java DBUnit当前线程被中断,java,postgresql,maven,dbunit,Java,Postgresql,Maven,Dbunit,我正在使用maven dbunit插件(经过调整的版本1.0-beta-3) 在我的pom.xml文件中,我定义了插件,但很少执行: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>dbunit-maven-plugin</artifactId> <!--jar file that has the jdbc driver -->
pom.xml
文件中,我定义了插件,但很少执行:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dbunit-maven-plugin</artifactId>
<!--jar file that has the jdbc driver -->
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
</dependencies>
<configuration>
<driver>org.postgresql.Driver</driver>
<dataTypeFactoryName>org.dbunit.ext.postgresql.PostgresqlDataTypeFactory</dataTypeFactoryName>
<useQualifiedTableNames>true</useQualifiedTableNames>
</configuration>
<executions>
<!-- INSERTS -->
<execution>
<id>RequestDaoIT</id>
<phase>post-integration-test</phase>
<goals>
<goal>operation</goal>
</goals>
<configuration>
<url>jdbc:postgresql://${db.host}:${db.port}/${db.name}</url>
<username>${db.username}</username>
<password>${db.password}</password>
<format>flat</format>
<type>INSERT</type>
<src>src/test/resources/dbunit/RequestDaoIT.xml</src>
</configuration>
</execution>
<execution>
<id>SlotDaoIT</id>
<phase>post-integration-test</phase>
<goals>
<goal>operation</goal>
</goals>
<configuration>
<url>jdbc:postgresql://${db.host}:${db.port}/${db.name}</url>
<username>${db.username}</username>
<password>${db.password}</password>
<format>flat</format>
<type>INSERT</type>
<src>src/test/resources/dbunit/SlotDaoIT.xml</src>
</configuration>
</execution>
... CUT
org.codehaus.mojo
DbUnitMaven插件
postgresql
postgresql
${postgresql.version}
org.postgresql.Driver
org.dbunit.ext.postgresql.PostgresqlDataTypeFactory
真的
请求道伊特
整合后测试
活动
jdbc:postgresql://${db.host}:${db.port}/${db.name}
${db.username}
${db.password}
平的
插入
src/test/resources/dbunit/RequestDaoIT.xml
慢道
整合后测试
活动
jdbc:postgresql://${db.host}:${db.port}/${db.name}
${db.username}
${db.password}
平的
插入
src/test/resources/dbunit/SlotDaoIT.xml
... 削减
在mvn verify
build期间,我在第二次执行时遇到以下错误:
[ERROR]无法在项目xxx-xxxxx-xxxxxx上执行goal org.codehaus.mojo:dbunit maven插件:1.0-XXXX:operation(SlotDaoIT):执行数据库操作时出错:插入:当前线程被中断(thread=thread[main,5,main]):NullPointerException->[Help 1]
有人能告诉我可能出了什么问题吗?我在SO或谷歌上的任何地方都找不到它。谢谢 作为参考,我正在发布解决方案,这导致了我这个问题。在平面xml数据文件
SlotDaoIT.xml
中,我启动xml元素时出错:
<xxx.dataset>
而不仅仅是:
<dataset>
Ohhh垃圾复制粘贴习惯…刚刚发现了一个bug,这些插入应该在集成前测试阶段执行。我会再跑一次。