This is an automated email from the ASF dual-hosted git repository. zbendhiba pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 88743158e2a6bb240ad51618978b5604a04c32c1 Author: Zineb Bendhiba <[email protected]> AuthorDate: Fri Mar 24 11:00:16 2023 +0100 Drop Dozer extension --- extensions/dozer/deployment/pom.xml | 65 -------- .../component/dozer/deployment/DozerProcessor.java | 175 --------------------- extensions/dozer/pom.xml | 37 ----- extensions/dozer/runtime/pom.xml | 118 -------------- .../dozer/runtime/src/main/doc/configuration.adoc | 23 --- .../quarkus/component/dozer/CamelDozerConfig.java | 41 ----- .../component/dozer/CamelDozerRecorder.java | 40 ----- .../dozer/graal/DozerOSGiSubstitutions.java | 113 ------------- .../main/resources/META-INF/quarkus-extension.yaml | 32 ---- extensions/pom.xml | 1 - integration-tests/dozer/pom.xml | 132 ---------------- .../quarkus/component/dozer/it/DozerResource.java | 79 ---------- .../quarkus/component/dozer/it/DozerRoutes.java | 37 ----- .../component/dozer/it/model/CustomerA.java | 115 -------------- .../component/dozer/it/model/CustomerB.java | 166 ------------------- .../src/main/resources/application.properties | 24 --- .../src/main/resources/expression-mapping.xml | 35 ----- .../dozer/src/main/resources/simple-mapping.xml | 40 ----- .../dozer/src/main/resources/variable-mapping.xml | 42 ----- .../camel/quarkus/component/dozer/it/DozerIT.java | 24 --- .../quarkus/component/dozer/it/DozerTest.java | 74 --------- integration-tests/pom.xml | 1 - 22 files changed, 1414 deletions(-) diff --git a/extensions/dozer/deployment/pom.xml b/extensions/dozer/deployment/pom.xml deleted file mode 100644 index 45a3de248d..0000000000 --- a/extensions/dozer/deployment/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-dozer-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-dozer-deployment</artifactId> - <name>Camel Quarkus :: Dozer :: Deployment</name> - - <dependencies> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-jaxb-deployment</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-core-deployment</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-dozer</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths> - <path> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-processor</artifactId> - <version>${quarkus.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/extensions/dozer/deployment/src/main/java/org/apache/camel/quarkus/component/dozer/deployment/DozerProcessor.java b/extensions/dozer/deployment/src/main/java/org/apache/camel/quarkus/component/dozer/deployment/DozerProcessor.java deleted file mode 100644 index f0b529fadc..0000000000 --- a/extensions/dozer/deployment/src/main/java/org/apache/camel/quarkus/component/dozer/deployment/DozerProcessor.java +++ /dev/null @@ -1,175 +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.quarkus.component.dozer.deployment; - -import java.io.File; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.sql.Time; -import java.sql.Timestamp; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.Mapper; -import com.sun.el.ExpressionFactoryImpl; -import io.quarkus.deployment.annotations.BuildProducer; -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.annotations.ExecutionTime; -import io.quarkus.deployment.annotations.Record; -import io.quarkus.deployment.builditem.AdditionalApplicationArchiveMarkerBuildItem; -import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; -import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; -import io.quarkus.jaxb.deployment.JaxbFileRootBuildItem; -import org.apache.camel.converter.dozer.DozerBeanMapperConfiguration; -import org.apache.camel.converter.dozer.DozerThreadContextClassLoader; -import org.apache.camel.quarkus.component.dozer.CamelDozerConfig; -import org.apache.camel.quarkus.component.dozer.CamelDozerRecorder; -import org.apache.camel.quarkus.core.deployment.spi.CamelBeanBuildItem; -import org.apache.camel.quarkus.core.deployment.spi.CamelContextBuildItem; - -class DozerProcessor { - - private static final String FEATURE = "camel-dozer"; - - @BuildStep - FeatureBuildItem feature() { - return new FeatureBuildItem(FEATURE); - } - - @BuildStep - JaxbFileRootBuildItem dozerJaxbFileRoot() { - return new JaxbFileRootBuildItem("com/github/dozermapper/core/builder/model/jaxb"); - } - - @BuildStep - AdditionalApplicationArchiveMarkerBuildItem dozerArchiveMarker() { - return new AdditionalApplicationArchiveMarkerBuildItem("com/github/dozermapper/core"); - } - - @BuildStep - void configureCamelDozer(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, - BuildProducer<NativeImageResourceBuildItem> nativeImage, - CamelDozerConfig camelDozerConfig) { - - // Add user Dozer mapping files to the image - camelDozerConfig.mappingFiles.orElse(Collections.emptyList()) - .stream() - .map(this::mappingPathToURI) - // No scheme means classpath URI - .filter(uri -> uri.getScheme() == null) - .map(uri -> new NativeImageResourceBuildItem(uri.getPath())) - .forEach(nativeImage::produce); - - // Add Dozer DTD & XSD resources to the image - nativeImage.produce(new NativeImageResourceBuildItem( - "dtd/bean-mapping.dtd", - "dtd/bean-mapping-6.0.0.dtd", - "dtd/bean-mapping-6.2.0.dtd", - "schema/bean-mapping.xsd", - "schema/bean-mapping-6.0.0.xsd", - "schema/bean-mapping-6.2.0.xsd")); - - reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, - BigDecimal[].class, - BigInteger[].class, - Boolean[].class, - Byte[].class, - Calendar[].class, - Character[].class, - Class[].class, - Date[].class, - java.sql.Date[].class, - Double[].class, - File[].class, - Float[].class, - Integer[].class, - Long[].class, - Object[].class, - Short[].class, - String[].class, - Time[].class, - Timestamp[].class, - URL[].class, - Date.class, - File.class, - URL.class, - DozerThreadContextClassLoader.class, - ExpressionFactoryImpl.class)); - - reflectiveClass.produce(new ReflectiveClassBuildItem( - true, - false, - DozerBeanMapperConfiguration.class)); - - if (camelDozerConfig.mappingFiles.isPresent()) { - // Register for reflection any classes participating in Dozer mapping - Mapper mapper = DozerBeanMapperBuilder.create() - .withClassLoader(Thread.currentThread().getContextClassLoader()) - .withMappingFiles(camelDozerConfig.mappingFiles.get()) - .build(); - - mapper.getMappingMetadata() - .getClassMappings() - .stream() - .map(metadata -> new ReflectiveClassBuildItem(true, false, metadata.getSourceClassName(), - metadata.getDestinationClassName())) - .forEach(reflectiveClass::produce); - } - } - - @Record(ExecutionTime.STATIC_INIT) - @BuildStep - CamelBeanBuildItem configureCamelDozerBeanMappings(CamelDozerConfig camelDozerConfig, - CamelDozerRecorder camelDozerRecorder) { - - CamelBeanBuildItem camelBeanBuildItem = null; - - if (camelDozerConfig.mappingFiles.isPresent()) { - // Bind DozerBeanMapperConfiguration to the Camel registry for the user provided Dozer mapping files - camelBeanBuildItem = new CamelBeanBuildItem( - "dozerBeanMappingConfiguration", - DozerBeanMapperConfiguration.class.getName(), - camelDozerRecorder.createDozerBeanMapperConfiguration(camelDozerConfig.mappingFiles.get())); - } - - return camelBeanBuildItem; - } - - @Record(ExecutionTime.STATIC_INIT) - @BuildStep - void configureDozerTypeConverterRegistry(CamelContextBuildItem camelContextBuildItem, CamelDozerConfig camelDozerConfig, - CamelDozerRecorder camelDozerRecorder) { - - if (camelDozerConfig.typeConverterEnabled) { - camelDozerRecorder.initializeDozerTypeConverter(camelContextBuildItem.getCamelContext()); - } - } - - private URI mappingPathToURI(String mappingPath) { - try { - return new URI(mappingPath); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } - } -} diff --git a/extensions/dozer/pom.xml b/extensions/dozer/pom.xml deleted file mode 100644 index d6e99c2a96..0000000000 --- a/extensions/dozer/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-extensions</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-dozer-parent</artifactId> - <name>Camel Quarkus :: Dozer</name> - <packaging>pom</packaging> - - <modules> - <module>deployment</module> - <module>runtime</module> - </modules> -</project> diff --git a/extensions/dozer/runtime/pom.xml b/extensions/dozer/runtime/pom.xml deleted file mode 100644 index 21f9c946dc..0000000000 --- a/extensions/dozer/runtime/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-dozer-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-dozer</artifactId> - <name>Camel Quarkus :: Dozer :: Runtime</name> - - <properties> - <camel.quarkus.jvmSince>1.0.0</camel.quarkus.jvmSince> - <camel.quarkus.nativeSince>1.0.0</camel.quarkus.nativeSince> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-dozer</artifactId> - </dependency> - <dependency> - <groupId>org.jboss.logging</groupId> - <artifactId>commons-logging-jboss-logging</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-jaxb</artifactId> - </dependency> - <dependency> - <groupId>org.eclipse.angus</groupId> - <artifactId>angus-activation</artifactId> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>jakarta.el</artifactId> - </dependency> - <dependency> - <groupId>org.graalvm.nativeimage</groupId> - <artifactId>svm</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-maven-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths> - <path> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-processor</artifactId> - <version>${quarkus.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>full</id> - <activation> - <property> - <name>!quickly</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-maven-plugin</artifactId> - <executions> - <execution> - <id>update-extension-doc-page</id> - <goals> - <goal>update-extension-doc-page</goal> - </goals> - <phase>process-classes</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project> diff --git a/extensions/dozer/runtime/src/main/doc/configuration.adoc b/extensions/dozer/runtime/src/main/doc/configuration.adoc deleted file mode 100644 index 95a69806e2..0000000000 --- a/extensions/dozer/runtime/src/main/doc/configuration.adoc +++ /dev/null @@ -1,23 +0,0 @@ -The Dozer extension can automatically register a `DozerBeanMapperConfiguration` bean with the Camel registry which references your mapping files. - -Use the following configuration property to specify the location(s) of your Dozer mapping configuration files. - -[source,properties] ----- -quarkus.camel.dozer.mapping-files = dozerMappings.xml,file:foo/bar/custom-mappings.xml,http://foo/bar/mapping.xml ----- - -The Dozer extension provides a type converter which can leverage your mapping configuration(s) to convert and map a message body -from one type to another. For example. - -[source,java] ----- -from("direct:oldCustomerTypeIn").convertBodyTo(NewCustomerType.class); ----- - -It is disabled by default but can be enabled with the following configuration property. - -[source,properties] ----- -quarkus.camel.dozer.type-converter-enabled = true ----- diff --git a/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/CamelDozerConfig.java b/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/CamelDozerConfig.java deleted file mode 100644 index 174a29d9b4..0000000000 --- a/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/CamelDozerConfig.java +++ /dev/null @@ -1,41 +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.quarkus.component.dozer; - -import java.util.List; -import java.util.Optional; - -import io.quarkus.runtime.annotations.ConfigItem; -import io.quarkus.runtime.annotations.ConfigPhase; -import io.quarkus.runtime.annotations.ConfigRoot; - -@ConfigRoot(name = "camel.dozer", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED) -public class CamelDozerConfig { - - /** - * A comma separated list of Dozer XML mapping configuration file URIs. - */ - @ConfigItem - public Optional<List<String>> mappingFiles; - - /** - * Sets whether to configure the DozerTypeConverter for the CamelContext - */ - @ConfigItem(defaultValue = "false") - @Deprecated(forRemoval = true, since = "2.11.0") - public boolean typeConverterEnabled; -} diff --git a/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/CamelDozerRecorder.java b/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/CamelDozerRecorder.java deleted file mode 100644 index e7e0fa4252..0000000000 --- a/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/CamelDozerRecorder.java +++ /dev/null @@ -1,40 +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.quarkus.component.dozer; - -import java.util.List; - -import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.CamelContext; -import org.apache.camel.converter.dozer.DozerBeanMapperConfiguration; -import org.apache.camel.converter.dozer.DozerTypeConverterLoader; - -@Recorder -public class CamelDozerRecorder { - - public RuntimeValue<DozerBeanMapperConfiguration> createDozerBeanMapperConfiguration(List<String> mappingFiles) { - DozerBeanMapperConfiguration dozerBeanMapperConfiguration = new DozerBeanMapperConfiguration(); - dozerBeanMapperConfiguration.setMappingFiles(mappingFiles); - return new RuntimeValue<>(dozerBeanMapperConfiguration); - } - - public void initializeDozerTypeConverter(RuntimeValue<CamelContext> camelContextRuntimeValue) { - DozerTypeConverterLoader loader = new DozerTypeConverterLoader(); - loader.setCamelContext(camelContextRuntimeValue.getValue()); - } -} diff --git a/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/graal/DozerOSGiSubstitutions.java b/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/graal/DozerOSGiSubstitutions.java deleted file mode 100644 index 4e88f3b20f..0000000000 --- a/extensions/dozer/runtime/src/main/java/org/apache/camel/quarkus/component/dozer/graal/DozerOSGiSubstitutions.java +++ /dev/null @@ -1,113 +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.quarkus.component.dozer.graal; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver; -import com.github.dozermapper.core.config.BeanContainer; -import com.github.dozermapper.core.util.DefaultClassLoader; -import com.github.dozermapper.core.util.DozerClassLoader; -import com.github.dozermapper.core.util.RuntimeUtils; -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; - -final class DozerOSGiSubstitutions { - -} - -@TargetClass(RuntimeUtils.class) -final class SubstituteRuntimeUtils { - - @Substitute - public static boolean isOSGi() { - return false; - } -} - -@TargetClass(DozerBeanMapperBuilder.class) -final class SubstituteDozerBeanMapperBuilder { - - @Alias - private DozerClassLoader fluentDefinedClassLoader; - - @Substitute - private DozerClassLoader getClassLoader() { - // Substituted method impl without unwanted references to OSGiClassLoader - if (fluentDefinedClassLoader == null) { - return new DefaultClassLoader(DozerBeanMapperBuilder.class.getClassLoader()); - } else { - return fluentDefinedClassLoader; - } - } -} - -@TargetClass(SchemaLSResourceResolver.class) -final class SubstituteSchemaLSResourceResolver { - - @Alias - private BeanContainer beanContainer; - - @Substitute - private InputStream resolveFromClassPath(String systemId) throws IOException, URISyntaxException { - // Substituted method impl without unwanted references to OSGi Bundle & Activator - - InputStream source; - - String xsdPath; - URI uri = new URI(systemId); - if (uri.getScheme().equalsIgnoreCase("file")) { - xsdPath = uri.toString(); - } else { - xsdPath = uri.getPath(); - if (xsdPath.charAt(0) == '/') { - xsdPath = xsdPath.substring(1); - } - } - - ClassLoader localClassLoader = getClass().getClassLoader(); - - //Attempt to find within this JAR - URL url = localClassLoader.getResource(xsdPath); - if (url == null) { - //Attempt to find via user defined class loader - DozerClassLoader dozerClassLoader = beanContainer.getClassLoader(); - - url = dozerClassLoader.loadResource(xsdPath); - } - - if (url == null) { - throw new IOException( - "Could not resolve bean-mapping XML Schema [" + systemId + "]: not found in classpath; " + xsdPath); - } - - try { - source = url.openStream(); - } catch (IOException ex) { - throw new IOException( - "Could not resolve bean-mapping XML Schema [" + systemId + "]: not found in classpath; " + xsdPath, ex); - } - - return source; - } -} diff --git a/extensions/dozer/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/dozer/runtime/src/main/resources/META-INF/quarkus-extension.yaml deleted file mode 100644 index e88faf4f04..0000000000 --- a/extensions/dozer/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ /dev/null @@ -1,32 +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. -# - -# This is a generated file. Do not edit directly! -# To re-generate, run the following command from the top level directory: -# -# mvn -N cq:update-quarkus-metadata -# ---- -name: "Camel Dozer" -description: "Map between Java beans using the Dozer mapping library" -metadata: - guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/dozer.html" - categories: - - "integration" - status: - - "stable" - - "deprecated" \ No newline at end of file diff --git a/extensions/pom.xml b/extensions/pom.xml index 1e963e7a37..c062d82b6a 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -94,7 +94,6 @@ <module>digitalocean</module> <module>direct</module> <module>disruptor</module> - <!--<module>dozer</module> https://github.com/apache/camel-quarkus/issues/4477 --> <module>dropbox</module> <!--<module>elasticsearch-rest</module> https://github.com/apache/camel-quarkus/issues/4477 --> <module>exec</module> diff --git a/integration-tests/dozer/pom.xml b/integration-tests/dozer/pom.xml deleted file mode 100644 index fc28634a1d..0000000000 --- a/integration-tests/dozer/pom.xml +++ /dev/null @@ -1,132 +0,0 @@ -<?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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-build-parent-it</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../../poms/build-parent-it/pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-integration-test-dozer</artifactId> - <name>Camel Quarkus :: Integration Tests :: Dozer</name> - <description>Integration tests for Camel Quarkus Dozer extension</description> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-dozer</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-direct</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-resteasy</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-resteasy-jsonb</artifactId> - </dependency> - - <!-- test dependencies --> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-junit5</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>io.rest-assured</groupId> - <artifactId>rest-assured</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - - <profiles> - <profile> - <id>native</id> - <activation> - <property> - <name>native</name> - </property> - </activation> - <properties> - <quarkus.package.type>native</quarkus.package.type> - </properties> - <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> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>virtualDependencies</id> - <activation> - <property> - <name>!noVirtualDependencies</name> - </property> - </activation> - <dependencies> - <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory --> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-direct-deployment</artifactId> - <version>${project.version}</version> - <type>pom</type> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>*</groupId> - <artifactId>*</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-dozer-deployment</artifactId> - <version>${project.version}</version> - <type>pom</type> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>*</groupId> - <artifactId>*</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - </profile> - </profiles> - -</project> diff --git a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/DozerResource.java b/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/DozerResource.java deleted file mode 100644 index 4d08729512..0000000000 --- a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/DozerResource.java +++ /dev/null @@ -1,79 +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.quarkus.component.dozer.it; - -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.Map; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -import org.apache.camel.ProducerTemplate; -import org.apache.camel.quarkus.component.dozer.it.model.CustomerA; -import org.apache.camel.quarkus.component.dozer.it.model.CustomerB; - -@Path("/dozer") -@ApplicationScoped -public class DozerResource { - - @Inject - ProducerTemplate producerTemplate; - - @Path("/map") - @GET - @Produces(MediaType.APPLICATION_JSON) - public CustomerB dozerMap() { - CustomerB cb = producerTemplate.requestBody("direct:mapWithEndpoint", createCustomerA(), CustomerB.class); - cb.setInternalsAsString(); - return cb; - } - - @Path("/map/using/converter") - @GET - @Produces(MediaType.APPLICATION_JSON) - public CustomerB dozerMapWithConverter() { - return producerTemplate.requestBody("direct:mapWithConverter", createCustomerA(), CustomerB.class); - } - - @Path("/map/using/variable") - @GET - @Produces(MediaType.APPLICATION_JSON) - public CustomerB dozerMapWithVariable() { - return producerTemplate.requestBody("direct:mapWithVariable", createCustomerA(), CustomerB.class); - } - - @Path("/map/using/expression") - @GET - @Produces(MediaType.APPLICATION_JSON) - public CustomerB dozerMapWithExpression() { - Map<String, Object> headers = new HashMap<>(); - headers.put("firstName", "Camel"); - headers.put("lastName", "Quarkus"); - return producerTemplate.requestBodyAndHeaders("direct:mapWithExpression", createCustomerA(), headers, CustomerB.class); - } - - private CustomerA createCustomerA() { - return new CustomerA("Peter", "Post", "Camel Street", "12345", - new GregorianCalendar(1990, Calendar.DECEMBER, 15).getTime()); - } -} diff --git a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/DozerRoutes.java b/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/DozerRoutes.java deleted file mode 100644 index 28bd1ac583..0000000000 --- a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/DozerRoutes.java +++ /dev/null @@ -1,37 +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.quarkus.component.dozer.it; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.quarkus.component.dozer.it.model.CustomerB; - -public class DozerRoutes extends RouteBuilder { - - @Override - public void configure() throws Exception { - from("direct:mapWithConverter").convertBodyTo(CustomerB.class); - - from("direct:mapWithEndpoint") - .to("dozer:simpleMapping?mappingFile=simple-mapping.xml&targetModel=org.apache.camel.quarkus.component.dozer.it.model.CustomerB"); - - from("direct:mapWithVariable") - .to("dozer:variableMapping?mappingFile=variable-mapping.xml&targetModel=org.apache.camel.quarkus.component.dozer.it.model.CustomerB"); - - from("direct:mapWithExpression") - .to("dozer:expressionMapping?mappingFile=expression-mapping.xml&targetModel=org.apache.camel.quarkus.component.dozer.it.model.CustomerB"); - } -} diff --git a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/model/CustomerA.java b/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/model/CustomerA.java deleted file mode 100644 index 664e3d16c4..0000000000 --- a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/model/CustomerA.java +++ /dev/null @@ -1,115 +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.quarkus.component.dozer.it.model; - -import java.util.Date; - -public class CustomerA { - - private String firstName; - private String lastName; - private String street; - private String zip; - private Date joined; - private String internalUrl = "http://customer"; - private String internalFile = "/test"; - private String internalClass = "java.lang.String"; - private String internal = "internal"; - - public CustomerA() { - } - - public CustomerA(String firstName, String lastName, String street, String zip, Date joined) { - this.firstName = firstName; - this.lastName = lastName; - this.street = street; - this.zip = zip; - this.joined = joined; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; - } - - public Date getJoined() { - return joined; - } - - public void setJoined(Date joined) { - this.joined = joined; - } - - public String getInternalUrl() { - return internalUrl; - } - - public void setInternalUrl(String internalUrl) { - this.internalUrl = internalUrl; - } - - public String getInternalFile() { - return internalFile; - } - - public void setInternalFile(String internalFile) { - this.internalFile = internalFile; - } - - public String getInternalClass() { - return internalClass; - } - - public void setInternalClass(String internalClass) { - this.internalClass = internalClass; - } - - public String getInternal() { - return internal; - } - - public void setInternal(String internal) { - this.internal = internal; - } -} diff --git a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/model/CustomerB.java b/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/model/CustomerB.java deleted file mode 100644 index 89dd1bb7e4..0000000000 --- a/integration-tests/dozer/src/main/java/org/apache/camel/quarkus/component/dozer/it/model/CustomerB.java +++ /dev/null @@ -1,166 +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.quarkus.component.dozer.it.model; - -import java.io.File; -import java.net.URL; -import java.util.Date; - -public class CustomerB { - - private String firstName; - private String lastName; - private Address address; - private Date created; - private URL internalUrl; - private File internalFile; - private String internalFileAsString; - private Class internalClass; - private String internalClassAsString; - private Custom internal; - - public CustomerB() { - } - - public CustomerB(String firstName, String lastName, Address address) { - this.firstName = firstName; - this.lastName = lastName; - this.address = address; - } - - public void setInternalsAsString() { - if (internalClass != null) { - internalClassAsString = internalClass.getCanonicalName(); - } - if (internalFile != null) { - internalFileAsString = internalFile.toString(); - } - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public Address getAddress() { - return address; - } - - public void setAddress(Address address) { - this.address = address; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - public URL getInternalUrl() { - return internalUrl; - } - - public void setInternalUrl(URL internalUrl) { - this.internalUrl = internalUrl; - } - - public void setInternalFile(File internalFile) { - this.internalFile = internalFile; - } - - public void setInternalClass(Class internalClass) { - this.internalClass = internalClass; - } - - public String getInternalFileAsString() { - return internalFileAsString; - } - - public String getInternalClassAsString() { - return internalClassAsString; - } - - public Custom getInternal() { - return internal; - } - - public void setInternal(Custom internal) { - this.internal = internal; - } - - public static class Address { - - private String street; - private String zip; - - public Address() { - } - - public Address(String street, String zip) { - this.street = street; - this.zip = zip; - } - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; - } - } - - public static class Custom { - - private String text; - - public Custom(String text) { - this.text = "hello " + text; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - } - -} diff --git a/integration-tests/dozer/src/main/resources/application.properties b/integration-tests/dozer/src/main/resources/application.properties deleted file mode 100644 index 9540e06b4b..0000000000 --- a/integration-tests/dozer/src/main/resources/application.properties +++ /dev/null @@ -1,24 +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. -## --------------------------------------------------------------------------- - -#quarkus.log.category."org.apache.camel.quarkus.core.FastFactoryFinderResolver".level = TRACE - -# -# Quarkus - Camel Dozer -# -quarkus.camel.dozer.mapping-files=simple-mapping.xml,variable-mapping.xml,expression-mapping.xml -quarkus.camel.dozer.type-converter-enabled=true diff --git a/integration-tests/dozer/src/main/resources/expression-mapping.xml b/integration-tests/dozer/src/main/resources/expression-mapping.xml deleted file mode 100644 index 3651e13126..0000000000 --- a/integration-tests/dozer/src/main/resources/expression-mapping.xml +++ /dev/null @@ -1,35 +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. - ---> -<mappings xmlns="http://dozermapper.github.io/schema/bean-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://dozermapper.github.io/schema/bean-mapping http://dozermapper.github.io/schema/bean-mapping.xsd"> - - <mapping> - <class-a>org.apache.camel.component.dozer.ExpressionMapper</class-a> - <class-b>org.apache.camel.quarkus.component.dozer.it.model.CustomerB</class-b> - <field custom-converter-id="_expressionMapping" custom-converter-param="simple:\${header.firstName}"> - <a>expression</a> - <b>firstName</b> - </field> - <field custom-converter-id="_expressionMapping" custom-converter-param="simple:\${header.lastName}"> - <a>expression</a> - <b>lastName</b> - </field> - </mapping> - -</mappings> diff --git a/integration-tests/dozer/src/main/resources/simple-mapping.xml b/integration-tests/dozer/src/main/resources/simple-mapping.xml deleted file mode 100644 index d64ecf8898..0000000000 --- a/integration-tests/dozer/src/main/resources/simple-mapping.xml +++ /dev/null @@ -1,40 +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. - ---> -<mappings xmlns="http://dozermapper.github.io/schema/bean-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://dozermapper.github.io/schema/bean-mapping http://dozermapper.github.io/schema/bean-mapping.xsd"> - - <mapping> - <class-a>org.apache.camel.quarkus.component.dozer.it.model.CustomerA</class-a> - <class-b>org.apache.camel.quarkus.component.dozer.it.model.CustomerB</class-b> - <field> - <a>street</a> - <b>address.street</b> - </field> - <field> - <a>zip</a> - <b>address.zip</b> - </field> - <field> - <a>joined</a> - <b>created</b> - </field> - - </mapping> - -</mappings> diff --git a/integration-tests/dozer/src/main/resources/variable-mapping.xml b/integration-tests/dozer/src/main/resources/variable-mapping.xml deleted file mode 100644 index dd363a63a4..0000000000 --- a/integration-tests/dozer/src/main/resources/variable-mapping.xml +++ /dev/null @@ -1,42 +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. - ---> -<mappings xmlns="http://dozermapper.github.io/schema/bean-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://dozermapper.github.io/schema/bean-mapping http://dozermapper.github.io/schema/bean-mapping.xsd"> - - <configuration> - <variables> - <variable name="FIRST_NAME">Camel</variable> - <variable name="LAST_NAME">Quarkus</variable> - </variables> - </configuration> - - <mapping> - <class-a>org.apache.camel.component.dozer.VariableMapper</class-a> - <class-b>org.apache.camel.quarkus.component.dozer.it.model.CustomerB</class-b> - <field custom-converter-id="_variableMapping" custom-converter-param="${FIRST_NAME}"> - <a>literal</a> - <b>firstName</b> - </field> - <field custom-converter-id="_variableMapping" custom-converter-param="${LAST_NAME}"> - <a>literal</a> - <b>lastName</b> - </field> - </mapping> - -</mappings> diff --git a/integration-tests/dozer/src/test/java/org/apache/camel/quarkus/component/dozer/it/DozerIT.java b/integration-tests/dozer/src/test/java/org/apache/camel/quarkus/component/dozer/it/DozerIT.java deleted file mode 100644 index b638f3851d..0000000000 --- a/integration-tests/dozer/src/test/java/org/apache/camel/quarkus/component/dozer/it/DozerIT.java +++ /dev/null @@ -1,24 +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.quarkus.component.dozer.it; - -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@QuarkusIntegrationTest -class DozerIT extends DozerTest { - -} diff --git a/integration-tests/dozer/src/test/java/org/apache/camel/quarkus/component/dozer/it/DozerTest.java b/integration-tests/dozer/src/test/java/org/apache/camel/quarkus/component/dozer/it/DozerTest.java deleted file mode 100644 index 94512a4c11..0000000000 --- a/integration-tests/dozer/src/test/java/org/apache/camel/quarkus/component/dozer/it/DozerTest.java +++ /dev/null @@ -1,74 +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.quarkus.component.dozer.it; - -import java.io.File; - -import io.quarkus.test.junit.QuarkusTest; -import io.restassured.RestAssured; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -@QuarkusTest -class DozerTest { - - @Test - public void testDozerTypeConverter() { - RestAssured.get("/dozer/map/using/converter") - .then() - .statusCode(200) - .body("address", notNullValue(), - "address.zip", is("12345"), - "address.street", is("Camel Street")); - } - - @Test - public void testDozerEndpoint() { - RestAssured.get("/dozer/map") - .then() - .statusCode(200) - .body("address", notNullValue(), - "address.zip", is("12345"), - "address.street", is("Camel Street"), - "created", containsString("1990"), - "internalFileAsString", is(File.separator + "test"), - "internalClassAsString", is("java.lang.String"), - "internalUrl", is("http://customer"), - "internal.text", is("hello internal")); - } - - @Test - public void testDozerVariableMapper() { - RestAssured.get("/dozer/map/using/variable") - .then() - .statusCode(200) - .body("firstName", is("Camel"), - "lastName", is("Quarkus")); - } - - @Test - public void testDozerExpressionMapper() { - RestAssured.get("/dozer/map/using/expression") - .then() - .statusCode(200) - .body("firstName", is("Camel"), - "lastName", is("Quarkus")); - } -} diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 3c642e87ff..e0533275ca 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -86,7 +86,6 @@ <module>debezium</module> <module>digitalocean</module> <module>disruptor</module> - <!--<module>dozer</module>--> <module>dropbox</module> <!--<module>elasticsearch-rest</module>--> <module>exec</module>
