[camel-quarkus] branch master updated (68b6096 -> a52d87f)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel-quarkus] branch master updated (68b6096 -> a52d87f)

lburgazzoli-2
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.


    from 68b6096  Add an option to filter auto-discovered routes #396
     new 21c49f1  Fixes #403 adding scheduler extension
     new 2421188  Fixes #403 adding scheduler extension
     new a52d87f  Make test smarter, thanks Peter for the suggestion.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../pages/list-of-camel-quarkus-extensions.adoc    |  5 ++++-
 extensions/pom.xml                                 |  1 +
 extensions/readme.adoc                             |  5 ++++-
 .../{snakeyaml => scheduler}/deployment/pom.xml    |  8 +++----
 .../scheduler/deployment/SchedulerProcessor.java}  |  6 ++---
 extensions/{validator => scheduler}/pom.xml        |  4 ++--
 extensions/{file => scheduler}/runtime/pom.xml     |  8 +++----
 .../main/resources/META-INF/quarkus-extension.yaml |  4 ++--
 integration-tests/pom.xml                          |  1 +
 .../{controlbus => scheduler}/pom.xml              | 23 ++++++++++++-------
 .../component/scheduler/it/SchedulerResource.java} | 26 +++++++++++-----------
 .../component/scheduler/it/SchedulerRoute.java     | 15 +++++++++----
 .../component/scheduler/it/SchedulerIT.java}       |  4 ++--
 .../component/scheduler/it/SchedulerTest.java}     | 24 +++++++++-----------
 poms/bom-deployment/pom.xml                        |  5 +++++
 poms/bom/pom.xml                                   | 10 +++++++++
 16 files changed, 91 insertions(+), 58 deletions(-)
 copy extensions/{snakeyaml => scheduler}/deployment/pom.xml (91%)
 copy extensions/{snakeyaml/deployment/src/main/java/org/apache/camel/quarkus/component/snakeyaml/deployment/SnakeyamlProcessor.java => scheduler/deployment/src/main/java/org/apache/camel/quarkus/component/scheduler/deployment/SchedulerProcessor.java} (87%)
 copy extensions/{validator => scheduler}/pom.xml (93%)
 copy extensions/{file => scheduler}/runtime/pom.xml (92%)
 copy extensions/{timer => scheduler}/runtime/src/main/resources/META-INF/quarkus-extension.yaml (91%)
 copy integration-tests/{controlbus => scheduler}/pom.xml (89%)
 copy integration-tests/{infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelServlet.java => scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java} (67%)
 copy examples/timer-log/src/main/java/org/acme/timer/TimerRoute.java => integration-tests/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerRoute.java (69%)
 copy integration-tests/{csv/src/test/java/org/apache/camel/quarkus/component/csv/it/CsvIT.java => scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerIT.java} (89%)
 copy integration-tests/{netty-http/src/test/java/org/apache/camel/quarkus/component/netty/http/CamelTest.java => scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java} (63%)

Reply | Threaded
Open this post in threaded view
|

[camel-quarkus] 01/03: Fixes #403 adding scheduler extension

lburgazzoli-2
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 21c49f173fdbe696997073377684414c7a7259d2
Author: Claus Ibsen <[hidden email]>
AuthorDate: Tue Nov 12 20:35:31 2019 +0100

    Fixes #403 adding scheduler extension
---
 extensions/pom.xml                                 |   1 +
 extensions/scheduler/deployment/pom.xml            |  75 ++++++++++++
 .../scheduler/deployment/SchedulerProcessor.java   |  31 +++++
 extensions/scheduler/pom.xml                       |  39 ++++++
 extensions/scheduler/runtime/pom.xml               |  82 +++++++++++++
 .../main/resources/META-INF/quarkus-extension.yaml |  27 ++++
 integration-tests/pom.xml                          |   1 +
 integration-tests/scheduler/pom.xml                | 136 +++++++++++++++++++++
 .../component/scheduler/it/SchedulerResource.java  |  48 ++++++++
 .../component/scheduler/it/SchedulerRoute.java     |  35 ++++++
 .../component/scheduler/it/SchedulerIT.java        |  24 ++++
 .../component/scheduler/it/SchedulerTest.java      |  37 ++++++
 poms/bom-deployment/pom.xml                        |   5 +
 poms/bom/pom.xml                                   |  10 ++
 14 files changed, 551 insertions(+)

diff --git a/extensions/pom.xml b/extensions/pom.xml
index 6d17ffd..f6974f5 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -78,6 +78,7 @@
         <module>attachments</module>
         <module>pdf</module>
         <module>controlbus</module>
+        <module>scheduler</module>
 
     </modules>
 
diff --git a/extensions/scheduler/deployment/pom.xml b/extensions/scheduler/deployment/pom.xml
new file mode 100644
index 0000000..c17ace2
--- /dev/null
+++ b/extensions/scheduler/deployment/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-scheduler-parent</artifactId>
+        <version>0.3.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-scheduler-deployment</artifactId>
+    <name>Camel Quarkus :: Scheduler :: Deployment</name>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-deployment</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core-deployment</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-scheduler</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>io.quarkus</groupId>
+                            <artifactId>quarkus-extension-processor</artifactId>
+                            <version>${quarkus.version}</version>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/extensions/scheduler/deployment/src/main/java/org/apache/camel/quarkus/component/scheduler/deployment/SchedulerProcessor.java b/extensions/scheduler/deployment/src/main/java/org/apache/camel/quarkus/component/scheduler/deployment/SchedulerProcessor.java
new file mode 100644
index 0000000..b71566d
--- /dev/null
+++ b/extensions/scheduler/deployment/src/main/java/org/apache/camel/quarkus/component/scheduler/deployment/SchedulerProcessor.java
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.scheduler.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+
+class SchedulerProcessor {
+
+    private static final String FEATURE = "camel-scheduler";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+}
diff --git a/extensions/scheduler/pom.xml b/extensions/scheduler/pom.xml
new file mode 100644
index 0000000..4367f81
--- /dev/null
+++ b/extensions/scheduler/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-build-parent</artifactId>
+        <version>0.3.2-SNAPSHOT</version>
+        <relativePath>../../poms/build-parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-scheduler-parent</artifactId>
+    <name>Camel Quarkus :: Scheduler</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>deployment</module>
+        <module>runtime</module>
+    </modules>
+</project>
diff --git a/extensions/scheduler/runtime/pom.xml b/extensions/scheduler/runtime/pom.xml
new file mode 100644
index 0000000..401bd2e
--- /dev/null
+++ b/extensions/scheduler/runtime/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-scheduler-parent</artifactId>
+        <version>0.3.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-scheduler</artifactId>
+    <name>Camel Quarkus :: Scheduler :: Runtime</name>
+
+    <properties>
+        <firstVersion>0.4.0</firstVersion>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-scheduler</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>io.quarkus</groupId>
+                <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>io.quarkus</groupId>
+                            <artifactId>quarkus-extension-processor</artifactId>
+                            <version>${quarkus.version}</version>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/extensions/scheduler/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/scheduler/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..9169c9d
--- /dev/null
+++ b/extensions/scheduler/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,27 @@
+#
+# 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: "Camel Quarkus Scheduler"
+description: "Camel Scheduler support"
+metadata:
+  keywords:
+  - "camel"
+  - "scheduling"
+  guide: "https://quarkus.io/guides/camel"
+  categories:
+  - "integration"
\ No newline at end of file
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 4365937..89bc03f 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -107,6 +107,7 @@
         <module>zipfile</module>
         <module>pdf</module>
         <module>controlbus</module>
+        <module>scheduler</module>
 
     </modules>
 
diff --git a/integration-tests/scheduler/pom.xml b/integration-tests/scheduler/pom.xml
new file mode 100644
index 0000000..f453ce5
--- /dev/null
+++ b/integration-tests/scheduler/pom.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-integration-tests</artifactId>
+        <version>0.3.2-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-scheduler</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Scheduler</name>
+    <description>Integration tests for Camel Quarkus Scheduler extension</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-scheduler</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-log</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy</artifactId>
+        </dependency>
+
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.rest-assured</groupId>
+            <artifactId>rest-assured</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>io.quarkus</groupId>
+                <artifactId>quarkus-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>build</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>native</id>
+            <activation>
+                <property>
+                    <name>native</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                                <configuration>
+                                    <systemProperties>
+                                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+                                    </systemProperties>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>io.quarkus</groupId>
+                        <artifactId>quarkus-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>native-image</id>
+                                <goals>
+                                    <goal>native-image</goal>
+                                </goals>
+                                <configuration>
+                                    <reportErrorsAtRuntime>false</reportErrorsAtRuntime>
+                                    <cleanupServer>true</cleanupServer>
+                                    <enableHttpsUrlHandler>true</enableHttpsUrlHandler>
+                                    <enableServer>false</enableServer>
+                                    <dumpProxies>false</dumpProxies>
+                                    <graalvmHome>${graalvmHome}</graalvmHome>
+                                    <enableJni>true</enableJni>
+                                    <enableAllSecurityServices>true</enableAllSecurityServices>
+                                    <disableReports>true</disableReports>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
diff --git a/integration-tests/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java b/integration-tests/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java
new file mode 100644
index 0000000..cbb27a4
--- /dev/null
+++ b/integration-tests/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.scheduler.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.ProducerTemplate;
+import org.jboss.logging.Logger;
+
+@Path("/scheduler")
+@ApplicationScoped
+public class SchedulerResource {
+
+    private static final Logger LOG = Logger.getLogger(SchedulerResource.class);
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/get")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response get() throws Exception {
+        String response = producerTemplate.requestBody("direct:start", null, String.class);
+        LOG.infof("Got response from scheduler: %s", response);
+        return Response.ok(response).build();
+    }
+
+}
diff --git a/integration-tests/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerRoute.java b/integration-tests/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerRoute.java
new file mode 100644
index 0000000..255f3e1
--- /dev/null
+++ b/integration-tests/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerRoute.java
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.scheduler.it;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class SchedulerRoute extends RouteBuilder {
+
+    private final AtomicInteger counter = new AtomicInteger();
+
+    @Override
+    public void configure() throws Exception {
+        from("scheduler:start?initialDelay=1")
+                .process(e -> counter.incrementAndGet());
+
+        from("direct:start")
+                .setBody(e -> counter.get());
+    }
+}
diff --git a/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerIT.java b/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerIT.java
new file mode 100644
index 0000000..db02afd
--- /dev/null
+++ b/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerIT.java
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.scheduler.it;
+
+import io.quarkus.test.junit.NativeImageTest;
+
+@NativeImageTest
+class SchedulerIT extends SchedulerTest {
+
+}
diff --git a/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java b/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java
new file mode 100644
index 0000000..1ce2dac
--- /dev/null
+++ b/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.scheduler.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+@QuarkusTest
+class SchedulerTest {
+
+    @Test
+    public void test() throws Exception {
+        // give time for scheduler to run a bit
+        Thread.sleep(50);
+
+        String body = RestAssured.get("/scheduler/get").then().statusCode(200).extract().body().asString();
+        assertNotEquals("0", body);
+    }
+
+}
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index 7424484..304e4d2 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -288,6 +288,11 @@
                 <artifactId>camel-quarkus-netty-deployment</artifactId>
                 <version>${camel-quarkus.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-scheduler-deployment</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
 
 
         </dependencies>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index c4e5e09..ca3c2c9 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -254,6 +254,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel</groupId>
+                <artifactId>camel-scheduler</artifactId>
+                <version>${camel.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel</groupId>
                 <artifactId>camel-servlet</artifactId>
                 <version>${camel.version}</version>
             </dependency>
@@ -570,6 +575,11 @@
                 <artifactId>snakeyaml</artifactId>
                 <version>${snakeyaml.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-scheduler</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
 
 
         </dependencies>

Reply | Threaded
Open this post in threaded view
|

[camel-quarkus] 02/03: Fixes #403 adding scheduler extension

lburgazzoli-2
In reply to this post by lburgazzoli-2
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 24211883324d84a2cf40297fb262bf89298df289
Author: Claus Ibsen <[hidden email]>
AuthorDate: Tue Nov 12 20:54:44 2019 +0100

    Fixes #403 adding scheduler extension
---
 docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc | 5 ++++-
 extensions/readme.adoc                                        | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
index 19b7576..122c3aa 100644
--- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
+++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
@@ -6,7 +6,7 @@ As of Camel Quarkus {camel-quarkus-last-release} the following Camel artifacts a
 == Camel Components
 
 // components: START
-Number of Camel components: 30 in 26 JAR artifacts (0 deprecated)
+Number of Camel components: 31 in 27 JAR artifacts (0 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |===
@@ -78,6 +78,9 @@ Number of Camel components: 30 in 26 JAR artifacts (0 deprecated)
 | link:https://camel.apache.org/components/latest/salesforce-component.html[Salesforce] (camel-quarkus-salesforce) +
 `salesforce:operationName:topicName` | 0.2 | The salesforce component is used for integrating Camel with the massive Salesforce API.
 
+| link:https://camel.apache.org/components/latest/scheduler-component.html[Scheduler] (camel-quarkus-scheduler) +
+`scheduler:name` | 0.4 | The scheduler component is used for generating message exchanges when a scheduler fires.
+
 | link:https://camel.apache.org/components/latest/servlet-component.html[Servlet] (camel-quarkus-servlet) +
 `servlet:contextPath` | 0.2 | To use a HTTP Servlet as entry for Camel routes when running in a servlet container.
 
diff --git a/extensions/readme.adoc b/extensions/readme.adoc
index 1c0cc87..d3f060d 100644
--- a/extensions/readme.adoc
+++ b/extensions/readme.adoc
@@ -5,7 +5,7 @@ Apache Camel Quarkus supports the following Camel artifacts as Quarkus Extension
 == Camel Components
 
 // components: START
-Number of Camel components: 30 in 26 JAR artifacts (0 deprecated)
+Number of Camel components: 31 in 27 JAR artifacts (0 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |===
@@ -77,6 +77,9 @@ Number of Camel components: 30 in 26 JAR artifacts (0 deprecated)
 | link:https://camel.apache.org/components/latest/salesforce-component.html[Salesforce] (camel-quarkus-salesforce) +
 `salesforce:operationName:topicName` | 0.2 | The salesforce component is used for integrating Camel with the massive Salesforce API.
 
+| link:https://camel.apache.org/components/latest/scheduler-component.html[Scheduler] (camel-quarkus-scheduler) +
+`scheduler:name` | 0.4 | The scheduler component is used for generating message exchanges when a scheduler fires.
+
 | link:https://camel.apache.org/components/latest/servlet-component.html[Servlet] (camel-quarkus-servlet) +
 `servlet:contextPath` | 0.2 | To use a HTTP Servlet as entry for Camel routes when running in a servlet container.
 

Reply | Threaded
Open this post in threaded view
|

[camel-quarkus] 03/03: Make test smarter, thanks Peter for the suggestion.

lburgazzoli-2
In reply to this post by lburgazzoli-2
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit a52d87f40e786ae33e78d4d3c576be749def3356
Author: Claus Ibsen <[hidden email]>
AuthorDate: Tue Nov 12 21:09:42 2019 +0100

    Make test smarter, thanks Peter for the suggestion.
---
 integration-tests/scheduler/pom.xml                        | 11 +++++++++++
 .../quarkus/component/scheduler/it/SchedulerTest.java      | 14 ++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/integration-tests/scheduler/pom.xml b/integration-tests/scheduler/pom.xml
index f453ce5..0297f1c 100644
--- a/integration-tests/scheduler/pom.xml
+++ b/integration-tests/scheduler/pom.xml
@@ -60,6 +60,17 @@
             <artifactId>rest-assured</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.hamcrest</groupId>
+                    <artifactId>hamcrest-core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java b/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java
index 1ce2dac..1274121 100644
--- a/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java
+++ b/integration-tests/scheduler/src/test/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerTest.java
@@ -16,22 +16,24 @@
  */
 package org.apache.camel.quarkus.component.scheduler.it;
 
+import java.util.concurrent.TimeUnit;
+
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.awaitility.Awaitility.await;
 
 @QuarkusTest
 class SchedulerTest {
 
     @Test
     public void test() throws Exception {
-        // give time for scheduler to run a bit
-        Thread.sleep(50);
-
-        String body = RestAssured.get("/scheduler/get").then().statusCode(200).extract().body().asString();
-        assertNotEquals("0", body);
+        // wait until the scheduler has run and return a counter that is > 0
+        await().atMost(2, TimeUnit.SECONDS).until(() -> {
+            String body = RestAssured.get("/scheduler/get").then().statusCode(200).extract().body().asString();
+            return !body.equals("0");
+        });
     }
 
 }