[ 
https://issues.apache.org/jira/browse/CAMEL-20522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17823922#comment-17823922
 ] 

Claus Ibsen commented on CAMEL-20522:
-------------------------------------

Before

{code}
2024-03-06 09:58:49,460 [main           ] INFO  CamelTestSupport               
- 
********************************************************************************
2024-03-06 09:58:49,469 [main           ] INFO  CamelTestSupport               
- Testing: testMetricsRoutePolicy() 
(org.apache.camel.component.micrometer.routepolicy.ZMicrometerContextOnlyPolicyTest)
2024-03-06 09:58:49,469 [main           ] INFO  CamelTestSupport               
- 
********************************************************************************
2024-03-06 09:58:49,673 [main           ] INFO  AbstractCamelContext           
- Apache Camel 4.5.0-SNAPSHOT (camel-1) is starting
2024-03-06 09:58:49,680 [main           ] INFO  AbstractCamelContext           
- Routes startup (total:2)
2024-03-06 09:58:49,680 [main           ] INFO  AbstractCamelContext           
-     Started foo (direct://foo)
2024-03-06 09:58:49,680 [main           ] INFO  AbstractCamelContext           
-     Started bar (direct://bar)
2024-03-06 09:58:49,680 [main           ] INFO  AbstractCamelContext           
- Apache Camel 4.5.0-SNAPSHOT (camel-1) started in 6ms (build:0ms init:0ms 
start:6ms)
2024-03-06 09:58:50,090 [main           ] INFO  MockEndpoint                   
- Asserting: mock://result is satisfied
{code}

After 

{code}
2024-03-06 09:57:17,990 [main           ] INFO  CamelTestSupport               
- 
********************************************************************************
2024-03-06 09:57:17,990 [main           ] INFO  CamelTestSupport               
- Testing: testMetricsRoutePolicy() 
(org.apache.camel.component.micrometer.routepolicy.ZMicrometerContextOnlyPolicyTest)
2024-03-06 09:57:17,990 [main           ] INFO  CamelTestSupport               
- 
********************************************************************************
2024-03-06 09:57:17,998 [main           ] INFO  AbstractCamelContext           
- Apache Camel 4.5.0-SNAPSHOT (camel-30) is starting
2024-03-06 09:57:17,999 [main           ] INFO  AbstractCamelContext           
- Routes startup (total:2)
2024-03-06 09:57:17,999 [main           ] INFO  AbstractCamelContext           
-     Started foo (direct://foo)
2024-03-06 09:57:17,999 [main           ] INFO  AbstractCamelContext           
-     Started bar (direct://bar)
2024-03-06 09:57:17,999 [main           ] INFO  AbstractCamelContext           
- Apache Camel 4.5.0-SNAPSHOT (camel-30) started in 1ms (build:0ms init:0ms 
start:1ms)
2024-03-06 09:57:18,389 [main           ] INFO  MockEndpoint                   
- Asserting: mock://result is satisfied
2024-03-06 09:57:18,390 [main           ] INFO  CamelTestSupport               
- 
********************************************************************************
2024-03-06 09:57:18,390 [main           ] INFO  CamelTestSupport               
- Testing done: testMetricsRoutePolicy() 
(org.apache.camel.component.micrometer.routepolicy.ZMicrometerContextOnlyPolicyTest)
2024-03-06 09:57:18,390 [main           ] INFO  CamelTestSupport               
- Took: 390ms (390 millis)
2024-03-06 09:57:18,390 [main           ] INFO  CamelTestSupport               
- 
********************************************************************************
2024-03-06 09:57:18,391 [main           ] INFO  AbstractCamelContext           
- Apache Camel 4.5.0-SNAPSHOT (camel-30) is shutting down (timeout:10s)
2024-03-06 09:57:18,393 [main           ] INFO  AbstractCamelContext           
- Routes stopped (total:2)
2024-03-06 09:57:18,393 [main           ] INFO  AbstractCamelContext           
-     Stopped bar (direct://bar)
2024-03-06 09:57:18,393 [main           ] INFO  AbstractCamelContext           
-     Stopped foo (direct://foo)
2024-03-06 09:57:18,393 [main           ] INFO  AbstractCamelContext           
- Apache Camel 4.5.0-SNAPSHOT (camel-30) shutdown in 2ms (uptime:0s)
{code}

> camel-test - CamelTestSupport does not call tearDown for each test method in 
> some test classes
> ----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-20522
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20522
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-test
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 4.5.0
>
>
> If you have test classes that does not directly extend CamelTestSupport then 
> your tests may not cleanup after testing. All the tearDown is not invoked.
> It seems its due to CamelTestSupport implements both some interfaces from 
> JUnit and also have @AfterEach annotation and this skrews up junit when you 
> have test class hierachies.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to