camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CAMEL-9981) CamelSpringJUnit4ClassRunner registers listeners twice
Date Sun, 22 May 2016 07:06:12 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-9981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen reassigned CAMEL-9981:
----------------------------------

    Assignee: Claus Ibsen

> CamelSpringJUnit4ClassRunner registers listeners twice
> ------------------------------------------------------
>
>                 Key: CAMEL-9981
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9981
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-test
>    Affects Versions: 2.17.1
>         Environment: ALL
>            Reporter: Gardella Juan Pablo
>            Assignee: Claus Ibsen
>              Labels: test
>
> Using camel-test-spring I found that CamelSpringJUnit4ClassRunner registers the listener
twice. This causes the following error in transactional tests:
> {noformat}
> java.lang.IllegalStateException: Cannot start a new transaction without ending the existing
transaction.
> {noformat}
> To fix it, it is required to only add the expected listeners :
> {code:java}
> line:57
>          public CamelTestContextManager(Class<?> testClass) {
>             super(testClass);
>             // inject Camel first, and then disable jmx and add the stop-watch
>             // WARNING: The listeners are registered within the super class.
>             /// DON'T get current listeners.
>             // List<TestExecutionListener> list = getTestExecutionListeners();
>             //
>             List<TestExecutionListener> list = new ArrayList<TestExecutionListener>(3);
>             list.add(new CamelSpringTestContextLoaderTestExecutionListener());
>             list.add(new DisableJmxTestExecutionListener());
>             list.add(new StopWatchTestExecutionListener());
>             OrderComparator.sort(list);
>             registerTestExecutionListeners(list);
>         }
> {code}
> Spring version: 4.2.5.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message