[weld-dev] (+1 for standalone CDI bootstrap) Re: Why does org.jboss.weld.test.core.TestCore only support qualified injection?

Dan Allen dan.j.allen at gmail.com
Mon Dec 28 14:17:41 EST 2009


On Mon, Dec 28, 2009 at 11:31 AM, Steven Boscarine <
steven.boscarine at childrens.harvard.edu> wrote:

>  I am personally eager for the standalone CDI bootstrap because I am
> currently using Glassfish for my JEE 6 apps.
>
> Embedding a JBoss AS container is probably pretty inappropriate for tests
> of an application that isn't deployed to JBoss AS.
>

In the future you will be able to use GlassFish V3 as the container (remote
and possibility embedded) so that's not really the issue. The real question
is, do you need to run a test in a real container when a CDI bootstrap would
do? Here's the argument we made in the CDI TCK.

Some tests can work without a full container. In the CDI TCK, we call these
tests "standalone" tests, versus tests which do require a full container,
called "integration" tests. Every standalone test can also be run as an
integration test, but not the other way around. While the standalone tests
don't need the container, it is also important to run them as integration
tests as a final check just to make sure that there is nothing they conflict
with (or have side effects) when run in a real container.

So you make as many tests standalone as possible for a quick test run, but
ultimately you can (but don't have to) run all of your tests in the
container. The result of this strategy has been a bullet proof validation of
the code base.

-Dan

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20091228/395f51d9/attachment.html 


More information about the weld-dev mailing list