Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test packages to org.apache.camel #77

Merged
merged 2 commits into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.substrate.ReflectiveMethodBuildItem;
import io.quarkus.deployment.builditem.substrate.SubstrateConfigBuildItem;
import io.quarkus.deployment.builditem.substrate.SubstrateResourceBuildItem;
import io.quarkus.deployment.builditem.substrate.SubstrateResourceBundleBuildItem;
import io.quarkus.jaxb.deployment.JaxbEnabledBuildItem;
Expand Down Expand Up @@ -105,11 +106,12 @@ List<ReflectiveClassBuildItem> handleXmlSupport() {
return null;
} else {
return Arrays.asList(
new ReflectiveClassBuildItem(false, false,
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"),
new ReflectiveClassBuildItem(false, false,
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"),
new ReflectiveClassBuildItem(false, false, "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"));
new ReflectiveClassBuildItem(false, false,
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"),
new ReflectiveClassBuildItem(false, false,
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"),
new ReflectiveClassBuildItem(false, false,
"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"));
}
}

Expand All @@ -118,6 +120,15 @@ FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
SubstrateConfigBuildItem substrate() {
return SubstrateConfigBuildItem.builder()
// TODO: switch back to caffeine once https://github.com/apache/camel-quarkus/issues/80 gets fixed
.addNativeImageSystemProperty("CamelWarmUpLRUCacheFactory", "true")
.addNativeImageSystemProperty("CamelSimpleLRUCacheFactory", "true")
.build();
}

@BuildStep
List<HotDeploymentWatchedFileBuildItem> configFile() {
return buildTimeConfig.routesUris.stream()
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 org.apache.camel.quarkus.component.netty4http.deployment;
package org.apache.camel.quarkus.component.netty4.http.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
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 org.apache.camel.quarkus.component.netty4http.runtime;
package org.apache.camel.quarkus.component.netty4.http.runtime;

import org.apache.camel.component.netty4.NettyHelper;
import org.apache.camel.util.concurrent.CamelThreadFactory;
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.camel.component.servlet.test;
package org.apache.camel.quarkus.component.servlet.test;

import org.apache.camel.builder.RouteBuilder;
import org.hamcrest.core.IsEqual;
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.servlet;
package org.apache.camel.quarkus.component.servlet.test;

import java.io.IOException;

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.camel.component.servlet.test;
package org.apache.camel.quarkus.component.servlet.test;

import org.apache.camel.builder.RouteBuilder;
import org.hamcrest.core.IsEqual;
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.camel.component.servlet.test;
package org.apache.camel.quarkus.component.servlet.test;

import org.apache.camel.builder.RouteBuilder;
import org.hamcrest.core.IsEqual;
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.aws;
package org.apache.camel.quarkus.component.aws;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote for keeping it somewhere in the integration test package names. org.apache.camel.quarkus.component.aws.it or org.apache.camel.quarkus.it.component.aws or some other variant. This is to avoid any potential naming clashes with the the platform code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I do usually keep the same name is to be able to access package private methods/classes for testing purpose, I can change it but I propose to do it later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be able to access package private methods/classes for testing purpose

Yes, that's normal and OK for unit tests. OTOH integration tests should simulate how our end users use camel quarkus. We should not assume that they access non-public APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's partially true as we do not have any unit test for the native image side of things


import org.apache.camel.builder.RouteBuilder;

Expand All @@ -35,12 +35,12 @@ public void configure() {
.setBody(constant("Quarkus is great!"))
.to("aws-sqs://camel-1")
.to("log:sf?showAll=true");

from("timer:quarkus-eks?repeatCount=1")
.setHeader("CamelAwsEKSOperation", constant("listClusters"))
.to("aws-eks://cluster")
.to("log:sf?showAll=true");

from("timer:quarkus-sns?repeatCount=1")
.setBody(constant("Quarkus is great!"))
.to("aws-sns://topic1")
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 org.apache.camel.quarkus.core;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
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 org.apache.camel.quarkus.core;

import java.util.ArrayList;
import java.util.LinkedHashMap;
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 org.apache.camel.quarkus.core;

import java.util.List;
import java.util.stream.Collectors;
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 org.apache.camel.quarkus.core;

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 org.apache.camel.quarkus.core;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
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.infinispan;
package org.apache.camel.quarkus.component.infinispan;

import java.nio.charset.StandardCharsets;

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

import io.quarkus.test.junit.SubstrateTest;
import org.junit.jupiter.api.Disabled;

/**
* If CamelSimpleLRUCacheFactory=true, infinispan fails.
* It needs to be investigated on camel side.
*/
@Disabled("https://github.com/apache/camel-quarkus/issues/80")
@SubstrateTest
public class CamelInfinispanITCase extends CamelInfinispanTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.quarkus.it.camel.infinispan;

import static org.hamcrest.Matchers.is;
package org.apache.camel.quarkus.component.infinispan;

import java.net.URI;

import org.junit.jupiter.api.Test;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.junit.jupiter.api.Test;

import static org.hamcrest.Matchers.is;

@QuarkusTest
@QuarkusTestResource(InfinispanServerTestResource.class)
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.infinispan;
package org.apache.camel.quarkus.component.infinispan;

import java.util.Collections;
import java.util.Map;
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.jdbc;
package org.apache.camel.quarkus.component.jdbc;

import java.sql.Connection;
import java.sql.SQLException;
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.jdbc;
package org.apache.camel.quarkus.component.jdbc;

import org.apache.camel.builder.RouteBuilder;

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.jdbc;
package org.apache.camel.quarkus.component.jdbc;

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.jdbc;
package org.apache.camel.quarkus.component.jdbc;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
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.jdbc;
package org.apache.camel.quarkus.component.jdbc;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.h2.H2DatabaseTestResource;
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.netty4http;
package org.apache.camel.quarkus.component.netty4.http;

import org.apache.camel.builder.RouteBuilder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.quarkus.it.camel.netty4http;
package org.apache.camel.quarkus.component.netty4.http;

import io.quarkus.test.junit.SubstrateTest;

@SubstrateTest
public class CamelITCase extends CamelTest {
public class CamelIT extends CamelTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.quarkus.it.camel.netty4http;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
package org.apache.camel.quarkus.component.netty4.http;

import java.net.URI;

import org.junit.jupiter.api.Test;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.junit.jupiter.api.Test;

import static org.hamcrest.Matchers.is;

@QuarkusTest
public class CamelTest {
Expand Down

This file was deleted.

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.salesforce;
package org.apache.camel.quarkus.component.salesforce;

import org.apache.camel.builder.RouteBuilder;

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.salesforce;
package org.apache.camel.quarkus.component.salesforce;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
Expand All @@ -28,7 +28,7 @@
import org.apache.camel.ProducerTemplate;
import org.apache.camel.quarkus.core.runtime.CamelRuntime;

@Path("/")
@Path("/test")
@ApplicationScoped
public class CamelServlet {
@Inject
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.servlet;
package org.apache.camel.quarkus.component.servlet;

import javax.enterprise.context.ApplicationScoped;

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.camel.component.servlet.test;
package org.apache.camel.quarkus.component.servlet;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ quarkus.camel.defer-init-phase=false
#
quarkus.camel.servlet.url-patterns=/folder-1/*,/folder-2/*
quarkus.camel.servlet.my-named-servlet.url-patterns=/my-named-folder/*
quarkus.camel.servlet.my-named-servlet.servlet-class=io.quarkus.it.camel.servlet.CustomServlet
quarkus.camel.servlet.my-named-servlet.servlet-class=org.apache.camel.quarkus.component.servlet.CustomServlet
quarkus.camel.servlet.ignored-key.servlet-name=my-favorite-servlet
quarkus.camel.servlet.ignored-key.url-patterns=/my-favorite-folder/*

Expand Down