Arquillian is the recommended test library for jee 6 applications and we need to move tests in generated apps to use it.
As a POC we do it for authenticatortest in newrich project -
I have made changes to pom.xml but the tests are throwing classformat error
here are some pointers
http://docs.jboss.org/seam/2.3.0.Final/reference/en-US/html/migration23.html
This is the exact expcetion we are getting
https://community.jboss.org/wiki/WhatsTheCauseOfThisExceptionJavalangClassFormatErrorAbsentCode
Not sure but maybe we would need this additional extension
Diff:
Resolved all the unit test failures.
1. Change the import reference from testng to junit.
2. Changes in pom.xml
Steps:
1. Migrated unit test from TestNG to JUnit. Since JBoss seam jar comes with TestNG, it has to be excluded. Then added Junit dependency.
2. Changed the annotation reference in unit tests to the equivalent of JUnit.
3. Moved the dependencies with test scope to the top of the dependency list.
4. The injection of EntityManager does NOT work in unit tests. Therefore, created entity manager from factory instead.
Suggestions:
1. We would need to create a separated database for unit tests.
2. The POM file is a mess, more cleanup required. Can MDA generate POM?
Here is a link to the problem
http://stackoverflow.com/questions/6480404/netbeans-7-0-junit-and-glasfish-embedded-3-1-does-not-work