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 2021/06/10 07:42:20 UTC
[camel-k-runtime] branch camel-main updated (c69fa13 -> fdee446)
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a change to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git.
from c69fa13 example: add kamelet discovery example
new 1331bd7 yaml-dsl: remove support for configuring flow mode as it has been implemented in camel-quarkus
new fdee446 deps: update to camel-quarkus 2.0.0-SNAPSHOT as required for yaml dsl
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/listener/YamlConfigurerConfigurer.java | 49 ------------------
.../org.apache.camel.k.listener.YamlConfigurer | 2 -
.../apache/camel/k/listener/YamlConfigurer.java | 56 ---------------------
.../services/org.apache.camel.k.Runtime$Listener | 1 -
.../camel/k/listener/YamlConfigurerTest.java | 50 -------------------
examples/kamelets-discovery/pom.xml | 4 +-
itests/camel-k-itests-runtime/pom.xml | 4 ++
.../it/RuntimeYamlDeserializationClassicIT.java | 23 ---------
.../it/RuntimeYamlDeserializationClassicTest.java | 58 ----------------------
.../it/RuntimeYamlDeserializationFlowIT.java | 23 ---------
.../it/RuntimeYamlDeserializationFlowTest.java | 58 ----------------------
pom.xml | 6 +--
12 files changed, 9 insertions(+), 325 deletions(-)
delete mode 100644 camel-k-core/support/src/generated/java/org/apache/camel/k/listener/YamlConfigurerConfigurer.java
delete mode 100644 camel-k-core/support/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.k.listener.YamlConfigurer
delete mode 100644 camel-k-core/support/src/main/java/org/apache/camel/k/listener/YamlConfigurer.java
delete mode 100644 camel-k-core/support/src/test/java/org/apache/camel/k/listener/YamlConfigurerTest.java
delete mode 100644 itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicIT.java
delete mode 100644 itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicTest.java
delete mode 100644 itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowIT.java
delete mode 100644 itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowTest.java
[camel-k-runtime] 02/02: deps: update to camel-quarkus
2.0.0-SNAPSHOT as required for yaml dsl
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
commit fdee446f10c5bfbce94efa486474f578b6e5c1cd
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Thu Jun 10 08:09:31 2021 +0200
deps: update to camel-quarkus 2.0.0-SNAPSHOT as required for yaml dsl
---
.../it/RuntimeYamlDeserializationClassicIT.java | 23 ---------
.../it/RuntimeYamlDeserializationClassicTest.java | 58 ----------------------
.../it/RuntimeYamlDeserializationFlowIT.java | 23 ---------
.../it/RuntimeYamlDeserializationFlowTest.java | 58 ----------------------
pom.xml | 6 +--
5 files changed, 3 insertions(+), 165 deletions(-)
diff --git a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicIT.java b/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicIT.java
deleted file mode 100644
index cc187e5..0000000
--- a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicIT.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.quarkus.it;
-
-import io.quarkus.test.junit.NativeImageTest;
-
-@NativeImageTest
-public class RuntimeYamlDeserializationClassicIT extends RuntimeYamlDeserializationClassicTest {
-}
\ No newline at end of file
diff --git a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicTest.java b/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicTest.java
deleted file mode 100644
index 4b4e6a6..0000000
--- a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationClassicTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.quarkus.it;
-
-import java.util.Map;
-
-import javax.ws.rs.core.MediaType;
-
-import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.QuarkusTestProfile;
-import io.quarkus.test.junit.TestProfile;
-import io.restassured.path.json.JsonPath;
-import org.junit.jupiter.api.Test;
-
-import static io.restassured.RestAssured.given;
-import static org.apache.camel.util.CollectionHelper.mapOf;
-import static org.assertj.core.api.Assertions.assertThat;
-
-@TestProfile(RuntimeYamlDeserializationClassicTest.Profile.class)
-@QuarkusTest
-public class RuntimeYamlDeserializationClassicTest {
- @Test
- public void testContextCustomizerFromProperties() {
- JsonPath p = given()
- .accept(MediaType.APPLICATION_JSON)
- .get("/test/inspect")
- .then()
- .statusCode(200)
- .extract()
- .body()
- .jsonPath();
-
- assertThat(p.getMap("global-options")).containsEntry("CamelYamlDslDeserializationMode", "CLASSIC");
- }
-
- public static class Profile implements QuarkusTestProfile {
- @Override
- public Map<String, String> getConfigOverrides() {
- return mapOf(
- "camel.k.yaml.deserialization-mode", "CLASSIC"
- );
- }
- }
-}
diff --git a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowIT.java b/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowIT.java
deleted file mode 100644
index d83acc8..0000000
--- a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowIT.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.quarkus.it;
-
-import io.quarkus.test.junit.NativeImageTest;
-
-@NativeImageTest
-public class RuntimeYamlDeserializationFlowIT extends RuntimeYamlDeserializationFlowTest {
-}
\ No newline at end of file
diff --git a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowTest.java b/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowTest.java
deleted file mode 100644
index d760cd6..0000000
--- a/itests/camel-k-itests-runtime/src/test/java/org/apache/camel/k/quarkus/it/RuntimeYamlDeserializationFlowTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.quarkus.it;
-
-import java.util.Map;
-
-import javax.ws.rs.core.MediaType;
-
-import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.QuarkusTestProfile;
-import io.quarkus.test.junit.TestProfile;
-import io.restassured.path.json.JsonPath;
-import org.junit.jupiter.api.Test;
-
-import static io.restassured.RestAssured.given;
-import static org.apache.camel.util.CollectionHelper.mapOf;
-import static org.assertj.core.api.Assertions.assertThat;
-
-@TestProfile(RuntimeYamlDeserializationFlowTest.Profile.class)
-@QuarkusTest
-public class RuntimeYamlDeserializationFlowTest {
- @Test
- public void testContextCustomizerFromProperties() {
- JsonPath p = given()
- .accept(MediaType.APPLICATION_JSON)
- .get("/test/inspect")
- .then()
- .statusCode(200)
- .extract()
- .body()
- .jsonPath();
-
- assertThat(p.getMap("global-options")).containsEntry("CamelYamlDslDeserializationMode", "FLOW");
- }
-
- public static class Profile implements QuarkusTestProfile {
- @Override
- public Map<String, String> getConfigOverrides() {
- return mapOf(
- "camel.k.yaml.deserialization-mode", "FLOW"
- );
- }
- }
-}
diff --git a/pom.xml b/pom.xml
index 1a1255b..760217e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,9 +41,9 @@
<camel-version>3.10.0</camel-version>
<!-- quarkus -->
- <camel-quarkus-version>2.0.0-M1</camel-quarkus-version>
- <graalvm-version>21.0.0</graalvm-version>
- <quarkus-version>2.0.0.Alpha3</quarkus-version>
+ <camel-quarkus-version>2.0.0-SNAPSHOT</camel-quarkus-version>
+ <graalvm-version>21.1.0</graalvm-version>
+ <quarkus-version>2.0.0.CR3</quarkus-version>
<!-- camel-k -->
<groovy-version>3.0.7</groovy-version>
[camel-k-runtime] 01/02: yaml-dsl: remove support for configuring
flow mode as it has been implemented in camel-quarkus
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
commit 1331bd7e20b3d854a92f1ca4b0ccce5c897a3808
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Thu Jun 10 08:08:59 2021 +0200
yaml-dsl: remove support for configuring flow mode as it has been implemented in camel-quarkus
---
.../camel/k/listener/YamlConfigurerConfigurer.java | 49 -------------------
.../org.apache.camel.k.listener.YamlConfigurer | 2 -
.../apache/camel/k/listener/YamlConfigurer.java | 56 ----------------------
.../services/org.apache.camel.k.Runtime$Listener | 1 -
.../camel/k/listener/YamlConfigurerTest.java | 50 -------------------
examples/kamelets-discovery/pom.xml | 4 +-
itests/camel-k-itests-runtime/pom.xml | 4 ++
7 files changed, 6 insertions(+), 160 deletions(-)
diff --git a/camel-k-core/support/src/generated/java/org/apache/camel/k/listener/YamlConfigurerConfigurer.java b/camel-k-core/support/src/generated/java/org/apache/camel/k/listener/YamlConfigurerConfigurer.java
deleted file mode 100644
index 39cade8..0000000
--- a/camel-k-core/support/src/generated/java/org/apache/camel/k/listener/YamlConfigurerConfigurer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.k.listener;
-
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
-import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
-import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.k.listener.YamlConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-@SuppressWarnings("unchecked")
-public class YamlConfigurerConfigurer extends org.apache.camel.support.component.PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- org.apache.camel.k.listener.YamlConfigurer target = (org.apache.camel.k.listener.YamlConfigurer) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "deserializationmode":
- case "DeserializationMode": target.setDeserializationMode(property(camelContext, java.lang.String.class, value)); return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "deserializationmode":
- case "DeserializationMode": return java.lang.String.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- org.apache.camel.k.listener.YamlConfigurer target = (org.apache.camel.k.listener.YamlConfigurer) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "deserializationmode":
- case "DeserializationMode": return target.getDeserializationMode();
- default: return null;
- }
- }
-}
-
diff --git a/camel-k-core/support/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.k.listener.YamlConfigurer b/camel-k-core/support/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.k.listener.YamlConfigurer
deleted file mode 100644
index 88860b3..0000000
--- a/camel-k-core/support/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.k.listener.YamlConfigurer
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.k.listener.YamlConfigurerConfigurer
diff --git a/camel-k-core/support/src/main/java/org/apache/camel/k/listener/YamlConfigurer.java b/camel-k-core/support/src/main/java/org/apache/camel/k/listener/YamlConfigurer.java
deleted file mode 100644
index 6b918f7..0000000
--- a/camel-k-core/support/src/main/java/org/apache/camel/k/listener/YamlConfigurer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.listener;
-
-import org.apache.camel.k.Runtime;
-import org.apache.camel.k.support.PropertiesSupport;
-import org.apache.camel.spi.Configurer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Configurer
-public class YamlConfigurer extends AbstractPhaseListener {
- public static final Logger LOGGER = LoggerFactory.getLogger(YamlConfigurer.class);
- public static final String CAMEL_K_YAML_PROPERTIES_PREFIX = "camel.k.yaml.";
-
- private String deserializationMode = "FLOW";
-
- public YamlConfigurer() {
- super(Runtime.Phase.ConfigureContext);
- }
-
- public String getDeserializationMode() {
- return deserializationMode;
- }
-
- public void setDeserializationMode(String deserializationMode) {
- this.deserializationMode = deserializationMode;
- }
-
- @Override
- protected void accept(Runtime runtime) {
- PropertiesSupport.bindProperties(
- runtime.getCamelContext(),
- this,
- CAMEL_K_YAML_PROPERTIES_PREFIX,
- true);
-
- runtime.getCamelContext().getGlobalOptions().put("CamelYamlDslDeserializationMode", getDeserializationMode());
-
- LOGGER.info("CamelYamlDslDeserializationMode : {}", runtime.getCamelContext().getGlobalOption("CamelYamlDslDeserializationMode"));
- }
-}
diff --git a/camel-k-core/support/src/main/resources/META-INF/services/org.apache.camel.k.Runtime$Listener b/camel-k-core/support/src/main/resources/META-INF/services/org.apache.camel.k.Runtime$Listener
index 4701174..f0c50b7 100644
--- a/camel-k-core/support/src/main/resources/META-INF/services/org.apache.camel.k.Runtime$Listener
+++ b/camel-k-core/support/src/main/resources/META-INF/services/org.apache.camel.k.Runtime$Listener
@@ -16,6 +16,5 @@
#
org.apache.camel.k.listener.ContextConfigurer
-org.apache.camel.k.listener.YamlConfigurer
org.apache.camel.k.listener.SourcesConfigurer
org.apache.camel.k.listener.PropertiesConfigurer
diff --git a/camel-k-core/support/src/test/java/org/apache/camel/k/listener/YamlConfigurerTest.java b/camel-k-core/support/src/test/java/org/apache/camel/k/listener/YamlConfigurerTest.java
deleted file mode 100644
index 6336436..0000000
--- a/camel-k-core/support/src/test/java/org/apache/camel/k/listener/YamlConfigurerTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.listener;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.k.Runtime;
-import org.junit.jupiter.api.Test;
-
-import static org.apache.camel.util.PropertiesHelper.asProperties;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class YamlConfigurerTest {
- @Test
- public void yamlDeserializationModeShouldBeEnabledByDefault() {
- CamelContext context = new DefaultCamelContext();
-
- YamlConfigurer configuration = new YamlConfigurer();
- configuration.accept(Runtime.on(context));
-
- assertThat(context.getGlobalOptions()).containsEntry("CamelYamlDslDeserializationMode", "FLOW");
- }
-
- @Test
- public void yamlDeserializationModeShouldBeEnabledConfigurable() {
- CamelContext context = new DefaultCamelContext();
- context.getPropertiesComponent().setInitialProperties(asProperties(
- "camel.k.yaml.deserialization-mode", "CLASSIC"
- ));
-
- YamlConfigurer configuration = new YamlConfigurer();
- configuration.accept(Runtime.on(context));
-
- assertThat(context.getGlobalOptions()).containsEntry("CamelYamlDslDeserializationMode", "CLASSIC");
- }
-}
diff --git a/examples/kamelets-discovery/pom.xml b/examples/kamelets-discovery/pom.xml
index 0b5f7a9..caa7c64 100644
--- a/examples/kamelets-discovery/pom.xml
+++ b/examples/kamelets-discovery/pom.xml
@@ -39,8 +39,8 @@
<artifactId>camel-k-runtime</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-yaml-dsl</artifactId>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-yaml-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
diff --git a/itests/camel-k-itests-runtime/pom.xml b/itests/camel-k-itests-runtime/pom.xml
index 268f0c7..6a081d3 100644
--- a/itests/camel-k-itests-runtime/pom.xml
+++ b/itests/camel-k-itests-runtime/pom.xml
@@ -32,6 +32,10 @@
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-runtime</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-yaml-dsl</artifactId>
+ </dependency>
<dependency>
<groupId>io.quarkus</groupId>