2 Replies Latest reply on Feb 28, 2009 3:07 PM by Thiago Ramos

    TestNG with SeamTest

    Thiago Ramos Newbie

      I have an aplication that has three layers. Controller, Business, Persistence.
      The controller layer is a statefull session bean that's a seam component too and has a stateless business EJB injected via @EJB.
      The business layer is a plain stateless EJB that is NOT a seam component and has persistence EJB injected via @EJB too.
      The persistence layer is a stateless EJB with an entityManager injected via @PersistentContext.


      My ask is: 
      How can I test these components together in a integration test?
      I experienced some erros when tried to access a injected EJB stateless.


      Anyone can tell me, how can I do it?


      I apreciate.


      Regards, Thiago Ramos.

        • 1. Re: TestNG with SeamTest
          Coen Damen Novice

          I'm looking into this as well. There is hardly any documentation available. I'm struggling to get a simple test working. Sounds like the same scenario you are trying to get working.


          Can you state your exact problem? Maybe I can help.


          Coen

          • 2. Re: TestNG with SeamTest
            Thiago Ramos Newbie

            Hi Coen,


            My problem is that I can´t inject the Service Stateless Session Bean or any other EJB into the test class.


            All the tutorials about testing in Seam and the examples that come with the Seam shows tests with seam components. Do you know what I mean?


            All the EJB that are testing have an @Name on it!


            I just don't know how to inject the non-components in the test without creating mock objects.


            They simply get null.


            I apreciate if you could help me with this.


            Thank you for replying.


            Best regards.


            Thiago Ramos.