Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
Originally posted by Jeff Langr:
Excellent answer JB!
SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Jeanne Boyarsky:
Vinicius,
Other posters have explained and quoted the spec quite well. I just want to explain what we are doing. For the most part, I avoid reflection. But I have a few tests that were easier to implement that way.
I have some unit tests that test a wrapper to the EJB. The tests are run in Eclipse's JRE. The EJB itself is run in the EJB container. Note that these are pure unit tests. They mock out the EJB itself (but are in the ejb jar.)
Now that I think about it, your question relates more to integration tests that test the real EJB. For integration tests, I limit myself to the public interface. Anything more detailed is tested in the unit tests. There isn't any logic in the EJBS - they just delegate to commands. So there isn't anything to unit test and the integration tests cover well.
SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
Originally posted by Vinicius Boson:
The ejb classes just delegate the request to the classes which are responsable for the business rules. And you should test this classes, right? )
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596007434/ref=jranch-20" target="_blank" rel="nofollow">JUnit Pocket Guide</a>
The Private Proxy is designed to make protected, package and private variables and methods accessible to developers to enhance their ability to create unit tests.. Developers can use this class to simply call a private method on an object for testing purposes. Developers will also be able to tinker with the internally object references to update them to different values to see how the Object being tested handles wacky values for parameters.