users@glassfish.java.net

RE: Re: EJB Unit Testing

From: Jason Lee <lee_at_iecokc.com>
Date: Mon, 12 Mar 2007 17:19:22 -0500

We unit test using JUnit. We work around the injection issue by using
settiner injection. That allows us to inject resources at test time
without any special tricks/test-only methods. For testing our DAOs
(deployed as session beans injected into our session bean service
layer), we configure a test PU that specifies the connection info via
Hibernate or TopLink properties. For testing other EJBs, we use mock
objects. For testing JMS, for example, we use
com.mockrunner.mock.jms.JMSMockObjectFactory. It seems to be working
pretty well for us, though our unit testing expertise is far from
perfect. I like to think we're getting better and smarter about it,
though. :)
 
-----
Jason Lee, SCJP
Senior Software Engineer
http://www.iec-okc.com <http://www.iec-okc.com/>
 


  _____

        From: Daniel Cavalcanti [mailto:dhcavalcanti_at_gmail.com]
        Sent: Monday, March 12, 2007 5:12 PM
        To: users_at_glassfish.dev.java.net
        Subject: Re: EJB Unit Testing
        
        
        Thanks for the tip.
        I was planning to use JUnit but was sure how to proceed about
getting handle of the bean.
        I'll check TestNG and ejb3unit.
        
        
        On 3/12/07, glassfish_at_javadesktop.org
<glassfish_at_javadesktop.org> wrote:

                Hey,
                
                
                I use TestNG , retrieve remote EJBS via the
InitialContext and perform my tests,
                
                
                Although ejb3unit project looks promising
                Take a look: http://ejb3unit.sourceforge.net
                
                Asaf
                [Message sent by forum member 'trouby' (trouby)]
                
                http://forums.java.net/jive/thread.jspa?messageID=207522
                
        
---------------------------------------------------------------------
                To unsubscribe, e-mail:
users-unsubscribe_at_glassfish.dev.java.net
                For additional commands, e-mail:
users-help_at_glassfish.dev.java.net