DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Unit testing Java EE 5 applications

  1. #1
    Join Date
    Jan 2008
    Posts
    9

    Unit testing Java EE 5 applications

    Hello people,

    I've looked through a couple of testing frameworks that looked promising at first, but then turned out to have some kind of quirk which puts it into the not usable zone for me. I'm not mentioning them as I don't want to affect any ones opinion, I might have dismissed one without a good enough reason.

    I'm wondering which framework you recommend? And why? Do you prefer to test in container, outside it or maybe both?

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    When I read your question, I sent an email to our Java developers and asked them what they used.

    I just got a reply, and for my company it appears that JUnit (http://www.junit.org/ ) is the standard testing framework.

    Hope that helps.

  3. #3
    Join Date
    Jan 2008
    Posts
    9
    First of all, thank you for trying to help me, going out of your way and even mailing someone internally is just extraordinary!

    Unfortunately it doesn't help me. JUnit alone is fine for testing Java SE and Java ME projects. But Java EE applications, which run inside a container on an application server, is another story.

    Currently i'm looking into ejb3unit, I hope it fulfills our requirements.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    When you say "looking into" do you mean you are simply investigating it, or do you have it in house already and are doing some testing with it?

  5. #5
    Join Date
    Jan 2008
    Posts
    9
    I've read the documentation and downloaded to framework. Tomorrow I'll be writing some test tests which I'm going to show on Thursday during a meeting. I'll write a summary of what I think about ejb3unit on Thursday or Friday.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Thanks. I'm looking forward to reading it, and will probably forward your summary on to our Java developers.

    They wanted to know why I wanted to know, and when I explained, they asked me to keep an eye on this thread and let them know what you had decided to do.

  7. #7
    Join Date
    Nov 2003
    Location
    San Francisco, CA
    Posts
    19

    Post

    DevX also has published a couple of articles that discuss unit testing Java EE applications (particularly EJBs), which may be helpful to you.

    Execute EJB JUnit Tests in Your Deployed Apps
    http://www.devx.com/Java/Article/28119/0

    A Test-Driven Exploration of the Advanced Features of EJB 3.0
    http://www.devx.com/Java/Article/30496

    Unit Test Secured EJBs in Production
    http://www.devx.com/Java/Article/31727

    I hope that helps.

    Regards,
    Glen Kunene
    Glen B. Kunene
    Managing Editor
    DevX: http://www.devx.com
    Blog: http://blog.devx.com/gkunene.html

  8. #8
    Join Date
    Jan 2008
    Posts
    9
    I haven't gotten anywhere with Ejb3Unit yet. It would have been nice to have a more thorough tutorial to get started. As it is now I have the mini-tutorial on their web page where they haven't commented their source code enough (or described it) to get me to understand it.

    Has anyone of you tried Ejb3Unit? How do you test your EJB 3 components (Entity-, Session- and Messaging Beans)?

    Thank you for the articles! I read them. Writing a specific servlet to handle JUnit tests sounds a bit bothersome. Has anyone who've tried it any comments on this approach?

    The JBoss Embeddable container seems interesting! We are indeed using JBoss in this project. I'll defenitely look more into this! And to not have brittle tests I'll look into JMock as well.

Similar Threads

  1. Java book
    By Lou in forum Java
    Replies: 9
    Last Post: 09-19-2007, 05:58 AM
  2. Unit testing for XSLT: the easiest way
    By pavel.sher in forum XML
    Replies: 0
    Last Post: 10-18-2005, 04:22 AM
  3. Replies: 0
    Last Post: 02-01-2002, 12:08 AM
  4. Unit Testing a Process
    By Anthony Jones in forum Architecture and Design
    Replies: 2
    Last Post: 10-20-2001, 07:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center