We’re in the process of writing Integration Tests for Java EE application and can’t agree on one thing.
Should the integration tests run on an embedded server vs. the real one?
Are there really any benefits in running tests on a full-fledged Java EE server?
I actually see a lot of problems in this approach, the biggest one being is that we should somehow expose EJB business methods either through @Remote interface or through some Web Service.
Also, we’re planning to run these integration tests on Jenkins server. We’re already have one build configuration that packages our app and deploys it onto a Glassfish server. So, maybe having this in mind, should affect our decision, whether to use embedded or real server?
To execute tests against
@Localviews of EJBs you either embedded the container in the test vm or embedding the test in the container.You can have your cake and eat it too … do both 🙂 The Arquillian API is nice enough that you can have one test that can be configured to do both.
Run tests quickly as you develop with an embedded container like OpenEJB, then in Jenkins run them again against something that looks like the production server (this will be slower).
Don’t limit yourself into thinking you need to choose just one or the other.