1 Reply Latest reply on Jun 6, 2011 12:34 PM by kenundrum

    How to create unit tests for EJB 3.0 based code to be deployed in jboss 5.1?

    cnicol

      Greetings,

      I am interested in adding test coverage for an existing application. The technologies involved include EJB 3.0, jboss 5.1, Hibernate and MySQL. This project is built using Ant. The goal is to provide test coverage to this application to allow further features to be added with confidence.

      Initial searches give several ideas, but I have yet to find an tutorial or a start to finish set up steps to create an initial unit test.

      I found EJB3Unit to be promising. http://ejb3unit.sourceforge.net/Installation.html

      However, the examples to setup are for maven and we are using Ant.

      If anyone could help with how to setup a simple example test with EJB3Unit and Ant it would be very helpful.

      Alternatively, I could use suggestions as to other automated testing approaches such as testNG.

      Thanks for your time,

      Conor

        • 1. Re: How to create unit tests for EJB 3.0 based code to be deployed in jboss 5.1?
          kenundrum

          Hey Conor,

           

          My comapny had this same problem when looking into upgrading to EJB 3.0. We also attempted to use EJB3Unit as you have linked above, however there was a lot of hand holding we had to do in order to get it to 'sort of' work. The project is essentially dead from the last time we looked at it.

           

          A better option we found was OpenEJB. (Link here:http://openejb.apache.org/)

           

          It took a little bit to get up and running, buit once we got it there it works like a champ. We can hit against any database we doploy normally to, and it throws the same exceptions under the same circumstances (from what we have seen) as JBoss does.

           

          If I can help get things set up for you let me know. I will help however possible.