3

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?

Deltharis
  • 2,320
  • 1
  • 18
  • 29
  • https://issues.jboss.org/browse/ARQ-1842 Try to debug the DBUnitDataHandler.prepare() method. In my case, the error came from a wrong column name in my sample XML file. – fdelsert Aug 04 '15 at 12:51

0 Answers0