We are building our EAR & EJB projects with maven. It will build all the EJB projects and then they are used as the dependency for EAR, so they are packed into the EAR file eventually.
The problem is that each EJB project has junit tests that check the EJB. For now these tests are not very useful because they try to connect to application server (jboss) and execute methods from EJB interface.
Is there any way I can build the EJBs, build and deploy the EAR and then run all the tests from all of the EJBs against the application server ?
For now I'm simulating AP in tests by initiation EJB-Implementation classes and manually "injecting" injections (someEJBImpl.em = EntityManager....) which is very annoying, because we have a huge dependencies between them and I have to handle transactions by myself.
Is there any other way of running EJB tests against real AP ? May be deploy EAR after each EJB module with subset of EJB modules that were already built ? But how ?
May be set to run maven tests of all EJB modules as part of EAR tests ? How to do this ?