Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/camel-kamelets-itest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,44 @@
<artifactId>camel-aws2-sns</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-sql</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${version.org.postgresql.postgresql}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mongodb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-redis</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cassandraql</artifactId>
<scope>test</scope>
</dependency>

<!-- Citrus -->
<dependency>
Expand Down
33 changes: 33 additions & 0 deletions tests/camel-kamelets-itest/src/test/java/CassandraIT.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.util.stream.Stream;

import org.citrusframework.common.TestLoader;
import org.citrusframework.junit.jupiter.CitrusSupport;
import org.citrusframework.junit.jupiter.CitrusTestFactory;
import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
import org.junit.jupiter.api.DynamicTest;

@CitrusSupport
public class CassandraIT {

@CitrusTestFactory
public Stream<DynamicTest> cassandra() {
return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("cassandra");
}
}
33 changes: 33 additions & 0 deletions tests/camel-kamelets-itest/src/test/java/MongoIT.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.util.stream.Stream;

import org.citrusframework.common.TestLoader;
import org.citrusframework.junit.jupiter.CitrusSupport;
import org.citrusframework.junit.jupiter.CitrusTestFactory;
import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
import org.junit.jupiter.api.DynamicTest;

@CitrusSupport
public class MongoIT {

@CitrusTestFactory
public Stream<DynamicTest> mongo() {
return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("mongo");
}
}
33 changes: 33 additions & 0 deletions tests/camel-kamelets-itest/src/test/java/PostgresIT.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.util.stream.Stream;

import org.citrusframework.common.TestLoader;
import org.citrusframework.junit.jupiter.CitrusSupport;
import org.citrusframework.junit.jupiter.CitrusTestFactory;
import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
import org.junit.jupiter.api.DynamicTest;

@CitrusSupport
public class PostgresIT {

@CitrusTestFactory
public Stream<DynamicTest> postgres() {
return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("postgres");
}
}
33 changes: 33 additions & 0 deletions tests/camel-kamelets-itest/src/test/java/RedisIT.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.util.stream.Stream;

import org.citrusframework.common.TestLoader;
import org.citrusframework.junit.jupiter.CitrusSupport;
import org.citrusframework.junit.jupiter.CitrusTestFactory;
import org.citrusframework.junit.jupiter.CitrusTestFactorySupport;
import org.junit.jupiter.api.DynamicTest;

@CitrusSupport
public class RedisIT {

@CitrusTestFactory
public Stream<DynamicTest> redis() {
return CitrusTestFactorySupport.factory(TestLoader.YAML).packageScan("redis");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

name: cassandra-sink-route-test
actions:
# Create Cassandra infrastructure
- testcontainers:
start:
container:
name: "cassandra"
image: "cassandra:4.1"
exposedPorts:
- 9042
startUpTimeout: 120
env:
- name: "CASSANDRA_SNITCH"
value: "GossipingPropertyFileSnitch"
- name: "JVM_OPTS"
value: "-Dcassandra.skip_wait_for_gossip_to_settle=0 -Dcassandra.initial_token=0"
- name: "HEAP_NEWSIZE"
value: "128M"
- name: "MAX_HEAP_SIZE"
value: "1024M"
- name: "CASSANDRA_ENDPOINT_SNITCH"
value: "GossipingPropertyFileSnitch"
- name: "CASSANDRA_DC"
value: "datacenter1"
waitFor:
logMessage: "Startup complete"

# Setup keyspace and table
- groovy:
script:
file: "cassandra/setupKeyspace.groovy"

# Create Camel JBang integration (sink)
- camel:
jbang:
run:
waitForRunningState: false
integration:
file: "cassandra/cassandra-sink-route.yaml"
systemProperties:
properties:
- name: "cassandra.host"
value: "${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}"
- name: "cassandra.port"
value: "${CITRUS_TESTCONTAINERS_CASSANDRA_SERVICE_PORT}"

# Verify Cassandra sink executed
- camel:
jbang:
verify:
integration: "cassandra-sink-route"
logMessage: "from-cassandra-sink"
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

- route:
from:
uri: "timer:tick"
parameters:
period: "10000"
repeatCount: 1
steps:
- setBody:
constant: '[{"id": 42, "name": "sink-test", "value": "from-cassandra-sink"}]'
- to:
uri: "kamelet:cassandra-sink"
parameters:
connectionHost: "{{cassandra.host}}"
connectionPort: "{{cassandra.port}}"
keyspace: "test_ks"
query: "INSERT INTO test_data (id, name, value) VALUES (?, ?, ?)"
consistencyLevel: "ONE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

name: cassandra-source-route-test
actions:
# Create Cassandra infrastructure
- testcontainers:
start:
container:
name: "cassandra"
image: "cassandra:4.1"
exposedPorts:
- 9042
startUpTimeout: 120
env:
- name: "CASSANDRA_SNITCH"
value: "GossipingPropertyFileSnitch"
- name: "JVM_OPTS"
value: "-Dcassandra.skip_wait_for_gossip_to_settle=0 -Dcassandra.initial_token=0"
- name: "HEAP_NEWSIZE"
value: "128M"
- name: "MAX_HEAP_SIZE"
value: "1024M"
- name: "CASSANDRA_ENDPOINT_SNITCH"
value: "GossipingPropertyFileSnitch"
- name: "CASSANDRA_DC"
value: "datacenter1"
waitFor:
logMessage: "Startup complete"

# Setup keyspace and table
- groovy:
script:
file: "cassandra/setupKeyspace.groovy"

# Create Camel JBang integration (source)
- camel:
jbang:
run:
waitForRunningState: false
integration:
file: "cassandra/cassandra-source-route.yaml"
systemProperties:
properties:
- name: "cassandra.host"
value: "${CITRUS_TESTCONTAINERS_CASSANDRA_HOST}"
- name: "cassandra.port"
value: "${CITRUS_TESTCONTAINERS_CASSANDRA_SERVICE_PORT}"

# Verify Cassandra source
- camel:
jbang:
verify:
integration: "cassandra-source-route"
logMessage: "hello-cassandra"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

- route:
from:
uri: "kamelet:cassandra-source"
parameters:
connectionHost: "{{cassandra.host}}"
connectionPort: "{{cassandra.port}}"
keyspace: "test_ks"
query: "SELECT * FROM test_data"
consistencyLevel: "ONE"
steps:
- to:
uri: "kamelet:log-sink"
Loading
Loading