You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2021/06/25 05:27:09 UTC
[camel-k-runtime] branch camel-main-camel-3.10-cq-2x created (now
8a625d1)
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a change to branch camel-main-camel-3.10-cq-2x
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git.
at 8a625d1 Updated CHANGELOG.md
This branch includes the following new commits:
new bcd5de9 fix(core): default SourceType as source
new 963b7eb build(deps): bump jandex-maven-plugin from 1.0.8 to 1.1.0
new 8a625d1 Updated CHANGELOG.md
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.
[camel-k-runtime] 02/03: build(deps): bump jandex-maven-plugin from
1.0.8 to 1.1.0
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch camel-main-camel-3.10-cq-2x
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
commit 963b7eb6eb77c339cda0e907a8d93a4beea4cc87
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Wed Jun 2 19:03:20 2021 +0000
build(deps): bump jandex-maven-plugin from 1.0.8 to 1.1.0
Bumps [jandex-maven-plugin](https://github.com/wildfly/jandex-maven-plugin) from 1.0.8 to 1.1.0.
- [Release notes](https://github.com/wildfly/jandex-maven-plugin/releases)
- [Commits](https://github.com/wildfly/jandex-maven-plugin/commits)
---
updated-dependencies:
- dependency-name: org.jboss.jandex:jandex-maven-plugin
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <su...@github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index dcef1fc..deb6ff0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -72,7 +72,7 @@
<maven-javadoc-plugin-version>3.3.0</maven-javadoc-plugin-version>
<maven-source-plugin-version>3.2.1</maven-source-plugin-version>
<maven-assembly-plugin-version>3.3.0</maven-assembly-plugin-version>
- <jandex-maven-plugin-version>1.0.8</jandex-maven-plugin-version>
+ <jandex-maven-plugin-version>1.1.0</jandex-maven-plugin-version>
<build-helper-maven-plugin-version>3.2.0</build-helper-maven-plugin-version>
<maven-jar-plugin-version>3.2.0</maven-jar-plugin-version>
<maven-invoker-plugin-version>3.2.1</maven-invoker-plugin-version>
[camel-k-runtime] 01/03: fix(core): default SourceType as source
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch camel-main-camel-3.10-cq-2x
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
commit bcd5de9d36d98b8e54eb61d065963a0c1ff0a44e
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Tue May 25 15:12:31 2021 +0200
fix(core): default SourceType as source
Setting any empty SourceType as a source.
Closes #658
Closes https://github.com/apache/camel-k/issues/2223
---
.../java/org/apache/camel/k/SourceDefinition.java | 3 +-
.../apache/camel/k/listener/SourcesConfigurer.java | 15 +-------
.../camel/k/listener/SourceConfigurerTest.java | 45 ++++++++++++++++++----
3 files changed, 41 insertions(+), 22 deletions(-)
diff --git a/camel-k-core/api/src/main/java/org/apache/camel/k/SourceDefinition.java b/camel-k-core/api/src/main/java/org/apache/camel/k/SourceDefinition.java
index ff3f0ea..dbc8784 100644
--- a/camel-k-core/api/src/main/java/org/apache/camel/k/SourceDefinition.java
+++ b/camel-k-core/api/src/main/java/org/apache/camel/k/SourceDefinition.java
@@ -28,7 +28,8 @@ public class SourceDefinition implements IdAware {
private String language;
private String loader;
private List<String> interceptors;
- private SourceType type;
+ // Default as source type
+ private SourceType type = SourceType.source;
private List<String> propertyNames;
private String location;
private byte[] content;
diff --git a/camel-k-core/support/src/main/java/org/apache/camel/k/listener/SourcesConfigurer.java b/camel-k-core/support/src/main/java/org/apache/camel/k/listener/SourcesConfigurer.java
index 69c061c..4488590 100644
--- a/camel-k-core/support/src/main/java/org/apache/camel/k/listener/SourcesConfigurer.java
+++ b/camel-k-core/support/src/main/java/org/apache/camel/k/listener/SourcesConfigurer.java
@@ -17,6 +17,7 @@
package org.apache.camel.k.listener;
import java.util.Arrays;
+import java.util.Comparator;
import org.apache.camel.k.Runtime;
import org.apache.camel.k.SourceDefinition;
@@ -100,19 +101,7 @@ public class SourcesConfigurer extends AbstractPhaseListener {
return;
}
// We must ensure the source order as defined in SourceType enum
- Arrays.sort(sources,
- (a, b) -> {
- if (a.getType() == null && b.getType() == null) {
- return 0;
- }
- if (a.getType() == null) {
- return SourceType.source.compareTo(b.getType());
- } else if (b.getType() == null) {
- return a.getType().compareTo(SourceType.source);
- } else {
- return a.getType().compareTo(b.getType());
- }
- });
+ Arrays.sort(sources, Comparator.comparingInt(a -> a.getType().ordinal()));
}
}
diff --git a/camel-k-core/support/src/test/java/org/apache/camel/k/listener/SourceConfigurerTest.java b/camel-k-core/support/src/test/java/org/apache/camel/k/listener/SourceConfigurerTest.java
index edebe28..732c77a 100644
--- a/camel-k-core/support/src/test/java/org/apache/camel/k/listener/SourceConfigurerTest.java
+++ b/camel-k-core/support/src/test/java/org/apache/camel/k/listener/SourceConfigurerTest.java
@@ -18,26 +18,26 @@ package org.apache.camel.k.listener;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.k.SourceType;
import org.apache.camel.k.support.PropertiesSupport;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import static org.apache.camel.k.test.CamelKTestSupport.asProperties;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
public class SourceConfigurerTest {
@Test
public void shouldLoadMultipleSources() {
CamelContext context = new DefaultCamelContext();
context.getPropertiesComponent().setInitialProperties(asProperties(
- "camel.k.sources[0].name", "sourceName0",
- "camel.k.sources[0].location", "classpath:MyTemplate1.java",
+ "camel.k.sources[0].name", "templateName",
+ "camel.k.sources[0].location", "classpath:MyTemplate.java",
"camel.k.sources[0].type", "template",
- "camel.k.sources[1].name", "err1",
- "camel.k.sources[1].location", "classpath:MyTemplate2.java",
- "camel.k.sources[2].name", "err2",
- "camel.k.sources[2].location", "classpath:Err2.java",
+ "camel.k.sources[1].name", "src",
+ "camel.k.sources[1].location", "classpath:MySrc.java",
+ "camel.k.sources[2].name", "err",
+ "camel.k.sources[2].location", "classpath:Err.java",
"camel.k.sources[2].type", "errorHandler"
));
@@ -56,7 +56,7 @@ public class SourceConfigurerTest {
public void shouldFailOnMultipleErrorHandlers() {
CamelContext context = new DefaultCamelContext();
context.getPropertiesComponent().setInitialProperties(asProperties(
- "camel.k.sources[0].name", "sourceName0",
+ "camel.k.sources[0].name", "templateName0",
"camel.k.sources[0].location", "classpath:MyTemplate1.java",
"camel.k.sources[0].type", "template",
"camel.k.sources[1].name", "err1",
@@ -82,12 +82,37 @@ public class SourceConfigurerTest {
}
@Test
+ public void shouldDefaultSourcesWithEmptyType() {
+ CamelContext context = new DefaultCamelContext();
+ context.getPropertiesComponent().setInitialProperties(asProperties(
+ "camel.k.sources[0].name", "source0",
+ "camel.k.sources[1].name", "source1",
+ "camel.k.sources[2].name", "source2",
+ "camel.k.sources[2].type", "source"
+ ));
+
+ SourcesConfigurer configuration = new SourcesConfigurer();
+
+ PropertiesSupport.bindProperties(
+ context,
+ configuration,
+ k -> k.startsWith(SourcesConfigurer.CAMEL_K_SOURCES_PREFIX),
+ SourcesConfigurer.CAMEL_K_PREFIX);
+
+ assertThat(configuration.getSources().length).isEqualTo(3);
+ assertThat(configuration.getSources()[0].getType()).isEqualTo(SourceType.source);
+ assertThat(configuration.getSources()[1].getType()).isEqualTo(SourceType.source);
+ assertThat(configuration.getSources()[2].getType()).isEqualTo(SourceType.source);
+ }
+
+ @Test
public void shouldOrderSourcesByType() {
CamelContext context = new DefaultCamelContext();
context.getPropertiesComponent().setInitialProperties(asProperties(
"camel.k.sources[0].name", "template1",
"camel.k.sources[0].type", "template",
"camel.k.sources[1].name", "source1",
+ "camel.k.sources[1].type", "source",
"camel.k.sources[2].name", "source2",
"camel.k.sources[3].name", "errorHandler1",
"camel.k.sources[3].type", "errorHandler"
@@ -104,10 +129,14 @@ public class SourceConfigurerTest {
assertThat(configuration.getSources()).hasSize(4);
assertThat(configuration.getSources()[0].getName()).isEqualTo("errorHandler1");
+ assertThat(configuration.getSources()[0].getType()).isEqualTo(SourceType.errorHandler);
assertThat(configuration.getSources()[1].getName()).isEqualTo("template1");
+ assertThat(configuration.getSources()[1].getType()).isEqualTo(SourceType.template);
// Order for the same type does not matter
assertThat(configuration.getSources()[2].getName()).contains("source");
+ assertThat(configuration.getSources()[2].getType()).isEqualTo(SourceType.source);
assertThat(configuration.getSources()[3].getName()).contains("source");
+ assertThat(configuration.getSources()[3].getType()).isEqualTo(SourceType.source);
}
@Test
[camel-k-runtime] 03/03: Updated CHANGELOG.md
Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch camel-main-camel-3.10-cq-2x
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
commit 8a625d1b131b109caa92e98cc617daa775c056de
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Fri Jun 11 03:27:45 2021 +0000
Updated CHANGELOG.md
---
CHANGELOG.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d54e7f..2be415c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
- Flaky test: KnativeEnvFromRegistryTest [\#704](https://github.com/apache/camel-k-runtime/issues/704)
- Re-enable YamlSourceLoaderTest [\#687](https://github.com/apache/camel-k-runtime/issues/687)
- Support for simple, linear integration definitions [\#659](https://github.com/apache/camel-k-runtime/issues/659)
+- SourceType should not be null [\#658](https://github.com/apache/camel-k-runtime/issues/658)
- Optional parameters in Kamelet route templates [\#631](https://github.com/apache/camel-k-runtime/issues/631)
- Duplicated loadUserProperties\(\) method call [\#625](https://github.com/apache/camel-k-runtime/issues/625)
- Assess integration container resources layout changes impacts [\#614](https://github.com/apache/camel-k-runtime/issues/614)
@@ -21,6 +22,8 @@
**Merged pull requests:**
- Remove preview flag from YAML docs [\#710](https://github.com/apache/camel-k-runtime/pull/710) ([heiko-braun](https://github.com/heiko-braun))
+- build\(deps\): bump jandex-maven-plugin from 1.0.8 to 1.1.0 [\#699](https://github.com/apache/camel-k-runtime/pull/699) ([dependabot[bot]](https://github.com/apps/dependabot))
+- fix\(core\): default SourceType as source [\#685](https://github.com/apache/camel-k-runtime/pull/685) ([squakez](https://github.com/squakez))
- build\(deps\): bump maven-javadoc-plugin from 3.2.0 to 3.3.0 [\#680](https://github.com/apache/camel-k-runtime/pull/680) ([dependabot[bot]](https://github.com/apps/dependabot))
- GH action fixes [\#674](https://github.com/apache/camel-k-runtime/pull/674) ([orpiske](https://github.com/orpiske))
- Enable GH actions on camel-main branch [\#671](https://github.com/apache/camel-k-runtime/pull/671) ([orpiske](https://github.com/orpiske))