Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 526977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:50:01+00:00 2026-05-13T08:50:01+00:00

I want to ask for your prefered way to test Java EE code? I

  • 0

I want to ask for your prefered way to test Java EE code?

I found only three project, that are trying to help to code unit tests in Java EE environment:

  • http://jakarta.apache.org/cactus/ : Last Published: 2009-01-18
  • http://www.junitee.org/ : Last Release: 2004-12-11
  • http://ejb3unit.sourceforge.net/ : Last Release: 2008-05-17

So I wonder,

  • is there any framework helping to write (j) unit test for Java EE code?
  • do you use embedded Java EE servers like jboss or glassfish v3?
  • do you mockup and inject by yourself?

Thanks a lot…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:50:02+00:00Added an answer on May 13, 2026 at 8:50 am

    If by Unit Testing you mean… unit testing (testing a unit in isolation), then you actually don’t need any particular framework since EJB3.0 are nothing more than annotated POJOs and thus can be relatively easily tested without any special fixture.

    Now, if you mean something else – like Integration Testing or Functional Testing – then, yes, tools can help and simplify things (but you should really start to use the right terminology 🙂 I’ll assume that this is what you have in mind.

    First, JUnitEE seems dead and obsolete and I’m not even sure it has anything for EJB3.x. Second, I’m not impressed by the Java EE 5 support of Cactus and having to deploy Cactus tests is painful (I think that Cactus was nice for J2EE 1.4 but is a bit outdated now). So this leaves us with Ejb3Unit which is in my opinion the best option, especially if you want to run out of container tests i.e. without really deploying the application (much faster).

    If you want to run in container tests, then you could indeed use an embedded container and my current preference goes to GlassFish v3, even for Java EE 5 (I may be wrong but I’m pretty disappointed by the starting time of the latest JBoss releases so it isn’t getting much of my attention). See the post GlassFish Embedded Reloaded, an appserver in your pocket for sample code (that you could use from your tests) or Using maven plugin for v3 embedded glassfish (if you are using maven).

    Another option would be to package and deploy your application with Cargo and then run some tests against the deployed application (with Selenium or a BDD tool for example). This could be useful if you want to run end-to-end tests with a container that doesn’t provide any embedded API.

    So, to answer your last question, I would indeed use available tools, maybe a combination of them, for tests that are not unit tests and wouldn’t mock/inject stuff myself, except if they don’t cover some needs that I can’t think of right now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 287k
  • Answers 287k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer double x = centre.x + radius*Math.cos(2*Math.PI/360 * i); double y… May 13, 2026 at 5:10 pm
  • Editorial Team
    Editorial Team added an answer After a good night of sleep, I found the answer… May 13, 2026 at 5:10 pm
  • Editorial Team
    Editorial Team added an answer when you open the file use "a" for append. FILE… May 13, 2026 at 5:10 pm

Related Questions

Currently I have a web application where a user can use dropdown lists to
How can I ensure the records in a database can not be altered by
I just want to ask for your experience. I'm designing a public website, using
I want to write a program that analyzes your fantasy baseball team and notifies
Pay attention carefully because this is a hell of a question ;-) I want

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.