#7 Move the tests from TestNG to arquillian

v1.0 (example)
open
singhj
UT (1)
5
2014-02-13
2014-01-06
singhj
No

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

https://access.redhat.com/site/documentation/en-US/JBoss_Web_Framework_Kit/2.1/html/Seam_Reference_Guide/ch33s02s02.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

http://arquillian.org/modules/seam2-extension/

Discussion

  • singhj
    singhj
    2014-01-13

    • summary: Move the test from TestNG to arquillian --> Move the tests from TestNG to arquillian
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,22 @@
     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
    +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
    +
    +https://access.redhat.com/site/documentation/en-US/JBoss_Web_Framework_Kit/2.1/html/Seam_Reference_Guide/ch33s02s02.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
    +
    +http://arquillian.org/modules/seam2-extension/
    +
    +
    
    • assigned_to: rajswarnam --> SH4DEVEN
     
  • SHADEVEN
    SHADEVEN
    2014-01-13

    Resolved all the unit test failures.
    1. Change the import reference from testng to junit.
    2. Changes in pom.xml

     
  • SHADEVEN
    SHADEVEN
    2014-01-13

    • status: open --> closed
    • assigned_to: SH4DEVEN --> singhj
     
  • singhj
    singhj
    2014-01-19

    • status: closed --> open
     
  • SHADEVEN
    SHADEVEN
    2014-02-10

    • labels: --> UT
    • assigned_to: singhj --> SH4DEVEN
     
  • SHADEVEN
    SHADEVEN
    2014-02-11

    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?

     
  • SHADEVEN
    SHADEVEN
    2014-02-11

    • status: open --> closed
    • assigned_to: SH4DEVEN --> singhj
     
  • singhj
    singhj
    2014-02-13

    • status: closed --> open