camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sensen <n.sen...@web.de>
Subject Problem with testng CamelSpringTestSupport: several contexts runs simultaneously
Date Wed, 25 Jul 2012 10:05:21 GMT
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?

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.

Mime
View raw message