0 Replies Latest reply on Apr 6, 2011 10:41 PM by Rudi Adianto

    is it possible to have CDI in tests without starting heavyweight container?

    Rudi Adianto Newbie

      The straightforward question: does SEAM (3) now have a way to weave components together (CDI) in the tests without starting any heavyweight container? (heavyweight being measured in terms of startup time, e.g, embedded jboss, full blown app server, etc)

      For those who have spare time, feel free to read my rant bellow. :D

      One problem that I had with Seam 2 was that for a test to be able to utilize dependency injection, it have to be deployed to embedded jboss.
      this makes the tests very slow and painful.

      I know that some people will argue that this is a matter of design and that this kind of test falls into the category of integration test and that we should not rely too much on integration tests, we need to rely more on unit level tests instead.
      But I have to tell you that being able to do that (utilizing dependency injection in tests) easily feels very good and natural to me. That is one thing I found interesting in Spring.
      In Spring, weaving components together in the test is straightforward.

      For those who don't have the luxury to be able to write unit level tests thoroughly, being able to write tests on a layer above (integration) and able to execute it smoothly and fast is a huge relieve.
      Hence it become one of my main criteria in picking the right framework for the next project. :)