You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Federico Mariani (Jira)" <ji...@apache.org> on 2025/01/22 11:54:00 UTC

[jira] [Resolved] (CAMEL-21452) camel-test-infra: decouple the infrastructure from the testing API

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

Federico Mariani resolved CAMEL-21452.
--------------------------------------
    Resolution: Fixed

> camel-test-infra: decouple the infrastructure from the testing API
> ------------------------------------------------------------------
>
>                 Key: CAMEL-21452
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21452
>             Project: Camel
>          Issue Type: Task
>          Components: camel-test-infra
>    Affects Versions: 4.9.0
>            Reporter: Otavio Rodolfo Piske
>            Assignee: Federico Mariani
>            Priority: Major
>             Fix For: 4.10.0
>
>
> It turns out that the test infrastructure management code on the test-infra could be useful in multiple other scenarios (i.e.: for Camel JBang). However, there's a small set of classes that are bound to the test API used by Camel. These APIs would make re-purposing the test infra harder and inelegant for users of that code. 
> It should be relatively simple to decouple this API (high-level steps, details may vary slightly):
> 1. Split 
> {{{color:#000000}org.apache.camel.test.infra.common.services{color}.TestService}} in 2 parts: one named {{InfrastructureService}} for the infrastructure code (containing {{{}registerProperties{}}}, {{{}initialize{}}}, {{shutdown}} and {{{}close{}}}) and another retaining the {{TestService}} name (containing the {{beforeAll}} and {{afterAll}} callbacks from JUnit's {{{}BeforeAllCallback{}}}, {color:#000000}{{AfterAllCallback}} interfaces){color}
> {color:#000000}2. Rename the existing {{<Name>Service}} to {{<Name>TestService}} (i.e.: {{{}ElasticSearchTestService{}}}) and make sure it implements the {{TestService}} API{color}
> {color:#000000}3. Create a new <Name>Service and make sure it DOES NOT implement the {{TestService}} API
> {color}
> {color:#000000}4. Move the infrastructure code to {{src/main}}{color}
> {color:#000000}5. Keep the Camel-specific test infra code (i.e.:  <Name>TestService) within {{src/test}}{color}
>  
> Repeat for all services in the test-infra.



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