|
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 |
|
On Wed, Jul 25, 2012 at 12:05 PM, sensen <[hidden email]> 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: [hidden email] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen |
|
Hi
I logged a ticket and committed a fix https://issues.apache.org/jira/browse/CAMEL-5500 On Mon, Aug 13, 2012 at 11:01 AM, Claus Ibsen <[hidden email]> wrote: > On Wed, Jul 25, 2012 at 12:05 PM, sensen <[hidden email]> 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: [hidden email] > Web: http://fusesource.com > Twitter: davsclaus, fusenews > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen -- Claus Ibsen ----------------- FuseSource Email: [hidden email] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen |
| Powered by Nabble | Edit this page |
