Skip to content

Commit

Permalink
Ref apache#276: Propose an integration test framework (apache#277)
Browse files Browse the repository at this point in the history
* Add camel jetty integration test
* Provide a way to easily deploy Camel routes written in Java by implementing `CamelRouteSupplier`
* Provide a way to easily deploy Camel routes written using Blueprint DSL by adding them into `OSGI-INF/blueprint`
* Allow remote debug by adding the system property `camel.karaf.itest.debug` to the build command
* Allow providing hints to the framework thanks to the annotation `CamelKarafTestHint`
* Allow to manage several Camel contexts
* Provide samples to show how to use it

---------

Co-authored-by: François de Parscau <116000379+f2par0@users.noreply.github.com>
Co-authored-by: Francois de Parscau <francois.deparscau@qlik.com>
  • Loading branch information
3 people authored May 30, 2024
1 parent 7d102d3 commit 3feaf6c
Show file tree
Hide file tree
Showing 62 changed files with 3,415 additions and 463 deletions.
4 changes: 2 additions & 2 deletions components/camel-blueprint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<firstVersion>2.4.0</firstVersion>
<label>java,osgi</label>
<camel.osgi.export>
org.apache.camel.blueprint*,
org.apache.camel.util.blueprint*
org.apache.camel.blueprint*;version=${project.version},
org.apache.camel.util.blueprint*;version=${project.version}
</camel.osgi.export>
<camel.osgi.import>
jakarta.xml.bind*;version="[3,5)",
Expand Down
17 changes: 17 additions & 0 deletions components/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,21 @@
<module>camel-zookeeper-master</module>
</modules>

<build>
<plugins>
<!-- generates an osgi repository added to the test karaf containing the dependencies-->
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-depends-file</id>
<goals>
<goal>generate-depends-file</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
16 changes: 11 additions & 5 deletions features/src/main/feature/camel-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -832,12 +832,18 @@
<feature name='camel-elasticsearch' version='${project.version}' start-level='50'>
<feature version='${camel.osgi.version.range}'>camel-core</feature>
<feature prerequisite='true'>wrap</feature>
<feature prerequisite="true">spifly</feature>
<feature version='[2.16,2.17)'>jackson</feature>
<feature version="[4,5)">http-client</feature>
<bundle dependency="true">mvn:org.glassfish.hk2/osgi-resource-locator/2.5.0-b42</bundle>
<bundle dependency="true">mvn:org.eclipse.parsson/parsson/${parson-version}</bundle>
<bundle dependency='true'>mvn:jakarta.json/jakarta.json-api/${jakarta-json-api-version}</bundle>
<bundle dependency='true'>wrap:mvn:io.opentelemetry/opentelemetry-api/${opentelemetry-version}</bundle>
<bundle dependency='true'>wrap:mvn:io.opentelemetry/opentelemetry-context/${opentelemetry-version}</bundle>
<bundle dependency='true'>wrap:mvn:org.apache.httpcomponents/httpasyncclient/${httpasyncclient-version}</bundle>
<bundle dependency='true'>wrap:mvn:co.elastic.clients/elasticsearch-java/8.12.1</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client/8.12.1</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client-sniffer/8.12.1</bundle>
<bundle dependency='true'>wrap:mvn:co.elastic.clients/elasticsearch-java/${elasticsearch-java-client-version}</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client/${elasticsearch-java-client-version}</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client-sniffer/${elasticsearch-java-client-sniffer-version}</bundle>
<bundle>mvn:org.apache.camel.karaf/camel-elasticsearch/${project.version}</bundle>
</feature>
<feature name='camel-elasticsearch-rest-client' version='${project.version}' start-level='50'>
Expand All @@ -846,8 +852,8 @@
<feature version='[2.16,2.17)'>jackson</feature>
<feature version="[4,5)">http-client</feature>
<bundle dependency='true'>wrap:mvn:org.apache.httpcomponents/httpasyncclient/${httpasyncclient-version}</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client/8.12.1</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client-sniffer/8.12.1</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client/${elasticsearch-java-client-version}</bundle>
<bundle dependency='true'>wrap:mvn:org.elasticsearch.client/elasticsearch-rest-client-sniffer/${elasticsearch-java-client-sniffer-version}</bundle>
<bundle>mvn:org.apache.camel.karaf/camel-elasticsearch-rest-client/${project.version}</bundle>
</feature>
<feature name='camel-elytron' version='${project.version}' start-level='50'>
Expand Down
31 changes: 28 additions & 3 deletions tests/camel-integration-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@
<configuration>
<instructions>
<Export-Package>
org.apache.karaf.camel.itests;version=${camel.version}
org.apache.karaf.camel.itests;version=${project.version},
</Export-Package>
<Import-Package>
org.apache.karaf.itests,org.ops4j.pax.exam,org.osgi.framework,org.junit,
org.apache.karaf.itests,
org.ops4j.pax.exam,
org.ops4j.pax.exam.options,
org.osgi.framework,
org.junit*,
org.apache.camel.blueprint;resolution:=optional;${camel.osgi.import.camel.version},
org.apache.camel*;${camel.osgi.import.camel.version},
org.apache.karaf.features,
org.ops4j.pax.swissbox.tracker,
org.osgi.service.*,
org.awaitility*
org.awaitility*,
org.slf4j
</Import-Package>
</instructions>
<excludeDependencies>geronimo-atinject_1.0_spec</excludeDependencies>
Expand Down Expand Up @@ -108,6 +116,11 @@
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-karaf</artifactId>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-junit4</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
Expand Down Expand Up @@ -165,5 +178,17 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.camel.karaf</groupId>
<artifactId>camel-blueprint</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers-version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3feaf6c

Please sign in to comment.