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:
I had a requirement to test a CDI application and wrote a custom JUnit runner that runs everything outside of the web container.
http://jglue.org/cdi-unit/
It is suitable for Java SE and also supports dummy Request, Session and Conversation scopes for testing web apps.
It's small and fast, which is great when you have lots of unit tests.