On Wed, Jul 25, 2012 at 12:05 PM, sensen <n.sen...@web.de> wrote:
> Hello,
> we have I problem with the setup and tearDown of the applicationContext
> which is managed
> by the CamelSpringTestSupport-Class of the testng-package.
> When there are several test-methods within several test-classes that extends
> CamelSpringTestSupport,
> a lot of CamelContexts are started, but they are not correctly stopped. So
> that while executing
> the last test, there are several Contexts running in parallel which results
> in
> unpredictable behaviour.
>
> As far as we can see, the reason for this behaviour is:
> The applicationContext (and the CamelContext) is created in an
> @BeforeMethod-setup-method.
> So, by default, for every test-method a context is created and started.
> BUT: the context is teared down in the tearDown()-method which is annotated
> with @AfterTest.
> This method is only executed once at the end of all test.
> FIX: we think that the tearDown()-method must not be annotated with
> @AfterTest but with
> @AfterMethod.
>
> Is this observeration right? Or is there an error in our understanding?
>

Yes it seems like a bug. Feel free to log a JIRA ticket.

> Sincerely Yours,
> Norbert Sensen
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Problem-with-testng-CamelSpringTestSupport-several-contexts-runs-simultaneously-tp5716447.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to