Recently we've started a migration of our projects from Java 6 to Java 8. That brought a cascade of updates, which 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, those that require inserting data into the database, stopped working. More specifically tests like:
@Test
@UsingDataSet("table.json")
public void getLastEntryTest() throws NoResultFoundException {
assertCorrectness(tableDAO.getLastEntry());
}
At runtime throw
java.lang.NullPointerException
at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.testRequiresRollbackDueToFailure(TransactionHandler.java:170)
Relevant dependencies we use:
<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>
Sample table.json:
{ "schema.table":
[
{
"date": "2005-09-19 00:00:00",
"foo": "value"
}
]
}
Database connection (to an Oracle database) works properly - if we do the insterts manually by executing a query inside the test body everything is as expected.
How do we make it work?