Search code examples
ejbwebspherewebsphere-7java-ee-5

Testing webapp for Websphere 7


I am wondering what is the best way of testing webapp deployed on Websphere 7. If I consider, that Websphere 7 has no embedded container like for example Glassfish, I don't know, how should I effectively test the app. I mean especially cases, when I need to test data access layer with hibernate, which I usually have on separate EJB. In other cases I use basic JUnit tests and if I need to set some attributes (like other EJB), I use reflection, but configuring EJB bean to be able to use Hibernate throw reflection seems to be difficult. Has anybody some experience or could recommend some tools? Thanks.


Solution

  • Your best option might be in-container testing, perhaps using something like Arquillian.

    If you would rather have self-contained unit tests, your best option is probably public methods for resource injection (e.g., @Resource public void setEntityManager(EntityManager em)) rather than private fields, which would require reflection as you say.