Skip to content

Commit

Permalink
Fix apache#31 Move infinispan integration-tests out of core
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Jul 9, 2019
1 parent 692b3e6 commit a92185a
Show file tree
Hide file tree
Showing 12 changed files with 215 additions and 48 deletions.
8 changes: 4 additions & 4 deletions extensions/infinispan/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<name>Camel Quarkus :: Infinispan :: Deployment</name>

<dependencies>

<!-- quarkus -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core-deployment</artifactId>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>

<!-- quarkus -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-deployment</artifactId>
Expand Down
9 changes: 5 additions & 4 deletions extensions/infinispan/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@

<dependencies>

<!-- quarkus -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>

<!-- quarkus -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core</artifactId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
4 changes: 4 additions & 0 deletions extensions/netty4-http/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-netty</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<artifactId>svm</artifactId>
Expand Down
18 changes: 0 additions & 18 deletions integration-tests/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-netty4-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-infinispan</artifactId>
</dependency>

<dependency>
<groupId>org.jboss.slf4j</groupId>
Expand All @@ -65,20 +61,6 @@
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-hotrod</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-hotrod</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package io.quarkus.it.camel.core;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
Expand All @@ -29,8 +28,6 @@
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.bean.BeanProcessor;
import org.apache.camel.component.infinispan.InfinispanConstants;
import org.apache.camel.component.infinispan.InfinispanOperation;
import org.apache.camel.support.DefaultExchange;

import io.quarkus.runtime.annotations.RegisterForReflection;
Expand Down Expand Up @@ -62,21 +59,7 @@ public void configure() {

from("netty4-http:http://0.0.0.0:8999/foo")
.transform().constant("Netty Hello World");
from("netty4-http:http://0.0.0.0:8999/put")
.convertBodyTo(byte[].class)
.to("log:cache?showAll=true")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
.setHeader(InfinispanConstants.KEY).constant("the-key".getBytes(StandardCharsets.UTF_8))
.setHeader(InfinispanConstants.VALUE).body()
.to("infinispan:default?hosts=localhost:11232");

from("netty4-http:http://0.0.0.0:8999/get")
.setHeader(InfinispanConstants.OPERATION)
.constant(InfinispanOperation.GET)
.setHeader(InfinispanConstants.KEY)
.constant("the-key".getBytes(StandardCharsets.UTF_8))
.to("infinispan:default?hosts=localhost:11232")
.to("log:cache?showAll=true");

}

public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import io.restassured.RestAssured;

@QuarkusTest
@QuarkusTestResource(InfinispanServerTestResource.class)
public class CamelTest {
@Test
public void testRoutes() {
Expand Down
150 changes: 150 additions & 0 deletions integration-tests/infinispan/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<?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">
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>camel-quarkus-integration-test-infinispan</artifactId>
<name>Camel Quarkus :: Integration Tests :: Infinispan</name>
<description>Integration tests for Camel Infinispan component</description>

<properties>
<!-- Skip enforcer plugin as we want to use jboss marshalling for test class -->
<enforcer.skip>true</enforcer.skip>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-infinispan</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-netty4-http</artifactId>
</dependency>

<!-- Undertow is here only for the test runner to be able to detect that the server has started -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-undertow</artifactId>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-hotrod</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-hotrod</artifactId>
</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-image</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>
<enableHttpUrlHandler>true</enableHttpUrlHandler>
<enableServer>false</enableServer>
<dumpProxies>false</dumpProxies>
<graalvmHome>${graalvmHome}</graalvmHome>
<enableJni>false</enableJni>
<disableReports>true</disableReports>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 io.quarkus.it.camel.infinispan;

import java.nio.charset.StandardCharsets;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.infinispan.InfinispanConstants;
import org.apache.camel.component.infinispan.InfinispanOperation;

public class CamelRoute extends RouteBuilder {

@Override
public void configure() {

from("netty4-http:http://0.0.0.0:8999/put")
.convertBodyTo(byte[].class)
.to("log:cache?showAll=true")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
.setHeader(InfinispanConstants.KEY).constant("the-key".getBytes(StandardCharsets.UTF_8))
.setHeader(InfinispanConstants.VALUE).body()
.to("infinispan:default?hosts=localhost:11232");

from("netty4-http:http://0.0.0.0:8999/get")
.setHeader(InfinispanConstants.OPERATION)
.constant(InfinispanOperation.GET)
.setHeader(InfinispanConstants.KEY)
.constant("the-key".getBytes(StandardCharsets.UTF_8))
.to("infinispan:default?hosts=localhost:11232")
.to("log:cache?showAll=true");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.quarkus.it.camel.core;
package io.quarkus.it.camel.infinispan;

import io.quarkus.test.junit.SubstrateTest;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.quarkus.it.camel.core;
package io.quarkus.it.camel.infinispan;

import static org.hamcrest.Matchers.is;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.quarkus.it.camel.core;
package io.quarkus.it.camel.infinispan;

import java.util.Collections;
import java.util.Map;
Expand Down
1 change: 1 addition & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<module>aws-s3</module>
<module>aws-sns</module>
<module>aws-sqs</module>
<module>infinispan</module>
<module>jdbc</module>
<module>salesforce</module>
<module>servlet</module>
Expand Down

0 comments on commit a92185a

Please sign in to comment.