citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
459 stars 136 forks source link

citrus-context loaded twice #700

Open kmalysiak opened 4 years ago

kmalysiak commented 4 years ago

Citrus Version 2.3

Hello, I am trying to run a simple CitrusXmlTest wrapped with TestNg test and using camel. The test is initiated with a Eclipse test ng plugin. In citrus-context xml I have definitions of beans that needs to be instantiated for test execution. Problem is that I see that the beans are instantiated two times. Some of them are of the type citrus-http:server, so during second instantiation the exception with binding to the already taken port occurs.

What to configure or where to look for in order to prevent the double instantiation.??

Relevant dependecies: citrus 2.3, citrus-camel: 2.3, camel - 2.24, spring libs: 4.1.7 / 4.1.6, jetty 9.2.11; Interestingly test runs correct with following libs: citrus: 2.0 citrus-camel: 2.0, camel - 2.14, spring libs: 4.0.7, jetty 9.1.16;

Many thanks!

christophd commented 4 years ago

Citrus 2.3 is over 4 years old. Do you have the opportunity to update to a newer version?

ubbn commented 4 years ago

I am experiencing the exact same issue in 2.8.0. I used @Autowired for one bean in beforetestsuite and test, new instance is created for both.