Thomas Sundberg

December 21, 2010

Automatically integration test an ejb with Maven

This post is available at


  1. Very good post. Thank you.

    As you do not have a webapp in you project you could have used an embedded EJB contaner (OpenEJB for example) like in this article :

    With this method you do not need to have a new maven project for this integration test.

    Comment by Yan — December 22, 2010 @ 15:59

  2. It may be true that I could have used an embedded EJB Container. But with my approach I can easily extend it to include a web app or something else and not change anything more then extend the integration tests. So this may be viewed as a start but it doesn’t have to be the end.

    Comment by Thomas Sundberg — December 22, 2010 @ 21:14

  3. Yes with your approach you can test a webapp with Selenium.
    Do you know other software like selenium ?

    Comment by Yan — December 30, 2010 @ 13:29

  4. I haven’t really had any need to find any other tools similar to Selenium. So, no I don’t have any tip to forward. In the cases I need to test web applications, Selenium and Selenium 2 has been sufficient.


    Comment by Thomas Sundberg — December 30, 2010 @ 17:49

  5. Hi Thomas,

    Thanks for this tutorial, it helps me to perform IT in my project. But I have some troubles with your sample : I always have the following message from Maven for the integration test

    [INFO] --- maven-surefire-plugin:2.6:test (default-test) @ integration-test ---
    [INFO] Surefire report directory: D:\maven\thomassundberg\integration-test\target\surefire-reports

    T E S T S
    There are no tests to run.

    Results :

    Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

    Which version of Maven did you use to write this sample ? Do you have any zip file that contains all your sources ?


    Comment by Benoît — May 9, 2011 @ 13:10

  6. Hi!

    I used Maven 3.

    Did you invoke Maven with

    mvn clean install

    The problem you have looks like you have invoked Maven with another goal then install.

    All unit tests has been disablded in the Surefire plugin so the test shall only be executed in the integration-test phase that will be invoked during the install phase.


    Comment by Thomas Sundberg — May 10, 2011 @ 12:38

    • Hi Thomas,

      I used mvn clean verify, the verify goal is just after the integration-test phase so it should work…
      Anyway, I solved my problem by configurating cargo/jboss as an already installed and running server.

      Thanks for this post (and your reply 😉 ) it greatly helps me to write my POMs projects 😀


      Comment by Benoît — May 10, 2011 @ 18:20

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

%d bloggers like this: