2 Replies Latest reply on Jul 28, 2011 11:12 AM by aslak

    problem cast classes arquillian

    hibernator_11

      Hi

       

      I 've been able to run a remote test to inject an EJB, but i have a method that uses inheritance (Base class Date and child class ConcretDate). Well if i try to call this method the surefire report tells me that is not possible to make the cast between the base and the child class....

       

      do i i need a class to make the cast?

       

      is there a problem with arquillian and inheritance?

       

      thanks in advance.

        • 1. Re: problem cast classes arquillian
          hibernator_11

          The arquillian package deploys fine in jboss 6 and the EJB injection works but when i try to run the tests it does not work...

           

          The EJB uses a persistence:

           

          @PersistenceContext(unitName = "xxxxxxx-jta")

              EntityManager em;

           

           

          When i try to get all the Dates it does not work:

           

          return em.find(DateEntity.class, id);

           

          java.lang.ClassCastException: com.xxxxxxx.entity.ConcretDateEntity cannot be cast to com.xxxxxx.entity.DateEntity

           

          Do i need to include the persistence.xml as well to run the test?

           

          thanks in advance,

          • 2. Re: problem cast classes arquillian
            aslak

            It's a standard deployment, so you'll need to add the same things that you would need in the deployment outside of Arquillian.