I fixed the problem which was causing NPE [JIRA ARQ-901]. More comments inline
Alex Holmansky wrote:
Here's a super-simple project that allowed me to reproduce the issues I'm seeing with my production code.
The setup is:
- Java SE SDK 1.6.22
- Maven 3.0.3
- JBoss 7.1.0.Final
- MySQL 5.5
You'll need to set up a datasource and edit arquillian.xml and persistence.xml to change the JNDI name.
In MySQL I created 2 schemas: "test" (contains table "foo") and "test1" (contains table "bar"). SQL scripts to create the tables are in the dbscripts folder.
Problems I'm seeing:
- If you run with TestNG (uncomment pom.xml and test class appropriately) the test pretends to pass, but it looks like the @Test method is never called
Currently JUnit is used for testing, but I'm working on TestNG conversion at the moment. https://issues.jboss.org/browse/ARQ-763
- If you run with JUnit I see two problems:
- if @Cleanup is enabled I get
23:33:38,315 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-2) Failed: com.example.logic.FooBarBeanTest.testGetAllFooRecords: org.jboss.arquillian.persistence.data.dbunit.exception.DBUnitDataSetHandlingException: Unable to clean database.
Caused by: java.lang.NullPointerException
at org.jboss.arquillian.persistence.data.dbunit.cleanup.UsedTablesOnlyCleanupStrategyExecutor.cleanupDatabase(UsedTablesOnlyCleanupStrategyExecutor.java:46) [arquillian-service:]
- if @Cleanup is disabled I get
23:28:17,538 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-1) Failed: com.example.logic.FooBarBeanTest.testGetAllFooRecords: org.jboss.arquillian.persistence.data.dbunit.exception.DBUnitDataSetHandlingException: Failed while seeding database.
Caused by: org.dbunit.dataset.NoSuchTableException: test.foo
The problem might be that you don't have your tables created in your db. You can do it either by letting JPA generate the schema or wait for this feature which is planned for Alpha 5.
- I also tried adding the CLEAN_INSERT seed strategy property to arquillian.xml instead of using @Cleanup, but that doesn't seem to work either (I get an exception saying it can't construct a seed strategy from this value)
This issue is also fixed. Stupid bug in enum mapping
I'm using Eclipse as my IDE.
Let me know if you need anything else.
It was great to talk with you at JUDCon!
|Retrieving data ...|