@UsingDataSet annotations stopped working after migration
We recently started porting our projects from Java 6 to Java 8. This led to a cascade of upgrades that included moving from glassfish 3.1.2.2
to glassfish 4.1
, JEE6
to JEE7
, etc.
However, after the process, our tests done with arquillian, the ones that require inserting data into the database, stopped working. More specifically, tests such as:
@Test
@UsingDataSet("table.json")
public void getLastEntryTest() throws NoResultFoundException {
assertCorrectness(tableDAO.getLastEntry());
}
During execution, throw
java.lang.NullPointerException
at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.testRequiresRollbackDueToFailure(TransactionHandler.java:170)
The relevant dependencies we are using are:
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.8.Final</version>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-remote-3.1</artifactId>
<version>1.0.0.CR4</version>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-dbunit</artifactId>
<version>1.0.0.Alpha7</version>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.1.8.Final</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
Example table.json:
{ "schema.table":
[
{
"date": "2005-09-19 00:00:00",
"foo": "value"
}
]
}
The database connection (to the Oracle database) is working correctly - if we do it manually by executing the query inside the test body, everything will be as expected.
How do we make it work?
source to share
No one has answered this question yet
Check out similar questions: