Forums Register Login

Unit testing Java EE 5 applications

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
Some tests, eg EJB container-managed transactions, can only be tested using a real EJB container (not a mock container) as you need to ensure that your code and the container are properly processing commits and rollbacks.

For JUnit tests, you can easily do these if you write the business logic using plain old Java objects, and test (outside the real container).

The EJB which calls the POJOs will basically just be the means of providing EJB services, and you can test the EJB using a real container.
+Pie Number of slices to send: Send
Thanks for your advice, it's indeed an interesting approach. I'll take it up with the rest of the project group. In the meantime I'll look into ejb3unit, as it still seems promising after reading about it on its web page.
this is supposed to be a surprise, but it smells like a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 534 times.
Similar Threads
Essay Time....
How to read from an excel sheet in linux?
Tools for testing static methods
Tools for testing static methods
Poll: what framework do you use for EJB unit tests?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:36:28.