diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fa680a8a..e938f2971 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,12 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4 + - uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4 with: distribution: "temurin" java-version: 11 - - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 + - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven @@ -38,20 +38,20 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4 + - uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4 with: distribution: "temurin" java-version: 11 - name: Initialize CodeQL - uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3 + uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6 with: languages: java - name: Autobuild - uses: github/codeql-action/autobuild@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3 + uses: github/codeql-action/autobuild@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3 + uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6 with: category: "/language:java" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7878bdd0a..1428f8e90 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4 + - uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4 with: distribution: "temurin" java-version: 11 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f08db5a12..dedd3bf80 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3 + uses: github/codeql-action/upload-sarif@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6 with: sarif_file: results.sarif diff --git a/bom-dependencies/pom.xml b/bom-dependencies/pom.xml index 69ea45206..605fca488 100644 --- a/bom-dependencies/pom.xml +++ b/bom-dependencies/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-parent - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../ @@ -50,9 +50,7 @@ 1.19 5.1.0 4.6.1 - 1.2 - 4.13.1 - 1.18.24 + 1.18.30 3.3.0 3.2 6.0.0 @@ -179,51 +177,11 @@ mockito-core ${mockito-core.version} - - org.apache.aries.spifly - org.apache.aries.spifly.dynamic.bundle - ${aries.spifly.verison} - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.spring-core - ${spring.version}_1 - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.spring-context - ${spring.version}_1 - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.spring-beans - ${spring.version}_1 - org.osgi org.osgi.core ${osgi.version} - - org.ops4j.pax.exam - pax-exam-container-karaf - ${pax-exam.version} - - - org.ops4j.pax.exam - pax-exam-junit4 - ${pax-exam.version} - - - org.ops4j.pax.exam - pax-exam-link-assembly - ${pax-exam.version} - - - org.ops4j.pax.exam - pax-exam-link-mvn - ${pax-exam.version} - org.projectlombok lombok diff --git a/building-tools/pom.xml b/building-tools/pom.xml index 54fedd8db..56bb3fe9d 100644 --- a/building-tools/pom.xml +++ b/building-tools/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-parent - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT dozer-building-tools jar diff --git a/core/pom.xml b/core/pom.xml index 9f3d191e4..183e0ed96 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-plugins-parent - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../plugins-parent @@ -33,22 +33,6 @@ Dozer :: Core - com.github.dozermapper.core.osgi.Activator - - com.github.dozermapper.core.* - - - osgi.serviceloader; - filter:="(osgi.serviceloader=com.github.dozermapper.core.DozerModule)";cardinality:=multiple;resolution:=optional, - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)";resolution:=optional - - * - true @@ -87,6 +71,7 @@ lombok provided + jakarta.xml.bind @@ -101,6 +86,7 @@ org.glassfish.jaxb jaxb-xjc + org.glassfish @@ -108,6 +94,7 @@ provided true + com.fasterxml.jackson.dataformat diff --git a/core/src/main/java/com/github/dozermapper/core/util/DozerConstants.java b/core/src/main/java/com/github/dozermapper/core/util/DozerConstants.java index 72bbf6cfa..144be4531 100644 --- a/core/src/main/java/com/github/dozermapper/core/util/DozerConstants.java +++ b/core/src/main/java/com/github/dozermapper/core/util/DozerConstants.java @@ -28,7 +28,7 @@ public final class DozerConstants { private DozerConstants() { } - public static final String CURRENT_VERSION = "6.5.2"; + public static final String CURRENT_VERSION = "7.0.0"; public static final boolean DEFAULT_WILDCARD_POLICY = true; public static final boolean DEFAULT_WILDCARD_CASE_INSENSITIVE_POLICY = false; diff --git a/docs/asciidoc/migration/v6-to-v7.adoc b/docs/asciidoc/migration/v6-to-v7.adoc new file mode 100644 index 000000000..1727ef52b --- /dev/null +++ b/docs/asciidoc/migration/v6-to-v7.adoc @@ -0,0 +1,7 @@ +== Migration from v6.5.0 to v7 + +See link:https://github.com/DozerMapper/dozer/releases/tag/7.0.0[for release notes]. + +=== 1. OSGI support dropped +=== 2. Java 8 support dropped +=== 2. Proto support dropped diff --git a/docs/asciidoc/migration/v66-to-v66.adoc b/docs/asciidoc/migration/v66-to-v66.adoc deleted file mode 100644 index ca10ced33..000000000 --- a/docs/asciidoc/migration/v66-to-v66.adoc +++ /dev/null @@ -1,6 +0,0 @@ -== Migration from v6.5.0 to v6.6.0 -*WORK IN PROGRESS* - -See link:https://github.com/DozerMapper/dozer/releases/tag/6.6.0[for release notes]. - -=== 1. ... diff --git a/dozer-integrations/dozer-proto3/pom.xml b/dozer-integrations/dozer-proto3/pom.xml deleted file mode 100755 index ee4e2376a..000000000 --- a/dozer-integrations/dozer-proto3/pom.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - 4.0.0 - - com.github.dozermapper - dozer-integrations - 6.5.3-SNAPSHOT - - - dozer-proto3 - jar - Dozer :: Integrations :: Protobuf 3 - - - - com.github.dozermapper.protobuf.* - osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" - osgi.serviceloader; osgi.serviceloader=com.github.dozermapper.core.DozerModule - com.github.dozermapper.protobuf.ProtobufSupportModule - - - - - com.github.dozermapper - dozer-core - ${project.version} - - - com.google.protobuf - protobuf-java - - - com.google.guava - guava - - - - - org.osgi - org.osgi.core - provided - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - generate-test-sources - - add-test-source - - - - ${project.build.directory}/generated-test-sources - - - - - - - com.github.os72 - protoc-jar-maven-plugin - - - generate-test-sources - - run - - - ${protoc.version} - - src/test/proto - - ${project.build.directory}/generated-test-sources - - - - - - - - diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/ProtobufSupportModule.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/ProtobufSupportModule.java deleted file mode 100644 index b30680070..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/ProtobufSupportModule.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf; - -import java.util.Collection; -import java.util.Collections; - -import com.github.dozermapper.core.DozerModule; -import com.github.dozermapper.core.builder.BeanBuilderCreationStrategy; -import com.github.dozermapper.core.classmap.generator.BeanFieldsDetector; -import com.github.dozermapper.core.config.BeanContainer; -import com.github.dozermapper.core.factory.DestBeanCreator; -import com.github.dozermapper.core.propertydescriptor.PropertyDescriptorCreationStrategy; -import com.github.dozermapper.core.propertydescriptor.PropertyDescriptorFactory; -import com.github.dozermapper.protobuf.builder.ByProtobufBuilder; -import com.github.dozermapper.protobuf.classmap.generator.ProtobufBeanFieldsDetector; -import com.github.dozermapper.protobuf.propertydescriptor.ProtoFieldPropertyDescriptorCreationStrategy; - -/** - * {@link DozerModule} which adds support for Protobuf. - * This is the main integration point into Dozer and is loaded via an SPI mechanism. - */ -public class ProtobufSupportModule implements DozerModule { - - private BeanContainer beanContainer; - private DestBeanCreator destBeanCreator; - private PropertyDescriptorFactory propertyDescriptorFactory; - - /** - * {@inheritDoc} - * - * @deprecated DozerModule needs rethink, as exposes internals - */ - @Deprecated - @Override - public void init(BeanContainer beanContainer, DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory) { - this.beanContainer = beanContainer; - this.destBeanCreator = destBeanCreator; - this.propertyDescriptorFactory = propertyDescriptorFactory; - } - - /** - * No-op - */ - @Override - public void init() { - - } - - /** - * {@inheritDoc} - */ - @Override - public Collection getBeanBuilderCreationStrategies() { - return Collections.singleton(new ByProtobufBuilder()); - } - - /** - * {@inheritDoc} - */ - @Override - public Collection getBeanFieldsDetectors() { - return Collections.singleton(new ProtobufBeanFieldsDetector()); - } - - /** - * {@inheritDoc} - */ - @Override - public Collection getPropertyDescriptorCreationStrategies() { - return Collections.singleton(new ProtoFieldPropertyDescriptorCreationStrategy(beanContainer, destBeanCreator, propertyDescriptorFactory)); - } -} diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/ByProtobufBuilder.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/ByProtobufBuilder.java deleted file mode 100644 index 25cf695e5..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/ByProtobufBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.builder; - -import com.github.dozermapper.core.BeanBuilder; -import com.github.dozermapper.core.builder.BeanBuilderCreationStrategy; -import com.github.dozermapper.core.factory.BeanCreationDirective; -import com.github.dozermapper.protobuf.util.ProtoUtils; -import com.google.protobuf.Message; - -/** - * {@link BeanBuilderCreationStrategy} that is applicable to {@link Message} - */ -public class ByProtobufBuilder implements BeanBuilderCreationStrategy { - - /** - * {@inheritDoc} - */ - @Override - public boolean isApplicable(BeanCreationDirective directive) { - return Message.class.isAssignableFrom(directive.getActualClass()); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - @Override - public BeanBuilder create(BeanCreationDirective directive) { - Class messageClass = (Class)directive.getActualClass(); - final Message.Builder protoBuilder = ProtoUtils.getBuilder(messageClass); - - return new ProtoBeanBuilder(protoBuilder, messageClass); - } -} diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/ProtoBeanBuilder.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/ProtoBeanBuilder.java deleted file mode 100644 index ab193c67e..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/ProtoBeanBuilder.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.builder; - -import com.github.dozermapper.core.BeanBuilder; -import com.google.protobuf.Message; - -/** - * {@link BeanBuilder} that instantiates {@link Message} - */ -public class ProtoBeanBuilder implements BeanBuilder { - - protected Message.Builder internalProtoBuilder; - protected Class beanClass; - - /** - * {@link BeanBuilder} which is used to create instances of {@link Message} via {@link Message.Builder} - * - * @param internalProtoBuilder builder for {@link Message} - * @param beanClass type of {@link Message} to create - */ - public ProtoBeanBuilder(Message.Builder internalProtoBuilder, Class beanClass) { - this.internalProtoBuilder = internalProtoBuilder; - this.beanClass = beanClass; - } - - /** - * {@inheritDoc} - */ - @Override - public Class beanClass() { - return beanClass; - } - - /** - * Get the {@link Message.Builder} - * - * @return instance of {@link Message.Builder} - */ - public Message.Builder internalProtoBuilder() { - return internalProtoBuilder; - } - - /** - * {@inheritDoc} - */ - @Override - public Object build() { - return internalProtoBuilder.build(); - } -} diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/package-info.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/package-info.java deleted file mode 100644 index fa6c1ed75..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/builder/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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. - */ -/** - * BeanBuilder extensions for Protbuf - */ -package com.github.dozermapper.protobuf.builder; diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/classmap/generator/ProtobufBeanFieldsDetector.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/classmap/generator/ProtobufBeanFieldsDetector.java deleted file mode 100644 index bcb69b406..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/classmap/generator/ProtobufBeanFieldsDetector.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.classmap.generator; - -import java.util.HashSet; -import java.util.Set; - -import com.github.dozermapper.core.classmap.generator.BeanFieldsDetector; -import com.github.dozermapper.protobuf.util.ProtoUtils; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Message; - -/** - * {@link BeanFieldsDetector} that accepts {@link Message} - */ -public class ProtobufBeanFieldsDetector implements BeanFieldsDetector { - - /** - * {@inheritDoc} - */ - @Override - public boolean accepts(Class clazz) { - return Message.class.isAssignableFrom(clazz); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - @Override - public Set getReadableFieldNames(Class clazz) { - return getFieldNames((Class)clazz); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - @Override - public Set getWritableFieldNames(Class clazz) { - return getFieldNames((Class)clazz); - } - - private static Set getFieldNames(Class clazz) { - Set resultSet = new HashSet<>(); - for (Descriptors.FieldDescriptor descriptor : ProtoUtils.getFieldDescriptors(clazz)) { - resultSet.add(ProtoUtils.toCamelCase(descriptor.getName())); - } - - return resultSet; - } -} diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/classmap/generator/package-info.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/classmap/generator/package-info.java deleted file mode 100644 index 7bd84a318..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/classmap/generator/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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. - */ -/** - * {@link com.github.dozermapper.core.classmap.generator.BeanFieldsDetector} extensions for Protbuf - */ -package com.github.dozermapper.protobuf.classmap.generator; diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/package-info.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/package-info.java deleted file mode 100644 index a6b4fbc01..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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. - */ -/** - * Extension classes to integrate Dozer with Protobuf as a first-class-citizen - */ -package com.github.dozermapper.protobuf; diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptor.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptor.java deleted file mode 100644 index 0cc37eb35..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptor.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.propertydescriptor; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Map; - -import com.github.dozermapper.core.BeanBuilder; -import com.github.dozermapper.core.MappingException; -import com.github.dozermapper.core.config.BeanContainer; -import com.github.dozermapper.core.factory.DestBeanCreator; -import com.github.dozermapper.core.fieldmap.FieldMap; -import com.github.dozermapper.core.fieldmap.HintContainer; -import com.github.dozermapper.core.propertydescriptor.AbstractPropertyDescriptor; -import com.github.dozermapper.core.propertydescriptor.PropertyDescriptorFactory; -import com.github.dozermapper.core.util.DeepHierarchyUtils; -import com.github.dozermapper.core.util.MappingUtils; -import com.github.dozermapper.protobuf.builder.ProtoBeanBuilder; -import com.github.dozermapper.protobuf.util.ProtoUtils; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Message; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * {@link com.github.dozermapper.core.propertydescriptor.DozerPropertyDescriptor} which resolves Protobuf fields - */ -class ProtoFieldPropertyDescriptor extends AbstractPropertyDescriptor { - - private static final Logger LOG = LoggerFactory.getLogger(ProtoFieldPropertyDescriptor.class); - - private final BeanContainer beanContainer; - private final DestBeanCreator destBeanCreator; - private final PropertyDescriptorFactory propertyDescriptorFactory; - - private Class propertyType; - private Class genericType; - private Descriptors.FieldDescriptor fieldDescriptor; - - /** - * {@link com.github.dozermapper.core.propertydescriptor.DozerPropertyDescriptor} which resolves Protobuf fields - * - * @param clazz clazz to work on - * @param fieldName field name to resolve - * @param isIndexed whether the mapping is indexed - * @param index current index - * @param srcDeepIndexHintContainer source hint - * @param destDeepIndexHintContainer destination hint - * @param beanContainer {@link BeanContainer} instance - * @param destBeanCreator {@link DestBeanCreator} instance - * @param propertyDescriptorFactory {@link PropertyDescriptorFactory} instance - */ - ProtoFieldPropertyDescriptor(Class clazz, String fieldName, boolean isIndexed, int index, HintContainer srcDeepIndexHintContainer, - HintContainer destDeepIndexHintContainer, BeanContainer beanContainer, DestBeanCreator destBeanCreator, - PropertyDescriptorFactory propertyDescriptorFactory) { - super(clazz, fieldName, isIndexed, index, srcDeepIndexHintContainer, destDeepIndexHintContainer); - - this.beanContainer = beanContainer; - this.destBeanCreator = destBeanCreator; - this.propertyDescriptorFactory = propertyDescriptorFactory; - } - - /** - * {@inheritDoc} - */ - @Override - public Class getPropertyType() { - if (this.propertyType == null) { - - Class result; - if (MappingUtils.isDeepMapping(fieldName)) { - try { - result = DeepHierarchyUtils.getDeepFieldType(clazz, fieldName, srcDeepIndexHintContainer, beanContainer, destBeanCreator, propertyDescriptorFactory); - } catch (Exception ignore) { - LOG.info("Determine field type by srcDeepIndexHintContainer failed"); - - try { - result = DeepHierarchyUtils.getDeepFieldType(clazz, fieldName, destDeepIndexHintContainer, beanContainer, destBeanCreator, propertyDescriptorFactory); - } catch (Exception secondIgnore) { - LOG.info("Determine field type by destDeepIndexHintContainer failed"); - result = null; - } - } - } else { - result = ProtoUtils.getJavaClass(getFieldDescriptor(), beanContainer); - } - - this.propertyType = result; - } - - return this.propertyType; - } - - /** - * {@inheritDoc} - */ - @Override - public Object getPropertyValue(Object bean) { - Object result; - if (MappingUtils.isDeepMapping(fieldName)) { - result = DeepHierarchyUtils.getDeepFieldValue(bean, fieldName, isIndexed, index, srcDeepIndexHintContainer, beanContainer, destBeanCreator, propertyDescriptorFactory); - } else { - result = getSimplePropertyValue(bean); - if (isIndexed) { - result = MappingUtils.getIndexedValue(result, index); - } - } - - return result; - } - - private Object getSimplePropertyValue(Object bean) { - // Proto builder can't contains already created object and even if contain - it's fields can't be changed - if (bean instanceof BeanBuilder) { - return null; - } - - if (!(bean instanceof Message)) { - throw new MappingException("Expected a Message instance, but got " - + bean.getClass().getCanonicalName()); - } - - Object value = ProtoUtils.getFieldValue(bean, fieldName); - - return ProtoUtils.unwrapEnums(value, beanContainer); - } - - /** - * {@inheritDoc} - */ - @Override - public void setPropertyValue(Object bean, Object value, FieldMap fieldMap) { - if (!(bean instanceof ProtoBeanBuilder)) { - throw new MappingException("Expected a ProtoBeanBuilder instance, but got " - + bean.getClass().getCanonicalName()); - } - - ProtoBeanBuilder builder = (ProtoBeanBuilder)bean; - - value = ProtoUtils.wrapEnums(value); - if (value != null) { - if (getFieldDescriptor().isMapField()) { - // Capitalize the first letter of the string; - String propertyName = Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); - String methodName = String.format("putAll%s", propertyName); - - try { - Method mapSetterMethod = builder.internalProtoBuilder().getClass().getMethod(methodName, Map.class); - mapSetterMethod.invoke(builder.internalProtoBuilder(), value); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { - throw new MappingException("Could not call map setter method " + methodName, ex); - } - } else { - builder.internalProtoBuilder().setField(getFieldDescriptor(), value); - } - } else { - builder.internalProtoBuilder().clearField(getFieldDescriptor()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public Class genericType() { - if (this.genericType == null) { - - Class result; - if (MappingUtils.isDeepMapping(fieldName)) { - try { - result = DeepHierarchyUtils.getDeepGenericType(clazz, fieldName, srcDeepIndexHintContainer, beanContainer, destBeanCreator, propertyDescriptorFactory); - } catch (Exception ignore) { - LOG.info("Determine field generic type by srcDeepIndexHintContainer failed"); - - try { - result = DeepHierarchyUtils.getDeepGenericType(clazz, fieldName, destDeepIndexHintContainer, beanContainer, destBeanCreator, propertyDescriptorFactory); - } catch (Exception secondIgnore) { - LOG.info("Determine field generic type by destDeepIndexHintContainer failed"); - result = null; - } - } - } else { - result = ProtoUtils.getJavaGenericClassForCollection(getFieldDescriptor(), beanContainer); - } - - this.genericType = result; - } - - return this.genericType; - } - - @SuppressWarnings("unchecked") - private Descriptors.FieldDescriptor getFieldDescriptor() { - if (this.fieldDescriptor == null && Message.class.isAssignableFrom(clazz)) { - this.fieldDescriptor = ProtoUtils.getFieldDescriptor((Class)clazz, fieldName); - if (this.fieldDescriptor == null && !MappingUtils.isDeepMapping(fieldName)) { - throw new MappingException("No field descriptor for field with name: " + fieldName); - } - } - - return this.fieldDescriptor; - } -} diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptorCreationStrategy.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptorCreationStrategy.java deleted file mode 100644 index ddf126f75..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptorCreationStrategy.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.propertydescriptor; - -import com.github.dozermapper.core.config.BeanContainer; -import com.github.dozermapper.core.factory.DestBeanCreator; -import com.github.dozermapper.core.fieldmap.HintContainer; -import com.github.dozermapper.core.propertydescriptor.DozerPropertyDescriptor; -import com.github.dozermapper.core.propertydescriptor.PropertyDescriptorCreationStrategy; -import com.github.dozermapper.core.propertydescriptor.PropertyDescriptorFactory; -import com.github.dozermapper.core.util.MappingUtils; -import com.github.dozermapper.protobuf.util.ProtoUtils; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Message; - -/** - * {@link PropertyDescriptorCreationStrategy} which is used to build {@link ProtoFieldPropertyDescriptor} - * via {@link #buildFor(Class, String, boolean, int, HintContainer, HintContainer)}. - */ -public class ProtoFieldPropertyDescriptorCreationStrategy implements PropertyDescriptorCreationStrategy { - - private final BeanContainer beanContainer; - private final DestBeanCreator destBeanCreator; - private final PropertyDescriptorFactory propertyDescriptorFactory; - - /** - * {@link PropertyDescriptorCreationStrategy} which is used to create instances of {@link DozerPropertyDescriptor} - * - * @param beanContainer {@link BeanContainer} instance - * @param destBeanCreator {@link DestBeanCreator} instance - * @param propertyDescriptorFactory {@link PropertyDescriptorFactory} instance - */ - public ProtoFieldPropertyDescriptorCreationStrategy(BeanContainer beanContainer, DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory) { - this.beanContainer = beanContainer; - this.destBeanCreator = destBeanCreator; - this.propertyDescriptorFactory = propertyDescriptorFactory; - } - - /** - * {@inheritDoc} - */ - @Override - public DozerPropertyDescriptor buildFor(Class clazz, String fieldName, boolean isIndexed, int index, HintContainer srcDeepIndexHintContainer, - HintContainer destDeepIndexHintContainer) { - return new ProtoFieldPropertyDescriptor(clazz, fieldName, isIndexed, index, srcDeepIndexHintContainer, destDeepIndexHintContainer, - beanContainer, destBeanCreator, propertyDescriptorFactory); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - @Override - public boolean isApplicable(Class clazz, String fieldName) { - if (!Message.class.isAssignableFrom(clazz)) { - return false; - } - - Class messageClass = (Class)clazz; - Descriptors.FieldDescriptor foundDescriptor = ProtoUtils.getFieldDescriptor(messageClass, fieldName); - - return foundDescriptor != null || MappingUtils.isDeepMapping(fieldName); - } -} diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/package-info.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/package-info.java deleted file mode 100644 index 86d6d4a17..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/propertydescriptor/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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. - */ -/** - * PropertyDescriptor extensions for Protbuf - */ -package com.github.dozermapper.protobuf.propertydescriptor; diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/util/ProtoUtils.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/util/ProtoUtils.java deleted file mode 100644 index 7aa4c0abb..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/util/ProtoUtils.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.util; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import com.github.dozermapper.core.MappingException; -import com.github.dozermapper.core.config.BeanContainer; -import com.github.dozermapper.core.util.MappingUtils; -import com.google.common.base.CaseFormat; -import com.google.protobuf.ByteString; -import com.google.protobuf.DescriptorProtos.FileOptions; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Message; -import com.google.protobuf.ProtocolMessageEnum; - -import org.apache.commons.lang3.StringUtils; - -/** - * Protobuf utility methods - */ -public final class ProtoUtils { - - private ProtoUtils() { - } - - /** - * Gets the {@link Message.Builder} instance associated with the clazz - * - * @param clazz {@link Message} clazz - * @return {@link Message.Builder} instance associated with the clazz - */ - public static Message.Builder getBuilder(Class clazz) { - final Message.Builder protoBuilder; - - try { - Method newBuilderMethod = clazz.getMethod("newBuilder"); - protoBuilder = (Message.Builder)newBuilderMethod.invoke(null); - } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { - throw new MappingException("Failed to create Message.Builder for " + clazz.getCanonicalName(), e); - } - - return protoBuilder; - } - - /** - * Gets a list of {@link Descriptors.FieldDescriptor} associated with the clazz - * - * @param clazz {@link Message} clazz - * @return list of {@link Descriptors.FieldDescriptor} associated with the clazz - */ - public static List getFieldDescriptors(Class clazz) { - Message.Builder protoBuilder = getBuilder(clazz); - - return getFieldDescriptors(protoBuilder); - } - - /** - * Gets a list of {@link Descriptors.FieldDescriptor} associated with the {@link Message.Builder} - * - * @param protoBuilder {@link Message.Builder} instance - * @return list of {@link Descriptors.FieldDescriptor} associated with the {@link Message.Builder} - */ - private static List getFieldDescriptors(Message.Builder protoBuilder) { - return protoBuilder.getDescriptorForType().getFields(); - } - - /** - * Gets a {@link Descriptors.FieldDescriptor} associated with the clazz, which matches the fieldName, - * either with an exact match, or after applying a transformation to camel-case. - *

- * Returns null if there is no match. - * - * @param clazz {@link Message} clazz - * @param fieldName fieldName to find - * @return {@link Descriptors.FieldDescriptor} associated with the clazz and which matches the fieldName - */ - public static Descriptors.FieldDescriptor getFieldDescriptor(Class clazz, String fieldName) { - final List protoFieldDescriptors = getFieldDescriptors(clazz); - - for (Descriptors.FieldDescriptor descriptor : protoFieldDescriptors) { - if (sameField(fieldName, descriptor.getName())) { - return descriptor; - } - } - - return null; - } - - private static boolean sameField(String fieldName, String protoFieldName) { - if (fieldName.equals(protoFieldName)) { - return true; - } - - // Try to compare field name with Protobuf official snake case syntax - return fieldName.equals(toCamelCase(protoFieldName)); - } - - /** - * Gets the field value from the {@link Message}, which matches the fieldName, - * either with an exact match, or after applying a transformation to camel-case. - *

- * Returns null if there is no match. - * - * @param message {@link Message} instance - * @param fieldName fieldName to find - * @return field value from the {@link Message} for the specified field name, or null if none found - */ - public static Object getFieldValue(Object message, String fieldName) { - Object answer = null; - - Map fieldsMap = ((Message)message).getAllFields(); - for (Map.Entry field : fieldsMap.entrySet()) { - if (sameField(fieldName, field.getKey().getName())) { - if (field.getKey().isMapField()) { - // Capitalize the first letter of the string; - String propertyName = Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); - String methodName = String.format("get%sMap", propertyName); - - try { - Method mapGetter = message.getClass().getMethod(methodName); - answer = mapGetter.invoke(message); - break; - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - throw new MappingException("Could not introspect map field with method " + methodName, e); - } - } else { - answer = field.getValue(); - break; - } - } - } - - return answer; - } - - /** - * Gets the class type of the {@link Descriptors.FieldDescriptor} - * - * @param descriptor {@link Descriptors.FieldDescriptor} instance - * @param beanContainer {@link BeanContainer} instance - * @return class type of the {@link Descriptors.FieldDescriptor} - */ - public static Class getJavaClass(final Descriptors.FieldDescriptor descriptor, BeanContainer beanContainer) { - if (descriptor.isMapField()) { - return Map.class; - } - - if (descriptor.isRepeated()) { - return List.class; - } - - return getJavaClassIgnoreRepeated(descriptor, beanContainer); - } - - /** - * Gets the class type of the {@link Descriptors.FieldDescriptor} - * - * @param descriptor {@link Descriptors.FieldDescriptor} instance - * @param beanContainer {@link BeanContainer} instance - * @return class type of the {@link Descriptors.FieldDescriptor} or null, if {@link Descriptors.FieldDescriptor#isRepeated()} - */ - public static Class getJavaGenericClassForCollection(final Descriptors.FieldDescriptor descriptor, BeanContainer beanContainer) { - if (!descriptor.isRepeated()) { - return null; - } - - return getJavaClassIgnoreRepeated(descriptor, beanContainer); - } - - private static Class getJavaClassIgnoreRepeated(final Descriptors.FieldDescriptor descriptor, BeanContainer beanContainer) { - switch (descriptor.getJavaType()) { - case INT: - return Integer.class; - case LONG: - return Long.class; - case FLOAT: - return Float.class; - case DOUBLE: - return Double.class; - case BOOLEAN: - return Boolean.class; - case STRING: - return String.class; - case BYTE_STRING: - return ByteString.class; - //code duplicate, but GenericDescriptor interface is private in protobuf - case ENUM: - return getEnumClassByEnumDescriptor(descriptor.getEnumType(), beanContainer); - case MESSAGE: - return MappingUtils.loadClass(StringUtils.join( - getFullyQualifiedClassName(descriptor.getMessageType().getContainingType(), - descriptor.getMessageType().getFile().getOptions(), - descriptor.getMessageType().getName()), '.'), beanContainer); - default: - throw new MappingException("Unable to find " + descriptor.getJavaType()); - } - } - - private static String[] getFullyQualifiedClassName(Descriptors.Descriptor container, final FileOptions fileOpts, String name) { - - if (fileOpts.getJavaMultipleFiles()) { - LinkedList fqnSegments = new LinkedList<>(); - fqnSegments.push(name); - while (container != null) { - fqnSegments.push(container.getName()); - container = container.getContainingType(); - } - fqnSegments.push(fileOpts.getJavaPackage()); - return fqnSegments.toArray(new String[] {}); - } - - return new String[] {fileOpts.getJavaPackage(), fileOpts.getJavaOuterClassname(), name}; - } - - @SuppressWarnings("unchecked") - private static Class getEnumClassByEnumDescriptor(Descriptors.EnumDescriptor descriptor, BeanContainer beanContainer) { - String name = StringUtils.join(getFullyQualifiedClassName(descriptor.getContainingType(), descriptor.getFile().getOptions(), descriptor.getName()), '.'); - return (Class)MappingUtils.loadClass(name, beanContainer); - } - - /** - * Wrap {@link ProtocolMessageEnum} or a {@link List} to a {@link Descriptors.EnumValueDescriptor} - * If the value is neither {@link ProtocolMessageEnum} or a {@link List}, the value is returned. - * - * @param value {@link ProtocolMessageEnum} or a {@link List} - * @return {@link Descriptors.EnumValueDescriptor} if value is {@link ProtocolMessageEnum}, else a {@link List} of {@link Descriptors.EnumValueDescriptor} - */ - @SuppressWarnings("unchecked") - public static Object wrapEnums(Object value) { - if (value instanceof ProtocolMessageEnum) { - return ((ProtocolMessageEnum)value).getValueDescriptor(); - } - - // There is no other collections using in proto, only list - if (value instanceof List) { - List modifiedList = new ArrayList(((List)value).size()); - for (Object element : (List)value) { - modifiedList.add(wrapEnums(element)); - } - - return modifiedList; - } - - return value; - } - - /** - * Unwrap {@link Descriptors.EnumValueDescriptor} or a {@link Collection} to a raw {@link Enum} - * If the value is neither {@link Descriptors.EnumValueDescriptor} or a {@link Collection}, the value is returned. - * - * @param value {@link Descriptors.EnumValueDescriptor} or a {@link Collection} - * @param beanContainer {@link BeanContainer} instance - * @return {@link Enum} if value is {@link Descriptors.EnumValueDescriptor}, else a {@link Collection} of {@link Enum} - */ - @SuppressWarnings("unchecked") - public static Object unwrapEnums(Object value, BeanContainer beanContainer) { - if (value instanceof Descriptors.EnumValueDescriptor) { - Descriptors.EnumValueDescriptor descriptor = (Descriptors.EnumValueDescriptor)value; - Class enumClass = getEnumClassByEnumDescriptor(descriptor.getType(), beanContainer); - - for (Enum enumValue : enumClass.getEnumConstants()) { - if (((Descriptors.EnumValueDescriptor)value).getName().equals(enumValue.name())) { - return enumValue; - } - } - - return null; - } - - if (value instanceof Collection) { - Collection valueCollection = (Collection)value; - List modifiedList = new ArrayList(valueCollection.size()); - - for (Object element : valueCollection) { - modifiedList.add(unwrapEnums(element, beanContainer)); - } - - return modifiedList; - } - - return value; - } - - /** - * Converts name to CamelCase - * - * @param name name to convert - * @return converted name to CamelCase - */ - public static String toCamelCase(String name) { - return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name); - } -} diff --git a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/util/package-info.java b/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/util/package-info.java deleted file mode 100644 index c53606ce3..000000000 --- a/dozer-integrations/dozer-proto3/src/main/java/com/github/dozermapper/protobuf/util/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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. - */ -/** - * Utility classes which make it easier to work with Protobuf - */ -package com.github.dozermapper.protobuf.util; diff --git a/dozer-integrations/dozer-proto3/src/main/resources/META-INF/LICENSE b/dozer-integrations/dozer-proto3/src/main/resources/META-INF/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/dozer-integrations/dozer-proto3/src/main/resources/META-INF/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. diff --git a/dozer-integrations/dozer-proto3/src/main/resources/META-INF/services/com.github.dozermapper.core.DozerModule b/dozer-integrations/dozer-proto3/src/main/resources/META-INF/services/com.github.dozermapper.core.DozerModule deleted file mode 100644 index eb31d69cc..000000000 --- a/dozer-integrations/dozer-proto3/src/main/resources/META-INF/services/com.github.dozermapper.core.DozerModule +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2005-2018 Dozer Project -# -# Licensed 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. -# - -com.github.dozermapper.protobuf.ProtobufSupportModule diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansDeepMappingTest.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansDeepMappingTest.java deleted file mode 100644 index ca550a3cc..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansDeepMappingTest.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.functional_tests; - -import java.util.Arrays; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.protobuf.vo.proto.LiteTestObject; -import com.github.dozermapper.protobuf.vo.proto.LiteTestObjectContainer; -import com.github.dozermapper.protobuf.vo.proto.ObjectWithCollection; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtoTestObjectWithNestedProtoObject; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollection; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollectionContainer; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.SimpleProtoTestObject; - -import org.junit.BeforeClass; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public class ProtoBeansDeepMappingTest { - - private static Mapper mapper; - - @BeforeClass - public static void setUp() { - mapper = DozerBeanMapperBuilder.create() - .withMappingFiles("mappings/protoSrcDeepBeansMapping.xml") - .build(); - } - - @Test - public void canSrcCopySimpleOneLevelField() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder.setOne("smthOne"); - - ProtoTestObjectWithNestedProtoObject.Builder protoTestObjectWithNestedProtoObjectBuilder = ProtoTestObjectWithNestedProtoObject.newBuilder(); - protoTestObjectWithNestedProtoObjectBuilder.setNestedObject(simpleProtoTestObjectBuilder); - protoTestObjectWithNestedProtoObjectBuilder.setOne("smthAnother-neverMind"); - - ProtoTestObjectWithNestedProtoObject protoTestObjectWithNestedProtoObject = protoTestObjectWithNestedProtoObjectBuilder.build(); - - LiteTestObject result = mapper.map(protoTestObjectWithNestedProtoObject, LiteTestObject.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertEquals(protoTestObjectWithNestedProtoObject.getNestedObject().getOne(), result.getOne()); - } - - @Test - public void canSrcCopyFieldFromListElement() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder1 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder1.setOne("smthAnother"); - - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder2 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder2.setOne("smthOne"); - - ProtobufWithSimpleCollection.Builder protobufWithSimpleCollectionBuilder = ProtobufWithSimpleCollection.newBuilder(); - protobufWithSimpleCollectionBuilder.addAllObject(Arrays.asList(simpleProtoTestObjectBuilder1.build(), simpleProtoTestObjectBuilder2.build())); - - ProtobufWithSimpleCollection protobufWithSimpleCollection = protobufWithSimpleCollectionBuilder.build(); - - LiteTestObject result = mapper.map(protobufWithSimpleCollection, LiteTestObject.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertEquals(protobufWithSimpleCollection.getObject(1).getOne(), result.getOne()); - } - - @Test - public void canSrcCopyList() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder1 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder1.setOne("smthAnother"); - - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder2 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder2.setOne("smthOne"); - - ProtobufWithSimpleCollection.Builder protoWithCollectionBuilder = ProtobufWithSimpleCollection.newBuilder(); - protoWithCollectionBuilder.addAllObject(Arrays.asList(simpleProtoTestObjectBuilder1.build(), simpleProtoTestObjectBuilder2.build())); - - ProtobufWithSimpleCollectionContainer.Builder protobufWithSimpleCollectionContainerBuilder = ProtobufWithSimpleCollectionContainer.newBuilder(); - protobufWithSimpleCollectionContainerBuilder.setObject(protoWithCollectionBuilder); - - ProtobufWithSimpleCollectionContainer src = protobufWithSimpleCollectionContainerBuilder.build(); - - ObjectWithCollection result = mapper.map(src, ObjectWithCollection.class); - - assertNotNull(result); - assertNotNull(result.getObjects()); - assertEquals(2, result.getObjects().size()); - } - - @Test - public void canSrcCopyListElement() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder1 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder1.setOne("smthAnother"); - - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder2 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder2.setOne("smthOne"); - - ProtobufWithSimpleCollection.Builder builder = ProtobufWithSimpleCollection.newBuilder(); - builder.addAllObject(Arrays.asList(simpleProtoTestObjectBuilder1.build(), simpleProtoTestObjectBuilder2.build())); - - ProtobufWithSimpleCollection protobufWithSimpleCollection = builder.build(); - - LiteTestObjectContainer result = mapper.map(protobufWithSimpleCollection, LiteTestObjectContainer.class); - - assertNotNull(result); - assertNotNull(result.getObject()); - assertNotNull(result.getObject().getOne()); - assertEquals(protobufWithSimpleCollection.getObject(1).getOne(), result.getObject().getOne()); - } - - @Test - public void canSrcCopyDeepListElement() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder1 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder1.setOne("smthOne"); - - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder2 = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder2.setOne("smthAnother"); - - ProtobufWithSimpleCollection.Builder protobufWithSimpleCollectionBuilder = ProtobufWithSimpleCollection.newBuilder(); - protobufWithSimpleCollectionBuilder.addAllObject(Arrays.asList(simpleProtoTestObjectBuilder1.build(), simpleProtoTestObjectBuilder2.build())); - - ProtobufWithSimpleCollectionContainer.Builder protobufWithSimpleCollectionContainerBuilder = ProtobufWithSimpleCollectionContainer.newBuilder(); - protobufWithSimpleCollectionContainerBuilder.setObject(protobufWithSimpleCollectionBuilder); - - ProtobufWithSimpleCollectionContainer protobufWithSimpleCollectionContainer = protobufWithSimpleCollectionContainerBuilder.build(); - - LiteTestObjectContainer result = mapper.map(protobufWithSimpleCollectionContainer, LiteTestObjectContainer.class); - - assertNotNull(result); - assertNotNull(result.getObject().getOne()); - assertEquals(protobufWithSimpleCollectionContainer.getObject().getObject(0).getOne(), result.getObject().getOne()); - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansMappingTest.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansMappingTest.java deleted file mode 100644 index e8f20abc3..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansMappingTest.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.functional_tests; - -import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.core.MappingException; -import com.github.dozermapper.protobuf.vo.proto.FieldNaming; -import com.github.dozermapper.protobuf.vo.proto.LiteTestObject; -import com.github.dozermapper.protobuf.vo.proto.MapExample; -import com.github.dozermapper.protobuf.vo.proto.ObjectWithCollection; -import com.github.dozermapper.protobuf.vo.proto.ObjectWithEnumCollection; -import com.github.dozermapper.protobuf.vo.proto.ObjectWithEnumField; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtoEnum; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtoObjectWithEnumField; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtoTestObjectWithNestedProtoObject; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufFieldNaming; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufMapExample; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithEnumCollection; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollection; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.SimpleProtoTestObject; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.SimpleProtoTestObjectWithoutRequired; -import com.github.dozermapper.protobuf.vo.proto.SimpleEnum; -import com.github.dozermapper.protobuf.vo.proto.TestObject; -import com.github.dozermapper.protobuf.vo.proto.TestObjectContainer; - -import org.hamcrest.core.IsInstanceOf; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -public class ProtoBeansMappingTest { - - private static Mapper mapper; - - @Rule - public ExpectedException badMapToProtoExpectedException = ExpectedException.none(); - - @Rule - public ExpectedException badMapFromProtoExpectedException = ExpectedException.none(); - - @BeforeClass - public static void setUp() { - mapper = DozerBeanMapperBuilder.create() - .withMappingFiles("mappings/protoBeansMapping.xml") - .build(); - } - - @Test - public void canSimpleToProto() { - TestObject testObject = new TestObject(); - testObject.setOne("ABC"); - - SimpleProtoTestObject result = mapper.map(testObject, SimpleProtoTestObject.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertEquals(testObject.getOne(), result.getOne()); - } - - @Test - public void canSimpleFromProto() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder.setOne("ABC"); - - SimpleProtoTestObject simpleProtoTestObject = simpleProtoTestObjectBuilder.build(); - - TestObject result = mapper.map(simpleProtoTestObject, TestObject.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertEquals(simpleProtoTestObject.getOne(), result.getOne()); - } - - @Test - public void canSimpleWildcardToProto() { - LiteTestObject liteTestObject = new LiteTestObject(); - liteTestObject.setOne("ABC"); - - SimpleProtoTestObject result = mapper.map(liteTestObject, SimpleProtoTestObject.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertEquals("ABC", result.getOne()); - } - - @Test - public void canSimpleWildcardFromProto() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder.setOne("ABC"); - - LiteTestObject result = mapper.map(simpleProtoTestObjectBuilder.build(), LiteTestObject.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertEquals("ABC", result.getOne()); - } - - @Test - public void canSimpleFromProtoWithNull() { - SimpleProtoTestObjectWithoutRequired.Builder simpleProtoTestObjectWithoutRequiredBuilder = SimpleProtoTestObjectWithoutRequired.newBuilder(); - SimpleProtoTestObjectWithoutRequired simpleProtoTestObjectWithoutRequired = simpleProtoTestObjectWithoutRequiredBuilder.build(); - - TestObject result = mapper.map(simpleProtoTestObjectWithoutRequired, TestObject.class); - - assertNotNull(result); - assertNull(result.getOne()); - } - - @Test - public void canSimpleToProtoWithNull() { - TestObject testObject = new TestObject(); - - SimpleProtoTestObjectWithoutRequired result = mapper.map(testObject, SimpleProtoTestObjectWithoutRequired.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertTrue(result.getOne().length() == 0); - } - - @Test - public void canNestedProtoFieldToProto() { - TestObject testObject = new TestObject(); - testObject.setOne("InnerName"); - - TestObjectContainer testObjectContainer = new TestObjectContainer(testObject, "Name"); - - ProtoTestObjectWithNestedProtoObject result = mapper.map(testObjectContainer, ProtoTestObjectWithNestedProtoObject.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertNotNull(result.getNestedObject()); - assertEquals(testObjectContainer.getOne(), result.getOne()); - assertEquals(testObjectContainer.getNested().getOne(), result.getNestedObject().getOne()); - } - - @Test - public void canNestedProtoFieldFromProto() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder.setOne("InnerName"); - - ProtoTestObjectWithNestedProtoObject.Builder protoTestObjectWithNestedProtoObjectBuilder = ProtoTestObjectWithNestedProtoObject.newBuilder(); - protoTestObjectWithNestedProtoObjectBuilder.setNestedObject(simpleProtoTestObjectBuilder.build()); - protoTestObjectWithNestedProtoObjectBuilder.setOne("Name"); - - ProtoTestObjectWithNestedProtoObject protoTestObjectWithNestedProtoObject = protoTestObjectWithNestedProtoObjectBuilder.build(); - - TestObjectContainer result = mapper.map(protoTestObjectWithNestedProtoObject, TestObjectContainer.class); - - assertNotNull(result); - assertNotNull(result.getOne()); - assertNotNull(result.getNested()); - assertNotNull(result.getNested().getOne()); - assertEquals(protoTestObjectWithNestedProtoObject.getOne(), result.getOne()); - assertEquals(protoTestObjectWithNestedProtoObject.getNestedObject().getOne(), result.getNested().getOne()); - } - - @Test - public void canEnumProtoFieldToProto() { - ObjectWithEnumField objectWithEnumField = new ObjectWithEnumField(); - objectWithEnumField.setEnumField(SimpleEnum.VALUE1); - - ProtoObjectWithEnumField result = mapper.map(objectWithEnumField, ProtoObjectWithEnumField.class); - - assertNotNull(result); - assertNotNull(result.getEnumField()); - assertEquals(objectWithEnumField.getEnumField().name(), result.getEnumField().name()); - } - - @Test - public void canEnumProtoFieldFromProto() { - ProtoObjectWithEnumField.Builder protoObjectWithEnumFieldBuilder = ProtoObjectWithEnumField.newBuilder(); - protoObjectWithEnumFieldBuilder.setEnumField(ProtoEnum.VALUE1); - - ProtoObjectWithEnumField protoObjectWithEnumField = protoObjectWithEnumFieldBuilder.build(); - - ObjectWithEnumField result = mapper.map(protoObjectWithEnumField, ObjectWithEnumField.class); - - assertNotNull(result); - assertNotNull(result.getEnumField()); - assertEquals(protoObjectWithEnumField.getEnumField().name(), result.getEnumField().name()); - } - - @Test - public void canRepeatedFieldToProto() { - TestObject testObject = new TestObject(); - testObject.setOne("One"); - - ObjectWithCollection objectWithCollection = new ObjectWithCollection(); - objectWithCollection.setObjects(Arrays.asList(testObject)); - - ProtobufWithSimpleCollection result = mapper.map(objectWithCollection, ProtobufWithSimpleCollection.class); - - assertNotNull(result); - assertNotNull(result.getObjectList()); - assertEquals(1, result.getObjectCount()); - assertNotNull(result.getObject(0)); - assertNotNull(result.getObject(0).getOne()); - assertEquals(objectWithCollection.getObjects().get(0).getOne(), result.getObject(0).getOne()); - } - - @Test - public void canRepeatedFieldFromProto() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder.setOne("One"); - - ProtobufWithSimpleCollection.Builder protobufWithSimpleCollectionBuilder = ProtobufWithSimpleCollection.newBuilder(); - protobufWithSimpleCollectionBuilder.addAllObject(Arrays.asList(simpleProtoTestObjectBuilder.build())); - - ProtobufWithSimpleCollection protobufWithSimpleCollection = protobufWithSimpleCollectionBuilder.build(); - - ObjectWithCollection result = mapper.map(protobufWithSimpleCollection, ObjectWithCollection.class); - - assertNotNull(result); - assertNotNull(result.getObjects()); - assertEquals(1, result.getObjects().size()); - assertNotNull(result.getObjects().get(0)); - assertNotNull(result.getObjects().get(0).getOne()); - assertEquals(protobufWithSimpleCollection.getObject(0).getOne(), result.getObjects().get(0).getOne()); - } - - @Test - public void canRepeatedEnumFieldToProto() { - ObjectWithEnumCollection objectWithEnumCollection = new ObjectWithEnumCollection(); - objectWithEnumCollection.setEnums(Arrays.asList(SimpleEnum.VALUE1)); - - ProtobufWithEnumCollection result = mapper.map(objectWithEnumCollection, ProtobufWithEnumCollection.class); - - assertNotNull(result); - assertNotNull(result.getObjectList()); - assertEquals(1, result.getObjectCount()); - assertNotNull(result.getObject(0)); - assertEquals(objectWithEnumCollection.getEnums().get(0).name(), result.getObject(0).name()); - } - - @Test - public void canRepeatedEnumFieldFromProto() { - ProtobufWithEnumCollection.Builder protobufWithEnumCollectionBuilder = ProtobufWithEnumCollection.newBuilder(); - protobufWithEnumCollectionBuilder.addAllObject(Arrays.asList(ProtoEnum.VALUE1)); - - ProtobufWithEnumCollection protobufWithEnumCollection = protobufWithEnumCollectionBuilder.build(); - - ObjectWithEnumCollection result = mapper.map(protobufWithEnumCollection, ObjectWithEnumCollection.class); - - assertNotNull(result); - assertNotNull(result.getEnums()); - assertEquals(1, result.getEnums().size()); - assertNotNull(result.getEnums().get(0)); - assertEquals(protobufWithEnumCollection.getObject(0).name(), result.getEnums().get(0).name()); - } - - @Test - public void canBadMapToProto() { - badMapToProtoExpectedException.expect(MappingException.class); - badMapToProtoExpectedException.expectMessage("Could not call map setter method putAllValue"); - badMapToProtoExpectedException.expectCause(IsInstanceOf.instanceOf(InvocationTargetException.class)); - - MapExample mapExample = new MapExample(); - mapExample.put("test", null); - mapExample.put("foo", "bar"); - - mapper.map(mapExample, ProtobufMapExample.class); - } - - @Test - public void canMapToProto() { - MapExample mapExample = new MapExample(); - mapExample.put("test", "value"); - - ProtobufMapExample result = mapper.map(mapExample, ProtobufMapExample.class); - - assertNotNull(result); - assertNotNull(result.getValueMap()); - assertEquals(mapExample.getValue(), result.getValueMap()); - } - - @Test - public void canBadMapFromProto() { - badMapFromProtoExpectedException.expect(NullPointerException.class); - - ProtobufMapExample.Builder protoMapExample = ProtobufMapExample.newBuilder(); - protoMapExample.putValue("test", null); - } - - @Test - public void canMapFromProto() { - ProtobufMapExample.Builder protobufMapExampleBuilder = ProtobufMapExample.newBuilder(); - protobufMapExampleBuilder.putValue("test", "value"); - protobufMapExampleBuilder.putValue("foo", "bar"); - - MapExample result = mapper.map(protobufMapExampleBuilder, MapExample.class); - - assertNotNull(result); - assertNotNull(result.getValue()); - assertEquals(protobufMapExampleBuilder.getValueMap(), result.getValue()); - } - - @Test - public void canSnakeCaseFieldFromProto() { - ProtobufFieldNaming.Builder protobufFieldNamingBuilder = ProtobufFieldNaming.newBuilder(); - protobufFieldNamingBuilder.setSnakeCaseField("some value"); - - ProtobufFieldNaming protobufFieldNaming = protobufFieldNamingBuilder.build(); - - FieldNaming result = mapper.map(protobufFieldNaming, FieldNaming.class); - - assertNotNull(result); - assertNotNull(result.getSnakeCaseField()); - assertEquals(protobufFieldNaming.getSnakeCaseField(), result.getSnakeCaseField()); - } - - @Test - public void canSnakeCaseFieldToProto() { - FieldNaming fieldNaming = new FieldNaming(); - fieldNaming.setSnakeCaseField("some value"); - - ProtobufFieldNaming result = mapper.map(fieldNaming, ProtobufFieldNaming.class); - - assertNotNull(result); - assertNotNull(result.getSnakeCaseField()); - assertEquals(fieldNaming.getSnakeCaseField(), result.getSnakeCaseField()); - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansMultipleFilesMappingTest.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansMultipleFilesMappingTest.java deleted file mode 100644 index 642e53b5b..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/functional_tests/ProtoBeansMultipleFilesMappingTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.functional_tests; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.protobuf.vo.proto.TestContainerObject; -import com.github.dozermapper.protobuf.vo.proto.NestedObject; -import com.github.dozermapper.protobuf.vo.proto.TestObject; -import com.github.dozermapper.protobuf.vo.proto.TestContainerObject.TestContainedEnum; -import com.github.dozermapper.protobuf.vo.protomultiple.ContainerObject; -import com.github.dozermapper.protobuf.vo.protomultiple.ContainerObject.ContainedEnum; -import com.github.dozermapper.protobuf.vo.protomultiple.SimpleProtoTestObject; - -import org.junit.BeforeClass; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public class ProtoBeansMultipleFilesMappingTest { - - private static Mapper mapper; - - @BeforeClass - public static void setUp() { - mapper = DozerBeanMapperBuilder.create() - .withMappingFiles("mappings/protoBeansMapping.xml") - .build(); - } - - @Test - public void canSimpleToProto() { - TestObject testObject = new TestObject(); - testObject.setOne("ABC"); - - NestedObject nestedObject = new NestedObject(); - nestedObject.setNested(testObject); - - SimpleProtoTestObject result = mapper.map(nestedObject, SimpleProtoTestObject.class); - - assertNotNull(result); - assertNotNull(result.getNested()); - assertNotNull(result.getNested().getOne()); - assertEquals(nestedObject.getNested().getOne(), result.getNested().getOne()); - } - - @Test - public void canSimpleFromProto() { - SimpleProtoTestObject.Builder simpleProtoTestObjectBuilder = SimpleProtoTestObject.newBuilder(); - simpleProtoTestObjectBuilder.getNestedBuilder().setOne("ABC"); - - SimpleProtoTestObject simpleProtoTestObject = simpleProtoTestObjectBuilder.build(); - - NestedObject result = mapper.map(simpleProtoTestObject, NestedObject.class); - - assertNotNull(result); - assertNotNull(result.getNested()); - assertNotNull(result.getNested().getOne()); - assertEquals(simpleProtoTestObject.getNested().getOne(), result.getNested().getOne()); - } - - @Test - public void canNestedObjectToProto() { - TestContainerObject containerObject = new TestContainerObject(); - containerObject.setEnum1(TestContainedEnum.VALUE2); - containerObject.setObj1(new TestContainerObject.TestContainedObject()); - containerObject.getObj1().setC1("ABC"); - - ContainerObject result = mapper.map(containerObject, ContainerObject.class); - assertNotNull(result); - assertNotNull(result.getEnum1()); - assertNotNull(result.getObj1()); - assertNotNull(result.getObj1().getC1()); - assertEquals(containerObject.getObj1().getC1(), result.getObj1().getC1()); - assertEquals(containerObject.getEnum1().name(), result.getEnum1().name()); - } - - @Test - public void canNestedObjectFromProto() { - ContainerObject.Builder containerBuiler = ContainerObject.newBuilder(); - containerBuiler.setEnum1(ContainedEnum.VALUE2); - containerBuiler.setObj1(ContainerObject.ContainedObject.newBuilder().setC1("ABC").build()); - ContainerObject container = containerBuiler.build(); - TestContainerObject result = mapper.map(container, TestContainerObject.class); - assertNotNull(result); - assertNotNull(result.getEnum1()); - assertNotNull(result.getObj1()); - assertNotNull(result.getObj1().getC1()); - assertEquals(container.getObj1().getC1(), result.getObj1().getC1()); - assertEquals(container.getEnum1().name(), result.getEnum1().name()); - - - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptorCreationStrategyTest.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptorCreationStrategyTest.java deleted file mode 100644 index bcd55b764..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/propertydescriptor/ProtoFieldPropertyDescriptorCreationStrategyTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.propertydescriptor; - -import com.github.dozermapper.core.config.BeanContainer; -import com.github.dozermapper.core.factory.DestBeanCreator; -import com.github.dozermapper.core.propertydescriptor.PropertyDescriptorFactory; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects; - -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertTrue; - -public class ProtoFieldPropertyDescriptorCreationStrategyTest { - - private ProtoFieldPropertyDescriptorCreationStrategy strategy; - - @Before - public void setUp() { - BeanContainer beanContainer = new BeanContainer(); - DestBeanCreator destBeanCreator = new DestBeanCreator(beanContainer); - strategy = new ProtoFieldPropertyDescriptorCreationStrategy(beanContainer, destBeanCreator, new PropertyDescriptorFactory()); - } - - @Test - public void isApplicableTrueIfMessageAndDeepMapping() { - /*any proto message class*/ - assertTrue(strategy.isApplicable(ProtoTestObjects.SimpleProtoTestObject.class,"deep.mapping")); - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/util/ProtoUtilsTest.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/util/ProtoUtilsTest.java deleted file mode 100644 index e9081e122..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/util/ProtoUtilsTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.util; - -import com.github.dozermapper.core.MappingException; -import com.github.dozermapper.core.config.BeanContainer; -import com.github.dozermapper.protobuf.vo.proto.FakeMessage; -import com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Message; - -import org.hamcrest.core.IsInstanceOf; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - -public class ProtoUtilsTest { - - @Rule - public ExpectedException handlesIncorrectMessageExpectedException = ExpectedException.none(); - - @Test - public void canGetBuilder() { - Message.Builder result = ProtoUtils.getBuilder(ProtoTestObjects.ProtobufFieldNaming.class); - - assertNotNull(result); - } - - @Test - public void handlesIncorrectMessage() { - handlesIncorrectMessageExpectedException.expect(MappingException.class); - handlesIncorrectMessageExpectedException.expectMessage("Failed to create Message.Builder for com.github.dozermapper.protobuf.vo.proto.FakeMessage"); - handlesIncorrectMessageExpectedException.expectCause(IsInstanceOf.instanceOf(NoSuchMethodException.class)); - - ProtoUtils.getBuilder(FakeMessage.class); - } - - @Test - public void getJavaGenericClassForCollectionHandlesNonCollections() { - Descriptors.FieldDescriptor fieldDescriptor = ProtoUtils.getFieldDescriptor(ProtoTestObjects.SimpleProtoTestObjectWithoutRequired.class, "one"); - - assertNull(ProtoUtils.getJavaGenericClassForCollection(fieldDescriptor, new BeanContainer())); - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/FakeMessage.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/FakeMessage.java deleted file mode 100644 index 6ab3471bc..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/FakeMessage.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -import com.google.protobuf.GeneratedMessageV3; -import com.google.protobuf.Message; - -public class FakeMessage extends GeneratedMessageV3 { - - @Override - protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return null; - } - - @Override - protected Message.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent) { - return null; - } - - @Override - public Message.Builder newBuilderForType() { - return null; - } - - @Override - public Message.Builder toBuilder() { - return null; - } - - @Override - public Message getDefaultInstanceForType() { - return null; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/FieldNaming.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/FieldNaming.java deleted file mode 100644 index 2c3843f73..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/FieldNaming.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class FieldNaming { - - private String snakeCaseField; - - public String getSnakeCaseField() { - return snakeCaseField; - } - - public void setSnakeCaseField(String snakeCaseField) { - this.snakeCaseField = snakeCaseField; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/LiteTestObject.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/LiteTestObject.java deleted file mode 100644 index 71c987bbd..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/LiteTestObject.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class LiteTestObject { - - private String one; - - public LiteTestObject() { - } - - public LiteTestObject(String one) { - this.one = one; - } - - public String getOne() { - return one; - } - - public void setOne(String one) { - this.one = one; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/LiteTestObjectContainer.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/LiteTestObjectContainer.java deleted file mode 100644 index 84b404811..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/LiteTestObjectContainer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class LiteTestObjectContainer { - - private LiteTestObject object; - - public LiteTestObject getObject() { - return object; - } - - public void setObject(LiteTestObject object) { - this.object = object; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/MapExample.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/MapExample.java deleted file mode 100644 index d2b028dd0..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/MapExample.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -import java.util.HashMap; -import java.util.Map; - -public class MapExample { - - private Map value = new HashMap<>(); - - public Map getValue() { - return value; - } - - public void setValue(Map value) { - this.value = value; - } - - public void put(String key, String value) { - this.value.put(key, value); - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/NestedObject.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/NestedObject.java deleted file mode 100644 index 17a764f7f..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/NestedObject.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class NestedObject { - public TestObject getNested() { - return nested; - } - - public void setNested(TestObject nested) { - this.nested = nested; - } - - private TestObject nested; -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithCollection.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithCollection.java deleted file mode 100644 index 5566ac0b6..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithCollection.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -import java.util.List; - -public class ObjectWithCollection { - - private List objects; - - public List getObjects() { - return objects; - } - - public void setObjects(List objects) { - this.objects = objects; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithEnumCollection.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithEnumCollection.java deleted file mode 100644 index 68f4e3af2..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithEnumCollection.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -import java.util.List; - -public class ObjectWithEnumCollection { - - private List enums; - - public ObjectWithEnumCollection() { - } - - public ObjectWithEnumCollection(List enums) { - this.enums = enums; - } - - public List getEnums() { - return enums; - } - - public void setEnums(List enums) { - this.enums = enums; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithEnumField.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithEnumField.java deleted file mode 100644 index 6fbadff88..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/ObjectWithEnumField.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class ObjectWithEnumField { - - private SimpleEnum enumField; - - public ObjectWithEnumField() { - } - - public ObjectWithEnumField(SimpleEnum enumField) { - this.enumField = enumField; - } - - public SimpleEnum getEnumField() { - return enumField; - } - - public void setEnumField(SimpleEnum enumField) { - this.enumField = enumField; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/SimpleEnum.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/SimpleEnum.java deleted file mode 100644 index 1f06ac8de..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/SimpleEnum.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public enum SimpleEnum { - - VALUE1, - VALUE2 -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestContainerObject.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestContainerObject.java deleted file mode 100644 index ad445033e..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestContainerObject.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class TestContainerObject { - public enum TestContainedEnum { - VALUE1, VALUE2; - } - - public static class TestContainedObject{ - private String c1; - - public TestContainedObject() { - - } - - public String getC1() { - return c1; - } - - public void setC1(String c1) { - this.c1 = c1; - } - } - - private TestContainedObject obj1; - private TestContainedEnum enum1; - - public TestContainerObject() { - } - - public TestContainedEnum getEnum1() { - return enum1; - } - - public TestContainedObject getObj1() { - return obj1; - } - - public void setEnum1(TestContainedEnum enum1) { - this.enum1 = enum1; - } - - public void setObj1(TestContainedObject obj1) { - this.obj1 = obj1; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestObject.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestObject.java deleted file mode 100755 index 90b2f356b..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestObject.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class TestObject { - - private String one; - private Integer two; - - public String getOne() { - return one; - } - - public void setOne(String one) { - this.one = one; - } - - public Integer getTwo() { - return two; - } - - public void setTwo(Integer two) { - this.two = two; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestObjectContainer.java b/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestObjectContainer.java deleted file mode 100644 index db99dc7db..000000000 --- a/dozer-integrations/dozer-proto3/src/test/java/com/github/dozermapper/protobuf/vo/proto/TestObjectContainer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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 com.github.dozermapper.protobuf.vo.proto; - -public class TestObjectContainer { - - private TestObject nested; - private String one; - - public TestObjectContainer() { - } - - public TestObjectContainer(TestObject nested, String one) { - this.nested = nested; - this.one = one; - } - - public String getOne() { - return one; - } - - public void setOne(String one) { - this.one = one; - } - - public TestObject getNested() { - return nested; - } - - public void setNested(TestObject nested) { - this.nested = nested; - } -} diff --git a/dozer-integrations/dozer-proto3/src/test/proto/ProtoTestObjects.proto b/dozer-integrations/dozer-proto3/src/test/proto/ProtoTestObjects.proto deleted file mode 100644 index d1ea1d40a..000000000 --- a/dozer-integrations/dozer-proto3/src/test/proto/ProtoTestObjects.proto +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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. - */ -syntax = "proto3"; -option java_package = "com.github.dozermapper.protobuf.vo.proto"; -option java_outer_classname = "ProtoTestObjects"; - -message SimpleProtoTestObject { - string one = 1; -} - -message SimpleProtoTestObjectWithoutRequired { - string one = 1; -} - -message ProtoTestObjectWithNestedProtoObject { - string one = 1; - SimpleProtoTestObject nestedObject = 2; -} - -enum ProtoEnum { - VALUE0 = 0; - VALUE1 = 1; - VALUE2 = 2; -} - -message ProtoObjectWithEnumField { - ProtoEnum enumField = 1; -} - -message ProtobufWithSimpleCollection { - repeated SimpleProtoTestObject object = 1; -} - -message ProtobufWithSimpleCollectionContainer { - ProtobufWithSimpleCollection object = 1; -} - -message ProtobufWithEnumCollection { - repeated ProtoEnum object = 1; -} - -message ProtobufMapExample { - map value = 1; -} - -message ProtobufFieldNaming { - string snake_case_field = 1; -} diff --git a/dozer-integrations/dozer-proto3/src/test/proto/ProtoTestObjectsMultipleFiles.proto b/dozer-integrations/dozer-proto3/src/test/proto/ProtoTestObjectsMultipleFiles.proto deleted file mode 100644 index 39f2544ea..000000000 --- a/dozer-integrations/dozer-proto3/src/test/proto/ProtoTestObjectsMultipleFiles.proto +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2005-2019 Dozer Project - * - * Licensed 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. - */ -syntax = "proto3"; -option java_package = "com.github.dozermapper.protobuf.vo.protomultiple"; -option java_multiple_files = true; - -message TestObject { - string one = 1; -} - -message SimpleProtoTestObject { - TestObject nested = 1; -} - -message ContainerObject { - - enum ContainedEnum { - VALUE1 = 0; - VALUE2 = 1; - } - - message ContainedObject { - string c1 = 1; - } - - ContainedObject obj1 = 1; - ContainedEnum enum1 = 2; -} \ No newline at end of file diff --git a/dozer-integrations/dozer-proto3/src/test/resources/mappings/protoBeansMapping.xml b/dozer-integrations/dozer-proto3/src/test/resources/mappings/protoBeansMapping.xml deleted file mode 100644 index c48f5890b..000000000 --- a/dozer-integrations/dozer-proto3/src/test/resources/mappings/protoBeansMapping.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - true - - - - com.github.dozermapper.protobuf.vo.proto.LiteTestObject - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.SimpleProtoTestObject - - - - com.github.dozermapper.protobuf.vo.proto.TestObject - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.SimpleProtoTestObject - - one - one - - - - - com.github.dozermapper.protobuf.vo.proto.TestObject - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.SimpleProtoTestObjectWithoutRequired - - one - one - - - - - com.github.dozermapper.protobuf.vo.proto.TestObjectContainer - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtoTestObjectWithNestedProtoObject - - one - one - - - nested - nestedObject - - - - - com.github.dozermapper.protobuf.vo.proto.ObjectWithEnumField - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtoObjectWithEnumField - - enumField - enumField - - - - - com.github.dozermapper.protobuf.vo.proto.ObjectWithCollection - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollection - - objects - object - - - - - com.github.dozermapper.protobuf.vo.proto.ObjectWithEnumCollection - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithEnumCollection - - enums - object - - - - - com.github.dozermapper.protobuf.vo.proto.TestContainerObject.TestContainedObject - com.github.dozermapper.protobuf.vo.protomultiple.ContainerObject.ContainedObject - - c1 - c1 - - - - - com.github.dozermapper.protobuf.vo.proto.TestContainerObject - com.github.dozermapper.protobuf.vo.protomultiple.ContainerObject - - obj1 - obj1 - - - enum1 - enum1 - - - - diff --git a/dozer-integrations/dozer-proto3/src/test/resources/mappings/protoSrcDeepBeansMapping.xml b/dozer-integrations/dozer-proto3/src/test/resources/mappings/protoSrcDeepBeansMapping.xml deleted file mode 100644 index 6c5fcd685..000000000 --- a/dozer-integrations/dozer-proto3/src/test/resources/mappings/protoSrcDeepBeansMapping.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - true - - - - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtoTestObjectWithNestedProtoObject - com.github.dozermapper.protobuf.vo.proto.LiteTestObject - - nestedObject.one - one - - - - - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollection - com.github.dozermapper.protobuf.vo.proto.LiteTestObject - - object[1].one - one - - - - - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollectionContainer - com.github.dozermapper.protobuf.vo.proto.ObjectWithCollection - - object.object - objects - - - - - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollectionContainer - com.github.dozermapper.protobuf.vo.proto.LiteTestObjectContainer - - object.object[0] - object - - - - - com.github.dozermapper.protobuf.vo.proto.ProtoTestObjects.ProtobufWithSimpleCollection - com.github.dozermapper.protobuf.vo.proto.LiteTestObjectContainer - - object[1] - object - - - - diff --git a/dozer-integrations/dozer-spring-support/dozer-spring-boot-autoconfigure/pom.xml b/dozer-integrations/dozer-spring-support/dozer-spring-boot-autoconfigure/pom.xml index ff08522b5..69eaccbfb 100644 --- a/dozer-integrations/dozer-spring-support/dozer-spring-boot-autoconfigure/pom.xml +++ b/dozer-integrations/dozer-spring-support/dozer-spring-boot-autoconfigure/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-spring-support - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT dozer-spring-boot-autoconfigure @@ -61,20 +61,4 @@ - - - - - org.apache.felix - maven-bundle-plugin - - - bundle - none - - - - - - diff --git a/dozer-integrations/dozer-spring-support/dozer-spring-boot-starter/pom.xml b/dozer-integrations/dozer-spring-support/dozer-spring-boot-starter/pom.xml index f1108bc25..db4868041 100644 --- a/dozer-integrations/dozer-spring-support/dozer-spring-boot-starter/pom.xml +++ b/dozer-integrations/dozer-spring-support/dozer-spring-boot-starter/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-spring-support - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT dozer-spring-boot-starter Dozer :: Integrations :: Spring Support :: Starter @@ -50,20 +50,4 @@ - - - - - org.apache.felix - maven-bundle-plugin - - - bundle - none - - - - - - diff --git a/dozer-integrations/dozer-spring-support/dozer-spring4/pom.xml b/dozer-integrations/dozer-spring-support/dozer-spring4/pom.xml index 8291e4252..c768789b2 100644 --- a/dozer-integrations/dozer-spring-support/dozer-spring4/pom.xml +++ b/dozer-integrations/dozer-spring-support/dozer-spring4/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-spring-support - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../ diff --git a/dozer-integrations/dozer-spring-support/pom.xml b/dozer-integrations/dozer-spring-support/pom.xml index 29d9d7344..f2ca8a0cf 100644 --- a/dozer-integrations/dozer-spring-support/pom.xml +++ b/dozer-integrations/dozer-spring-support/pom.xml @@ -22,7 +22,7 @@ dozer-integrations com.github.dozermapper - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../ 4.0.0 diff --git a/dozer-integrations/pom.xml b/dozer-integrations/pom.xml index 4014331d1..929c6f06e 100644 --- a/dozer-integrations/pom.xml +++ b/dozer-integrations/pom.xml @@ -23,7 +23,7 @@ com.github.dozermapper dozer-plugins-parent - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../plugins-parent @@ -32,7 +32,6 @@ Dozer :: Integrations dozer-spring-support - dozer-proto3 diff --git a/plugins-parent/pom.xml b/plugins-parent/pom.xml index 1ad01d047..e2160ecf7 100644 --- a/plugins-parent/pom.xml +++ b/plugins-parent/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-parent - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../ @@ -34,58 +34,33 @@ - 0.6.1 - 1.8 - 3.1.0 + 0.8.0 + 3.1.0 + 3.6.0 2.17 - 3.0.0 - 3.8.0 - 2.5.2 - 3.0.2 - 3.0.2 - 3.0.0 - 3.0.1 - 2.21.0 + 3.3.2 + 3.12.1 + 3.1.1 + 3.3.0 + 3.3.1 + 3.5.2 + 3.3.0 + 3.2.5 - 3.2.3 + 4.0.0 - 3.0.0 - 1.6.0 + 3.5.0 + 3.2.0 3.1.0 - 3.1.8 - - - 4.1.0 - 1.4.0 + 3.1.12.2 - 3.3.0.1 + 3.11.4 3.3.0 - - - version="[$(version;==;${osgi.version.clean}),$(version;=+;${osgi.version.clean}))" - [$(version;==;$(@)),$(version;+;$(@))) - - - !${osgi.Export-Package}, - com.github.dozermapper.*;${osgi.Import-Package.version}, - org.osgi.framework;version="[1.7,2)";resolution:=optional - - - - ${osgi.defaults.Import-Package}, - ${osgi.additional.Import-Package}, - * - - - - - - @@ -230,18 +205,6 @@ ${spotbugs-maven-plugin.version} - - - org.apache.felix - maven-bundle-plugin - ${maven-bundle-plugin.version} - - - org.apache.servicemix.tooling - depends-maven-plugin - ${depends-maven-plugin.version} - - com.github.os72 @@ -311,65 +274,6 @@ - - - org.apache.felix - maven-bundle-plugin - false - - - ${osgi.Bundle-Activator} - ${project.name} - https://dozermapper.github.io/gitbook/ - ${project.groupId}.${project.artifactId} - * - ${osgi.Export-Package};version=${project.version} - ${osgi.Import-Package} - ${project.name} - ${project.version} - ${project.groupId}.${project.artifactId}=${project.version} - ${osgi.Require-Capability} - ${osgi.Provide-Capability} - ${osgi.SPI-Consumer} - ${osgi.SPI-Provider} - <_versionpolicy>${osgi.Import-Package.default.version} - - - - - versions - validate - - cleanVersions - - - - ${project.version} - - - - - bundle - package - - bundle - - - - - - org.apache.servicemix.tooling - depends-maven-plugin - - - generate-depends-file - - generate-depends-file - - - - - com.github.spotbugs @@ -415,7 +319,7 @@ com.github.sevntu-checkstyle sevntu-checkstyle-maven-plugin - 1.24.2 + 1.35.0 compile diff --git a/pom.xml b/pom.xml index 2d8fbbffc..5c15c5791 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ com.github.dozermapper dozer-parent pom - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT Dozer :: Parent Dozer is a powerful Java Bean to Java Bean mapper that recursively copies data from one object to another @@ -85,15 +85,15 @@ true - 3.0.1 - 3.0.0-M1 - 1.6 - 3.0 - 0.3.1 - 1.6.8 - 2.4 + 3.6.3 + 3.4.1 + 3.1.0 + 4.3 + 1.0 + 1.6.13 + 2.16.2 - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT @@ -154,7 +154,7 @@ - 3.9.6 + 3.8.8 ${project.java.version} @@ -189,7 +189,7 @@ com.mycila license-maven-plugin -

${dozer.basedir}/building-tools/src/main/resources/LICENSE-HEADER.txt
+
building-tools/src/main/resources/LICENSE-HEADER.txt
.mvn/** mvnw @@ -234,6 +234,12 @@ org.apache.maven.plugins maven-gpg-plugin + + + --pinentry-mode + loopback + + sign-artifacts diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..01ae43ad5 --- /dev/null +++ b/renovate.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:best-practices", + "schedule:earlyMondays" + ] +} diff --git a/tests/dozer-jmh-tests/pom.xml b/tests/dozer-jmh-tests/pom.xml index 3c88b51f9..70747e7c7 100644 --- a/tests/dozer-jmh-tests/pom.xml +++ b/tests/dozer-jmh-tests/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper.tests dozer-tests-parent - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../ diff --git a/tests/pom.xml b/tests/pom.xml index 70bc4f2f0..f486b117c 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -24,7 +24,7 @@ com.github.dozermapper dozer-plugins-parent - 6.5.3-SNAPSHOT + 7.0.0-SNAPSHOT ../plugins-parent