Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EJB unit Test Case

Tags:

ejb-3.1

Team,

We need to do EJB 3.1 Unit Test cases. For that we are analyzing tools to do efficient testing. We are taking arquillian, cactus in consideration. Can anyone tell me which tool is suitable for our technology stack in performance wise. We are using JBOSS+Hibernate

like image 725
user729344 Avatar asked May 12 '11 12:05

user729344


2 Answers

You might check out the technique of using the Embedded Container in EJB 3.1.

like image 96
Kevin Pauli Avatar answered Sep 25 '22 02:09

Kevin Pauli


Testing EJBs is my daily challenge. The simple answer is don't. Here are some basic reasons why it's better to have unit tests than integrated tests: http://blog.thecodewhisperer.com/2010/10/16/integrated-tests-are-a-scam/

Nevertheless, if testing EJBs is really something you want and need I've committed few articles how to approach it (JBoss and Hibernate is my configuration as well). Sometimes OpenEJB is an overkill and simple mocking is enough - I suggest Mockito http://mockito.org and some examples I've written http://jakub.marchwicki.pl/posts/2011/05/06/the-art-of-testing-an-ejb-application-part-ii/

like image 33
Jakub Marchwicki Avatar answered Sep 23 '22 02:09

Jakub Marchwicki