You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/07/25 05:40:15 UTC
[camel-k-runtime] branch master updated (555e043 -> 3c5ee8e)
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-k-runtime.git.
from 555e043 loader(groovy): add default imports
new e0e2c09 js: components not exported by base script #112
new 3c5ee8e chore(deps): cleanup dependencies
The 2 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:
camel-k-loader-groovy/pom.xml | 19 +++++++---
camel-k-loader-js/pom.xml | 13 +++++++
.../k/loader/js/dsl/IntegrationConfiguration.java | 6 ++--
.../camel/k/loader/js/dsl/IntegrationTest.java | 41 ++++++++++------------
.../routes-with-component-configuration.js | 3 ++
5 files changed, 52 insertions(+), 30 deletions(-)
copy camel-k-runtime-main/src/main/java/org/apache/camel/k/main/Application.java => camel-k-loader-js/src/test/java/org/apache/camel/k/loader/js/dsl/IntegrationTest.java (53%)
create mode 100644 camel-k-loader-js/src/test/resources/routes-with-component-configuration.js
[camel-k-runtime] 01/02: js: components not exported by base script
#112
Posted by lb...@apache.org.
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-k-runtime.git
commit e0e2c09228bee9b10724236bc5ee43b3737bd097
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Thu Jul 25 07:07:59 2019 +0200
js: components not exported by base script #112
---
camel-k-loader-js/pom.xml | 13 +++++++
.../k/loader/js/dsl/IntegrationConfiguration.java | 6 +--
.../camel/k/loader/js/dsl/IntegrationTest.java | 43 ++++++++++++++++++++++
.../routes-with-component-configuration.js | 3 ++
4 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/camel-k-loader-js/pom.xml b/camel-k-loader-js/pom.xml
index 7b496c7..40edead 100644
--- a/camel-k-loader-js/pom.xml
+++ b/camel-k-loader-js/pom.xml
@@ -43,6 +43,10 @@
<version>${graalvm.version}</version>
</dependency>
+ <!-- ******************************* -->
+ <!-- test deps :: camel -->
+ <!-- ******************************* -->
+
<dependency>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-runtime-main</artifactId>
@@ -83,6 +87,15 @@
<artifactId>camel-properties</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-main</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- ******************************* -->
+ <!-- test deps -->
+ <!-- ******************************* -->
<dependency>
<groupId>org.junit.jupiter</groupId>
diff --git a/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/dsl/IntegrationConfiguration.java b/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/dsl/IntegrationConfiguration.java
index 5193bea..a8782b8 100644
--- a/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/dsl/IntegrationConfiguration.java
+++ b/camel-k-loader-js/src/main/java/org/apache/camel/k/loader/js/dsl/IntegrationConfiguration.java
@@ -28,9 +28,9 @@ import org.apache.camel.model.rest.RestDefinition;
import org.apache.camel.spi.Registry;
public class IntegrationConfiguration extends org.apache.camel.builder.BuilderSupport {
- final Registry registry;
- final Components components;
- final RouteBuilder builder;
+ public final Registry registry;
+ public final Components components;
+ public final RouteBuilder builder;
public IntegrationConfiguration(RouteBuilder builder) {
super(builder.getContext());
diff --git a/camel-k-loader-js/src/test/java/org/apache/camel/k/loader/js/dsl/IntegrationTest.java b/camel-k-loader-js/src/test/java/org/apache/camel/k/loader/js/dsl/IntegrationTest.java
new file mode 100644
index 0000000..c5e0aed
--- /dev/null
+++ b/camel-k-loader-js/src/test/java/org/apache/camel/k/loader/js/dsl/IntegrationTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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.k.loader.js.dsl;
+
+import org.apache.camel.component.seda.SedaComponent;
+import org.apache.camel.k.Runtime;
+import org.apache.camel.k.listener.RoutesConfigurer;
+import org.apache.camel.k.main.ApplicationRuntime;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class IntegrationTest {
+ @Test
+ public void testComponentConfiguration() throws Exception {
+ ApplicationRuntime runtime = new ApplicationRuntime();
+ runtime.addListener(RoutesConfigurer.forRoutes("classpath:routes-with-component-configuration.js"));
+ runtime.addListener(Runtime.Phase.Started, r -> {
+ SedaComponent seda = r.getCamelContext().getComponent("seda", SedaComponent.class);
+
+ assertThat(seda).isNotNull();
+ assertThat(seda).hasFieldOrPropertyWithValue("queueSize", 1234);
+
+ runtime.stop();
+ });
+
+ runtime.run();
+ }
+}
diff --git a/camel-k-loader-js/src/test/resources/routes-with-component-configuration.js b/camel-k-loader-js/src/test/resources/routes-with-component-configuration.js
new file mode 100644
index 0000000..3f908ef
--- /dev/null
+++ b/camel-k-loader-js/src/test/resources/routes-with-component-configuration.js
@@ -0,0 +1,3 @@
+
+s = components.get('seda')
+s.setQueueSize(1234)
\ No newline at end of file
[camel-k-runtime] 02/02: chore(deps): cleanup dependencies
Posted by lb...@apache.org.
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-k-runtime.git
commit 3c5ee8e97b37e60db455bc9f3fe59e5cfdc3269e
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Thu Jul 25 07:09:14 2019 +0200
chore(deps): cleanup dependencies
---
camel-k-loader-groovy/pom.xml | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/camel-k-loader-groovy/pom.xml b/camel-k-loader-groovy/pom.xml
index cd51a88..00fae2e 100644
--- a/camel-k-loader-groovy/pom.xml
+++ b/camel-k-loader-groovy/pom.xml
@@ -39,11 +39,6 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-main</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
<artifactId>camel-log</artifactId>
<scope>provided</scope>
</dependency>
@@ -65,6 +60,10 @@
<scope>provided</scope>
</dependency>
+ <!-- ******************************* -->
+ <!-- test deps :: camel -->
+ <!-- ******************************* -->
+
<dependency>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-runtime-main</artifactId>
@@ -72,6 +71,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-main</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-timer</artifactId>
<scope>test</scope>
</dependency>
@@ -95,6 +99,11 @@
<artifactId>camel-properties</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- ******************************* -->
+ <!-- test deps -->
+ <!-- ******************************* -->
+
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-test</artifactId>