You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2021/05/19 10:17:29 UTC

[camel-quarkus] 03/15: Rename Simple test module to Core Languages because it now covers multiple Camel Core languages #2613

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

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

commit 8cab8146584cd863fbb9d34927ee5c3de83b10b5
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Tue May 18 14:07:49 2021 +0200

    Rename Simple test module to Core Languages because it now covers
    multiple Camel Core languages #2613
---
 .../foundation/{simple => core-languages}/pom.xml  |  6 ++--
 .../core/languages/it/CoreLanguagesResource.java}  |  6 ++--
 .../it/ExchangePropertyLanguageRoutes.java}        | 13 ++++++---
 .../core/languages/it/HeaderLanguageRoutes.java}   | 15 +++++++---
 .../languages/it}/ReflectionConfigurations.java    |  2 +-
 .../quarkus/core/languages/it}/SimpleRoutes.java   |  8 +-----
 .../src/main/resources/application.properties      |  0
 .../src/main/resources/mysimple.txt                |  0
 .../languages/it/ExchangePropertyLanguageIT.java}  |  4 +--
 .../it/ExchangePropertyLanguageTest.java}          | 19 ++++++++++---
 .../core/languages/it/HeaderLanguageIT.java}       |  4 +--
 .../core/languages/it/HeaderLanguageTest.java}     | 17 +++++++++---
 .../camel/quarkus/core/languages/it}/SimpleIT.java |  2 +-
 .../quarkus/core/languages/it}/SimpleTest.java     | 32 ++++++++--------------
 integration-test-groups/foundation/pom.xml         |  2 +-
 15 files changed, 73 insertions(+), 57 deletions(-)

diff --git a/integration-test-groups/foundation/simple/pom.xml b/integration-test-groups/foundation/core-languages/pom.xml
similarity index 93%
rename from integration-test-groups/foundation/simple/pom.xml
rename to integration-test-groups/foundation/core-languages/pom.xml
index 288d876..a362ba7 100644
--- a/integration-test-groups/foundation/simple/pom.xml
+++ b/integration-test-groups/foundation/core-languages/pom.xml
@@ -26,9 +26,9 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-integration-test-simple</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Simple :: Tests</name>
-    <description>The camel quarkus integration tests for the simple language</description>
+    <artifactId>camel-quarkus-integration-test-core-languages</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Core Languages :: Tests</name>
+    <description>The camel quarkus integration tests for Camel Core languages: Constant, ExchangeProperty, Header, Ref, Simple</description>
 
     <dependencies>
         <dependency>
diff --git a/integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/SimpleResource.java b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/CoreLanguagesResource.java
similarity index 96%
rename from integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/SimpleResource.java
rename to integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/CoreLanguagesResource.java
index a61c3f9..a8541de 100644
--- a/integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/SimpleResource.java
+++ b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/CoreLanguagesResource.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.language.simple;
+package org.apache.camel.quarkus.core.languages.it;
 
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
@@ -30,9 +30,9 @@ import javax.ws.rs.core.MediaType;
 
 import org.apache.camel.ProducerTemplate;
 
-@Path("/simple")
+@Path("/core-languages")
 @ApplicationScoped
-public class SimpleResource {
+public class CoreLanguagesResource {
 
     @Inject
     ProducerTemplate template;
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageRoutes.java
similarity index 71%
copy from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
copy to integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageRoutes.java
index 04ec3a7..238e8c6 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
+++ b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageRoutes.java
@@ -14,11 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
-import io.quarkus.test.junit.NativeImageTest;
+import org.apache.camel.builder.RouteBuilder;
 
-@NativeImageTest
-public class SimpleIT extends SimpleTest {
+public class ExchangePropertyLanguageRoutes extends RouteBuilder {
+
+    @Override
+    public void configure() {
+        from("direct:myExchangePropertyRoute")
+                .setBody().exchangeProperty("myExchangeProperty");
+    }
 
 }
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageRoutes.java
similarity index 73%
copy from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
copy to integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageRoutes.java
index 04ec3a7..fb38a67 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
+++ b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageRoutes.java
@@ -14,11 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
-import io.quarkus.test.junit.NativeImageTest;
+import org.apache.camel.builder.RouteBuilder;
 
-@NativeImageTest
-public class SimpleIT extends SimpleTest {
+public class HeaderLanguageRoutes extends RouteBuilder {
+
+    @Override
+    public void configure() {
+
+        from("direct:myHeaderRoute")
+                .setBody().header("myHeader");
+
+    }
 
 }
diff --git a/integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/ReflectionConfigurations.java b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ReflectionConfigurations.java
similarity index 96%
rename from integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/ReflectionConfigurations.java
rename to integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ReflectionConfigurations.java
index 503c1c2..748a38b 100644
--- a/integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/ReflectionConfigurations.java
+++ b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ReflectionConfigurations.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.language.simple;
+package org.apache.camel.quarkus.core.languages.it;
 
 import java.nio.ByteBuffer;
 
diff --git a/integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/SimpleRoutes.java b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/SimpleRoutes.java
similarity index 86%
rename from integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/SimpleRoutes.java
rename to integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/SimpleRoutes.java
index 692645b..ede1f2e 100644
--- a/integration-test-groups/foundation/simple/src/main/java/org/apache/camel/quarkus/language/simple/SimpleRoutes.java
+++ b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/SimpleRoutes.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.language.simple;
+package org.apache.camel.quarkus.core.languages.it;
 
 import org.apache.camel.builder.RouteBuilder;
 
@@ -33,12 +33,6 @@ public class SimpleRoutes extends RouteBuilder {
 
         from("direct:bodyIs-simple").filter().simple("${body} is 'java.nio.ByteBuffer'").setBody(constant("BYTE_BUFFER"));
 
-        from("direct:myExchangePropertyRoute")
-                .setBody().exchangeProperty("myExchangeProperty");
-
-        from("direct:myHeaderRoute")
-                .setBody().header("myHeader");
-
     }
 
 }
diff --git a/integration-test-groups/foundation/simple/src/main/resources/application.properties b/integration-test-groups/foundation/core-languages/src/main/resources/application.properties
similarity index 100%
rename from integration-test-groups/foundation/simple/src/main/resources/application.properties
rename to integration-test-groups/foundation/core-languages/src/main/resources/application.properties
diff --git a/integration-test-groups/foundation/simple/src/main/resources/mysimple.txt b/integration-test-groups/foundation/core-languages/src/main/resources/mysimple.txt
similarity index 100%
rename from integration-test-groups/foundation/simple/src/main/resources/mysimple.txt
rename to integration-test-groups/foundation/core-languages/src/main/resources/mysimple.txt
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageIT.java
similarity index 86%
copy from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
copy to integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageIT.java
index 04ec3a7..778cb3c 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageIT.java
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
 import io.quarkus.test.junit.NativeImageTest;
 
 @NativeImageTest
-public class SimpleIT extends SimpleTest {
+public class ExchangePropertyLanguageIT extends ExchangePropertyLanguageTest {
 
 }
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageTest.java
similarity index 60%
copy from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
copy to integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageTest.java
index 04ec3a7..484df7e 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ExchangePropertyLanguageTest.java
@@ -14,11 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
-import io.quarkus.test.junit.NativeImageTest;
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
 
-@NativeImageTest
-public class SimpleIT extends SimpleTest {
+import static io.restassured.RestAssured.given;
+import static org.hamcrest.CoreMatchers.is;
+
+@QuarkusTest
+public class ExchangePropertyLanguageTest {
+
+    @Test
+    public void exchangeProperty() {
+        given().body("foo").post("/core-languages/exchangeProperty/myExchangePropertyRoute/myExchangeProperty/1234").then()
+                .statusCode(200)
+                .body(is("1234"));
+    }
 
 }
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageIT.java
similarity index 88%
copy from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
copy to integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageIT.java
index 04ec3a7..f200faa 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageIT.java
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
 import io.quarkus.test.junit.NativeImageTest;
 
 @NativeImageTest
-public class SimpleIT extends SimpleTest {
+public class HeaderLanguageIT extends HeaderLanguageTest {
 
 }
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageTest.java
similarity index 63%
copy from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
copy to integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageTest.java
index 04ec3a7..12cb48f 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/HeaderLanguageTest.java
@@ -14,11 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
-import io.quarkus.test.junit.NativeImageTest;
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
 
-@NativeImageTest
-public class SimpleIT extends SimpleTest {
+import static io.restassured.RestAssured.given;
+import static org.hamcrest.CoreMatchers.is;
+
+@QuarkusTest
+public class HeaderLanguageTest {
+    @Test
+    public void header() {
+        given().body("foo").post("/core-languages/header/myHeaderRoute/myHeader/barbaz").then().statusCode(200)
+                .body(is("barbaz"));
+    }
 
 }
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/SimpleIT.java
similarity index 94%
rename from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
rename to integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/SimpleIT.java
index 04ec3a7..2a97c36 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleIT.java
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/SimpleIT.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
 import io.quarkus.test.junit.NativeImageTest;
 
diff --git a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleTest.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/SimpleTest.java
similarity index 61%
rename from integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleTest.java
rename to integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/SimpleTest.java
index 4242685..66f8dc1 100644
--- a/integration-test-groups/foundation/simple/src/test/java/org/apache/camel/quarkus/core/SimpleTest.java
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/SimpleTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.core.languages.it;
 
 import io.quarkus.test.junit.QuarkusTest;
 import org.junit.jupiter.api.Test;
@@ -27,55 +27,45 @@ public class SimpleTest {
 
     @Test
     public void premiumHeaderShouldPassThroughFilter() {
-        given().body("foo").when().post("/simple/header/filter-simple/premium/true").then().statusCode(200).body(is("PREMIUM"));
+        given().body("foo").when().post("/core-languages/header/filter-simple/premium/true").then().statusCode(200)
+                .body(is("PREMIUM"));
     }
 
     @Test
     public void notPremiumHeaderShouldNotPassThroughFilter() {
-        given().body("foo").when().post("/simple/header/filter-simple/premium/false").then().statusCode(200)
+        given().body("foo").when().post("/core-languages/header/filter-simple/premium/false").then().statusCode(200)
                 .body(is("foo"));
     }
 
     @Test
     public void aliceUserHeaderShouldBeTransformedToHelloAlice() {
-        given().body("Alice").when().post("/simple/header/transform-simple/user/Alice").then().statusCode(200)
+        given().body("Alice").when().post("/core-languages/header/transform-simple/user/Alice").then().statusCode(200)
                 .body(is("Hello Alice !"));
     }
 
     @Test
     public void aliceBodyShouldBeTransformedToTheNameIsAlice() {
-        given().body("Alice").when().post("/simple/route/resource-simple/String").then().statusCode(200)
+        given().body("Alice").when().post("/core-languages/route/resource-simple/String").then().statusCode(200)
                 .body(is("The name is Alice"));
     }
 
     @Test
     public void goldBodyShouldPassThroughFilter() {
-        given().body("gold").when().post("/simple/route/mandatoryBodyAs-simple/byte[]").then().statusCode(200)
+        given().body("gold").when().post("/core-languages/route/mandatoryBodyAs-simple/byte[]").then().statusCode(200)
                 .body(is("PREMIUM"));
     }
 
     @Test
     public void stringBodyShouldNotPassThroughBodyIsFilter() {
-        given().body("STRING").when().post("/simple/route/bodyIs-simple/String").then().statusCode(200).body(is("STRING"));
+        given().body("STRING").when().post("/core-languages/route/bodyIs-simple/String").then().statusCode(200)
+                .body(is("STRING"));
     }
 
     @Test
     public void byteBufferBodyShouldPassThroughBodyIsFilter() {
-        given().body("A body of type ByteBuffer").when().post("/simple/route/bodyIs-simple/ByteBuffer").then().statusCode(200)
-                .body(is("BYTE_BUFFER"));
-    }
-
-    @Test
-    public void exchangeProperty() {
-        given().body("foo").post("/simple/exchangeProperty/myExchangePropertyRoute/myExchangeProperty/1234").then()
+        given().body("A body of type ByteBuffer").when().post("/core-languages/route/bodyIs-simple/ByteBuffer").then()
                 .statusCode(200)
-                .body(is("1234"));
-    }
-
-    @Test
-    public void header() {
-        given().body("foo").post("/simple/header/myHeaderRoute/myHeader/barbaz").then().statusCode(200)
-                .body(is("barbaz"));
+                .body(is("BYTE_BUFFER"));
     }
 
 }
diff --git a/integration-test-groups/foundation/pom.xml b/integration-test-groups/foundation/pom.xml
index 0f8adfb..3bd6f79 100644
--- a/integration-test-groups/foundation/pom.xml
+++ b/integration-test-groups/foundation/pom.xml
@@ -38,6 +38,7 @@
         <module>controlbus</module>
         <module>core</module>
         <module>core-annotations</module>
+        <module>core-languages</module>
         <module>customized-log-component</module>
         <module>direct</module>
         <module>log</module>
@@ -45,7 +46,6 @@
         <module>ref</module>
         <module>scheduler</module>
         <module>seda</module>
-        <module>simple</module>
         <module>stream</module>
         <module>timer</module>
         <module>type-converter</module>