From e6492cf05aec8032f79c94d6f54c842ed1ce8ee7 Mon Sep 17 00:00:00 2001 From: Gareth Healy Date: Tue, 5 Mar 2024 09:40:19 +0000 Subject: [PATCH] dropped support for testing wildfly and osgi --- tests/dozer-osgi-tests-model/pom.xml | 49 ---- .../dozermapper/osgitestsmodel/Activator.java | 52 ---- .../dozermapper/osgitestsmodel/Person.java | 52 ---- .../src/main/resources/META-INF/LICENSE | 202 -------------- tests/dozer-osgi-tests/pom.xml | 259 ------------------ .../src/main/resources/META-INF/LICENSE | 202 -------------- .../AbstractDozerCoreOsgiContainerTest.java | 133 --------- .../osgitests/CoreKarafContainerTest.java | 78 ------ ...MinimalDependenciesKarafContainerTest.java | 60 ---- .../osgitests/Proto3KarafContainerTest.java | 98 ------- .../osgitests/SpringKarafContainerTest.java | 69 ----- .../osgitests/support/BundleOptions.java | 98 ------- .../osgitests/support/PaxExamTestSupport.java | 179 ------------ .../resources/etc/org.ops4j.pax.logging.cfg | 61 ----- .../resources/mappings/mapping-with-el.xml | 38 --- .../src/test/resources/mappings/mapping.xml | 32 --- tests/dozer-wildfly-tests/pom.xml | 128 --------- .../src/main/resources/META-INF/LICENSE | 202 -------------- .../dozermapper/wildflytests/MapperTest.java | 132 --------- .../src/test/resources/arquillian.xml | 30 -- .../src/test/resources/mappings/mapping.xml | 32 --- tests/pom.xml | 5 - 22 files changed, 2191 deletions(-) delete mode 100644 tests/dozer-osgi-tests-model/pom.xml delete mode 100644 tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Activator.java delete mode 100644 tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Person.java delete mode 100644 tests/dozer-osgi-tests-model/src/main/resources/META-INF/LICENSE delete mode 100644 tests/dozer-osgi-tests/pom.xml delete mode 100644 tests/dozer-osgi-tests/src/main/resources/META-INF/LICENSE delete mode 100644 tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/AbstractDozerCoreOsgiContainerTest.java delete mode 100644 tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreKarafContainerTest.java delete mode 100644 tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreMinimalDependenciesKarafContainerTest.java delete mode 100644 tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/Proto3KarafContainerTest.java delete mode 100644 tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/SpringKarafContainerTest.java delete mode 100644 tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/BundleOptions.java delete mode 100644 tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/PaxExamTestSupport.java delete mode 100644 tests/dozer-osgi-tests/src/test/resources/etc/org.ops4j.pax.logging.cfg delete mode 100644 tests/dozer-osgi-tests/src/test/resources/mappings/mapping-with-el.xml delete mode 100644 tests/dozer-osgi-tests/src/test/resources/mappings/mapping.xml delete mode 100644 tests/dozer-wildfly-tests/pom.xml delete mode 100644 tests/dozer-wildfly-tests/src/main/resources/META-INF/LICENSE delete mode 100644 tests/dozer-wildfly-tests/src/test/java/com/github/dozermapper/wildflytests/MapperTest.java delete mode 100644 tests/dozer-wildfly-tests/src/test/resources/arquillian.xml delete mode 100644 tests/dozer-wildfly-tests/src/test/resources/mappings/mapping.xml diff --git a/tests/dozer-osgi-tests-model/pom.xml b/tests/dozer-osgi-tests-model/pom.xml deleted file mode 100644 index e4c8bc9b9..000000000 --- a/tests/dozer-osgi-tests-model/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - 4.0.0 - - com.github.dozermapper.tests - dozer-tests-parent - 6.5.3-SNAPSHOT - ../ - - - dozer-osgi-tests-model - jar - Dozer :: Tests :: OSGi Bundle Tests Model - - - com.github.dozermapper.osgitestsmodel.Activator - com.github.dozermapper.osgitestsmodel.* - - - - - - org.osgi - org.osgi.core - provided - - - - diff --git a/tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Activator.java b/tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Activator.java deleted file mode 100644 index f835b8f59..000000000 --- a/tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Activator.java +++ /dev/null @@ -1,52 +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.osgitestsmodel; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext bundleContext; - private static Bundle bundle; - - public static BundleContext getBundleContext() { - return bundleContext; - } - - private static void setBundleContext(BundleContext context) { - Activator.bundleContext = context; - } - - public static Bundle getBundle() { - return bundle; - } - - private static void setBundle(Bundle bundle) { - Activator.bundle = bundle; - } - - public void start(BundleContext context) { - setBundleContext(context); - setBundle(context.getBundle()); - } - - public void stop(BundleContext context) { - setBundleContext(null); - setBundle(null); - } -} diff --git a/tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Person.java b/tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Person.java deleted file mode 100644 index f667ca33a..000000000 --- a/tests/dozer-osgi-tests-model/src/main/java/com/github/dozermapper/osgitestsmodel/Person.java +++ /dev/null @@ -1,52 +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.osgitestsmodel; - -public class Person { - - private String name; - private String id; - - public Person(String name, String id) { - this.name = name; - this.id = id; - } - - - public Person(String name) { - this.name = name; - } - - public Person() { - - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} diff --git a/tests/dozer-osgi-tests-model/src/main/resources/META-INF/LICENSE b/tests/dozer-osgi-tests-model/src/main/resources/META-INF/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/tests/dozer-osgi-tests-model/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/tests/dozer-osgi-tests/pom.xml b/tests/dozer-osgi-tests/pom.xml deleted file mode 100644 index 4fccf11e5..000000000 --- a/tests/dozer-osgi-tests/pom.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - 4.0.0 - - com.github.dozermapper.tests - dozer-tests-parent - 6.5.3-SNAPSHOT - ../ - - - dozer-osgi-tests - Dozer :: Tests :: OSGi Bundle Tests - - - com.github.dozermapper.osgitests.* - - 4.2.6 - - - - - com.github.dozermapper - dozer-core - ${project.version} - test - - - com.github.dozermapper - dozer-proto3 - ${project.version} - test - - - com.github.dozermapper - dozer-spring4 - ${project.version} - test - - - com.github.dozermapper.tests - dozer-osgi-tests-model - ${project.version} - test - - - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - test - - - com.fasterxml.jackson.core - jackson-core - test - - - com.fasterxml.jackson.core - jackson-databind - test - - - com.fasterxml.jackson.core - jackson-annotations - test - - - org.codehaus.woodstox - woodstox-core-asl - test - - - org.yaml - snakeyaml - 1.24 - test - - - - - org.javassist - javassist - test - - - - - org.glassfish - jakarta.el - test - - - - - org.apache.karaf.features - enterprise - ${karaf4-version} - features - xml - test - - - - - org.apache.felix - org.apache.felix.framework - provided - - - org.apache.felix - org.apache.felix.utils - 1.11.2 - test - - - - - org.apache.aries.spifly - org.apache.aries.spifly.dynamic.bundle - test - - - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.spring-core - test - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.spring-context - test - - - org.apache.servicemix.bundles - org.apache.servicemix.bundles.spring-beans - test - - - - - org.ops4j.pax.exam - pax-exam-container-karaf - test - - - org.ops4j.pax.exam - pax-exam-junit4 - test - - - org.ops4j.pax.exam - pax-exam-link-assembly - test - - - org.ops4j.pax.exam - pax-exam-link-mvn - test - - - jakarta.inject - jakarta.inject-api - test - - - - - org.apache.karaf - apache-karaf - ${karaf4-version} - zip - test - - - org.apache.karaf.shell - org.apache.karaf.shell.dev - - - org.eclipse - osgi - - - org.apache.karaf - org.apache.karaf.client - - - org.apache.felix - org.apache.felix.framework - - - - - - - - - com.github.veithen.alta - alta-maven-plugin - - - - generate-test-resources - - - %bundle.symbolicName%.link - %url% - - test - - - - - - - org.apache.servicemix.tooling - depends-maven-plugin - - - generate-depends-file - - generate-depends-file - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - ${karaf4-version} - - - - - - - diff --git a/tests/dozer-osgi-tests/src/main/resources/META-INF/LICENSE b/tests/dozer-osgi-tests/src/main/resources/META-INF/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/tests/dozer-osgi-tests/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/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/AbstractDozerCoreOsgiContainerTest.java b/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/AbstractDozerCoreOsgiContainerTest.java deleted file mode 100644 index 68180968c..000000000 --- a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/AbstractDozerCoreOsgiContainerTest.java +++ /dev/null @@ -1,133 +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.osgitests; - -import java.util.Dictionary; -import java.util.List; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.core.osgi.Activator; -import com.github.dozermapper.core.osgi.OSGiClassLoader; -import com.github.dozermapper.osgitests.support.PaxExamTestSupport; -import com.github.dozermapper.osgitestsmodel.Person; - -import org.apache.felix.utils.manifest.Clause; -import org.apache.felix.utils.manifest.Parser; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.wiring.BundleCapability; -import org.osgi.framework.wiring.BundleRevision; -import org.osgi.framework.wiring.BundleWiring; - -import static junit.framework.TestCase.assertTrue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public abstract class AbstractDozerCoreOsgiContainerTest extends PaxExamTestSupport { - - @Test - public void canGetBundleFromDozerCore() { - assertNotNull(bundleContext); - assertNotNull(Activator.getContext()); - assertNotNull(Activator.getBundle()); - - Bundle core = getBundle(bundleContext, "com.github.dozermapper.dozer-core"); - assertNotNull(core); - assertEquals(Bundle.ACTIVE, core.getState()); - - for (Bundle current : bundleContext.getBundles()) { - LOG.info("Bundle: {}", current.getSymbolicName()); - - //Ignore any Karaf bundles - if (current.getSymbolicName().startsWith("org.apache.karaf") - || current.getSymbolicName().startsWith("org.apache.aries.blueprint.core.compatibility") - || current.getSymbolicName().startsWith("org.jline")) { - continue; - } - - assertEquals(current.getSymbolicName(), Bundle.ACTIVE, current.getState()); - } - } - - @Test - public void canConstructDozerBeanMapper() { - Mapper mapper = DozerBeanMapperBuilder.create() - .withXmlMapping(() -> getLocalResource("mappings/mapping.xml")) - .withClassLoader(new OSGiClassLoader(com.github.dozermapper.osgitestsmodel.Activator.getBundleContext())) - .build(); - - assertNotNull(mapper); - assertNotNull(mapper.getMappingMetadata()); - } - - @Test - public void canMapUsingXML() { - Mapper mapper = DozerBeanMapperBuilder.create() - .withXmlMapping(() -> getLocalResource("mappings/mapping.xml")) - .withClassLoader(new OSGiClassLoader(com.github.dozermapper.osgitestsmodel.Activator.getBundleContext())) - .build(); - - assertNotNull(mapper); - assertNotNull(mapper.getMappingMetadata()); - - Person answer = mapper.map(new Person("bob"), Person.class); - - assertNotNull(answer); - assertNotNull(answer.getName()); - assertEquals("bob", answer.getName()); - } - - @Test - public void canResolveAllImports() { - Bundle core = getBundle(bundleContext, "com.github.dozermapper.dozer-core"); - assertNotNull(core); - assertEquals(Bundle.ACTIVE, core.getState()); - - Dictionary headers = core.getHeaders(); - assertNotNull(headers); - - Clause[] clauses = Parser.parseHeader(headers.get("Import-Package")); - for (Clause clause : clauses) { - LOG.info("Package: {}", clause.getName()); - - assertTrue(checkPackage(clause.getName())); - } - } - - private boolean checkPackage(String packageName) { - Bundle[] bundles = bundleContext.getBundles(); - for (int i = 0; (bundles != null) && (i < bundles.length); i++) { - BundleWiring wiring = bundles[i].adapt(BundleWiring.class); - List caps = wiring == null ? null : wiring.getCapabilities(BundleRevision.PACKAGE_NAMESPACE); - if (caps != null) { - for (BundleCapability cap : caps) { - String n = getAttribute(cap, BundleRevision.PACKAGE_NAMESPACE); - if (packageName.equals(n)) { - return true; - } - } - } - } - - return false; - } - - private String getAttribute(BundleCapability cap, String name) { - Object obj = cap.getAttributes().get(name); - return obj != null ? obj.toString() : null; - } -} diff --git a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreKarafContainerTest.java b/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreKarafContainerTest.java deleted file mode 100644 index 002df71e9..000000000 --- a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreKarafContainerTest.java +++ /dev/null @@ -1,78 +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.osgitests; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.core.el.ELExpressionFactory; -import com.github.dozermapper.core.osgi.OSGiClassLoader; -import com.github.dozermapper.osgitestsmodel.Person; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; - -import static com.github.dozermapper.osgitests.support.BundleOptions.coreBundles; -import static com.github.dozermapper.osgitests.support.BundleOptions.optionalBundles; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.ops4j.pax.exam.CoreOptions.junitBundles; -import static org.ops4j.pax.exam.CoreOptions.options; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class CoreKarafContainerTest extends AbstractDozerCoreOsgiContainerTest { - - @Configuration - public Option[] config() { - return options( - // Framework - karaf4ContainerConfigOptions(), - - // Bundles - optionalBundles(), - coreBundles(), - junitBundles() - ); - } - - @Test - public void canMapUsingXMLWithVariables() { - Mapper mapper = DozerBeanMapperBuilder.create() - .withXmlMapping(() -> getLocalResource("mappings/mapping-with-el.xml")) - .withClassLoader(new OSGiClassLoader(com.github.dozermapper.osgitestsmodel.Activator.getBundleContext())) - .build(); - - assertNotNull(mapper); - assertNotNull(mapper.getMappingMetadata()); - - Person answer = mapper.map(new Person("bob"), Person.class); - - assertNotNull(answer); - assertNotNull(answer.getName()); - assertEquals("bob", answer.getName()); - } - - @Test - public void elSupported() { - assertTrue(ELExpressionFactory.isSupported()); - } -} diff --git a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreMinimalDependenciesKarafContainerTest.java b/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreMinimalDependenciesKarafContainerTest.java deleted file mode 100644 index a243ccf0b..000000000 --- a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/CoreMinimalDependenciesKarafContainerTest.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.osgitests; - -import com.github.dozermapper.core.el.ELExpressionFactory; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; - -import static com.github.dozermapper.osgitests.support.BundleOptions.coreBundles; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.ops4j.pax.exam.CoreOptions.junitBundles; -import static org.ops4j.pax.exam.CoreOptions.options; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class CoreMinimalDependenciesKarafContainerTest extends AbstractDozerCoreOsgiContainerTest { - - @Configuration - public Option[] config() { - return options( - // Framework - karaf4ContainerConfigOptions(), - - // Bundles - coreBundles(), - junitBundles() - ); - } - - @Test - public void elNotSupported() { - assertFalse(ELExpressionFactory.isSupported()); - } - - @Test - @Override - public void canResolveAllImports() { - assertTrue(true); - } -} diff --git a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/Proto3KarafContainerTest.java b/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/Proto3KarafContainerTest.java deleted file mode 100644 index 92c3f08c8..000000000 --- a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/Proto3KarafContainerTest.java +++ /dev/null @@ -1,98 +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.osgitests; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.DozerModule; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.core.osgi.OSGiClassLoader; -import com.github.dozermapper.osgitests.support.BundleOptions; -import com.github.dozermapper.protobuf.ProtobufSupportModule; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.osgi.framework.Bundle; -import org.osgi.framework.ServiceReference; - -import static com.github.dozermapper.osgitests.support.BundleOptions.localBundle; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.ops4j.pax.exam.CoreOptions.junitBundles; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.systemPackages; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class Proto3KarafContainerTest extends CoreKarafContainerTest { - - @Configuration - public Option[] config() { - return options( - // Framework - karaf4ContainerConfigOptions(), - - // ServiceLoader - localBundle("org.apache.aries.spifly.dynamic.bundle.link"), - - // Bundles - BundleOptions.optionalBundles(), - BundleOptions.coreBundles(), - - // Proto3 - localBundle("com.google.guava.link"), - localBundle("com.google.protobuf.link"), - - // Proto - localBundle("com.github.dozermapper.dozer-proto3.link"), - junitBundles(), - systemPackages("sun.misc") - ); - } - - @Test - @Override - public void canGetBundleFromDozerCore() { - super.canGetBundleFromDozerCore(); - - Bundle proto = getBundle(bundleContext, "com.github.dozermapper.dozer-proto3"); - assertNotNull(proto); - assertEquals(Bundle.ACTIVE, proto.getState()); - } - - @Test - public void canResolveProtobufSupportModule() { - Mapper mapper = DozerBeanMapperBuilder.create() - .withXmlMapping(() -> getLocalResource("mappings/mapping.xml")) - .withClassLoader(new OSGiClassLoader(com.github.dozermapper.osgitestsmodel.Activator.getBundleContext())) - .build(); - - assertNotNull(mapper); - assertNotNull(mapper.getMappingMetadata()); - - ServiceReference dozerModuleServiceReference = bundleContext.getServiceReference(DozerModule.class); - assertNotNull(dozerModuleServiceReference); - - DozerModule dozerModule = bundleContext.getService(dozerModuleServiceReference); - assertNotNull(dozerModule); - assertTrue(dozerModule instanceof ProtobufSupportModule); - } -} diff --git a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/SpringKarafContainerTest.java b/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/SpringKarafContainerTest.java deleted file mode 100644 index 7594e9e8a..000000000 --- a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/SpringKarafContainerTest.java +++ /dev/null @@ -1,69 +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.osgitests; - -import com.github.dozermapper.osgitests.support.BundleOptions; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.osgi.framework.Bundle; - -import static com.github.dozermapper.osgitests.support.BundleOptions.localBundle; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.ops4j.pax.exam.CoreOptions.junitBundles; -import static org.ops4j.pax.exam.CoreOptions.options; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class SpringKarafContainerTest extends CoreKarafContainerTest { - - @Configuration - public Option[] config() { - return options( - // Framework - karaf4ContainerConfigOptions(), - - // Bundles - BundleOptions.optionalBundles(), - BundleOptions.coreBundles(), - - // Spring - localBundle("org.apache.servicemix.bundles.spring-beans.link"), - localBundle("org.apache.servicemix.bundles.spring-context.link"), - localBundle("org.apache.servicemix.bundles.spring-core.link"), - - // Spring4 - localBundle("com.github.dozermapper.dozer-spring4.link"), - junitBundles() - ); - } - - @Test - @Override - public void canGetBundleFromDozerCore() { - super.canGetBundleFromDozerCore(); - - Bundle spring = getBundle(bundleContext, "com.github.dozermapper.dozer-spring4"); - assertNotNull(spring); - assertEquals(Bundle.ACTIVE, spring.getState()); - } -} diff --git a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/BundleOptions.java b/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/BundleOptions.java deleted file mode 100644 index 89bd4c52f..000000000 --- a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/BundleOptions.java +++ /dev/null @@ -1,98 +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.osgitests.support; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; -import java.util.List; - -import org.apache.commons.io.IOUtils; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.options.UrlProvisionOption; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.ops4j.pax.exam.CoreOptions.composite; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; -import static org.ops4j.pax.exam.CoreOptions.url; -import static org.ops4j.pax.exam.CoreOptions.wrappedBundle; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; - -public final class BundleOptions { - - public static Option coreBundles() { - return composite( - // Commons - localBundle("org.apache.commons.commons-beanutils.link"), - localBundle("org.apache.commons.collections.link"), - localBundle("org.apache.commons.lang3.link"), - localBundle("org.apache.commons.io.link"), - - // Objenesis - localBundle("org.objenesis.link"), - - // Core - localBundle("com.github.dozermapper.dozer-core.link"), - localBundle("com.github.dozermapper.tests.dozer-osgi-tests-model.link") - ); - } - - public static Option optionalBundles() { - return composite( - // Optional; Jackson - localBundle("com.fasterxml.jackson.core.jackson-annotations.link"), - localBundle("com.fasterxml.jackson.core.jackson-core.link"), - localBundle("com.fasterxml.jackson.core.jackson-databind.link"), - localBundle("com.fasterxml.jackson.dataformat.jackson-dataformat-yaml.link"), - localBundle("woodstox-core-asl.link"), - localBundle("stax2-api.link"), - localBundle("org.yaml.snakeyaml.link"), - - // Optional; Javassist - localBundle("javassist.link"), - - // Optional; EL - localBundle("org.glassfish.jakarta.el.link"), - - // Optional; Hibernate - features(maven().groupId("org.apache.karaf.features") - .artifactId("enterprise") - .type("xml") - .classifier("features") - .versionAsInProject(), "hibernate"), - - wrappedBundle(mavenBundle().groupId("org.apache.felix") - .artifactId("org.apache.felix.utils") - .versionAsInProject()) - ); - } - - public static UrlProvisionOption localBundle(String link) { - try (InputStream resourceAsStream = BundleOptions.class.getClassLoader().getResourceAsStream(link)) { - assertNotNull("Invalid link file was provided: " + link, resourceAsStream); - - List urls = IOUtils.readLines(resourceAsStream, Charset.forName("UTF-8")); - - assertEquals("Invalid link file was provided: " + link, 1, urls.size()); - - return url(urls.get(0)); - } catch (IOException e) { - throw new IllegalArgumentException(e); - } - } -} diff --git a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/PaxExamTestSupport.java b/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/PaxExamTestSupport.java deleted file mode 100644 index 8a7e586db..000000000 --- a/tests/dozer-osgi-tests/src/test/java/com/github/dozermapper/osgitests/support/PaxExamTestSupport.java +++ /dev/null @@ -1,179 +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.osgitests.support; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.net.URL; - -import jakarta.inject.Inject; - -import org.junit.After; -import org.junit.Before; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.ProbeBuilder; -import org.ops4j.pax.exam.TestProbeBuilder; -import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil; -import org.ops4j.pax.exam.karaf.options.LogLevelOption; -import org.ops4j.pax.exam.options.extra.VMOption; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.ops4j.pax.exam.CoreOptions.composite; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.CoreOptions.vmOption; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile; - -public abstract class PaxExamTestSupport { - - private static final String FRAMEWORK_GROUP_ID = "org.apache.karaf"; - private static final String FRAMEWORK_ARTIFACT_ID = "apache-karaf"; - - protected static final Logger LOG = LoggerFactory.getLogger(PaxExamTestSupport.class); - - @Inject - protected BundleContext bundleContext; - - @ProbeBuilder - public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) { - // Makes sure the generated Test-Bundle contains this import! - probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*"); - return probe; - } - - @Before - public void setUp() { - LOG.info("setUp() using BundleContext: {}", bundleContext); - } - - @After - public void tearDown() { - LOG.info("tearDown()"); - } - - protected Option karaf4ContainerConfigOptions() { - return karafContainerConfigOptions(System.getProperty("karafVersion")); - } - - protected Option karafContainerConfigOptions(String version) { - return composite( - karafDistributionConfiguration() - .frameworkUrl(maven().groupId(FRAMEWORK_GROUP_ID) - .artifactId(FRAMEWORK_ARTIFACT_ID) - .version(version) - .type("zip") - .versionAsInProject()) - .karafVersion(version) - .name("Apache Karaf " + version) - .unpackDirectory(new File("target/paxexam/unpack")) - .useDeployFolder(false), - - logLevel(LogLevelOption.LogLevel.INFO), - - // Keep the folder so we can look inside when something fails - keepRuntimeFolder(), - - // Disable the SSH port - configureConsole().ignoreRemoteShell(), - - // Replace karaf logging with our own - replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getConfigFile("etc/org.ops4j.pax.logging.cfg")), - - // Disable the Karaf shutdown port - editConfigurationFilePut("etc/custom.properties", "karaf.shutdown.port", "-1"), - - // Make sure everything is UTF8 - vmOption("-Dfile.encoding=UTF-8"), - - // Get any Java >= 9 options - getJavaModuleOptions() - - // Suspend startup until debugger attached - //vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005") - ); - } - - private Option getJavaModuleOptions() { - if (JavaVersionUtil.getMajorVersion() >= 9) { - return composite( - vmOption("--add-reads=java.xml=java.logging"), - vmOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"), - - vmOption("--patch-module"), - vmOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-" + System.getProperty("karaf.version") + ".jar"), - vmOption("--patch-module"), - vmOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-" + System.getProperty("karaf.version") + ".jar"), - - vmOption("--add-opens"), - vmOption("java.base/java.security=ALL-UNNAMED"), - vmOption("--add-opens"), - vmOption("java.base/java.net=ALL-UNNAMED"), - vmOption("--add-opens"), - vmOption("java.base/java.lang=ALL-UNNAMED"), - vmOption("--add-opens"), - vmOption("java.base/java.util=ALL-UNNAMED"), - vmOption("--add-opens"), - vmOption("java.naming/javax.naming.spi=ALL-UNNAMED"), - vmOption("--add-opens"), - vmOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"), - - vmOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"), - vmOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"), - vmOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"), - vmOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"), - vmOption("-classpath"), - vmOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*") - ); - } else { - return composite(); - } - } - - private File getConfigFile(String path) { - URL res = getClass().getClassLoader().getResource(path); - if (res == null) { - throw new RuntimeException("Resource " + path + " not found", new FileNotFoundException("URL is null for " + path)); - } - - return new File(res.getFile()); - } - - protected InputStream getLocalResource(String path) { - return new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(path)); - } - - protected Bundle getBundle(BundleContext bundleContext, String symbolicName) { - Bundle answer = null; - for (Bundle current : bundleContext.getBundles()) { - if (current.getSymbolicName().startsWith(symbolicName)) { - answer = current; - break; - } - } - - return answer; - } -} diff --git a/tests/dozer-osgi-tests/src/test/resources/etc/org.ops4j.pax.logging.cfg b/tests/dozer-osgi-tests/src/test/resources/etc/org.ops4j.pax.logging.cfg deleted file mode 100644 index d1529deda..000000000 --- a/tests/dozer-osgi-tests/src/test/resources/etc/org.ops4j.pax.logging.cfg +++ /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. -# - -# Common pattern layout for appenders -log4j2.pattern = %d{ISO8601} | %-5p | %-16t | %-32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n - -# Root logger -log4j2.rootLogger.level = INFO -log4j2.rootLogger.appenderRefs = RollingFile, PaxOsgi, Console -log4j2.rootLogger.appenderRef.RollingFile.ref = RollingFile -log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi -log4j2.rootLogger.appenderRef.Console.ref = Console -log4j2.rootLogger.appenderRef.Console.filter.threshold.type = ThresholdFilter -log4j2.rootLogger.appenderRef.Console.filter.threshold.level = ${karaf.log.console:-OFF} - -# Appenders configuration -log4j2.appenders = console, rolling, osgi - -# CONSOLE appender not used by default -log4j2.appender.console.type = Console -log4j2.appender.console.name = Console -log4j2.appender.console.layout.type = PatternLayout -log4j2.appender.console.layout.pattern = ${log4j2.pattern} - -# File appender -log4j2.appender.rolling.type = RollingRandomAccessFile -log4j2.appender.rolling.name = RollingFile -log4j2.appender.rolling.fileName = ${karaf.data}/log/karaf.log -log4j2.appender.rolling.filePattern = ${karaf.data}/log/karaf.log.%i -log4j2.appender.rolling.append = true -log4j2.appender.rolling.layout.type = PatternLayout -log4j2.appender.rolling.layout.pattern = ${log4j2.pattern} -log4j2.appender.rolling.policies.type = Policies -log4j2.appender.rolling.policies.size.type = SizeBasedTriggeringPolicy -log4j2.appender.rolling.policies.size.size = 16MB - -# OSGi appender -log4j2.appender.osgi.type = PaxOsgi -log4j2.appender.osgi.name = PaxOsgi -log4j2.appender.osgi.filter = * - -# help with identification of maven-related problems with pax-url-aether -#log4j2.logger.aether.name = shaded.org.eclipse.aether -#log4j2.logger.aether.level = TRACE -#log4j2.logger.http-headers.name = shaded.org.apache.http.headers -#log4j2.logger.http-headers.level = DEBUG -#log4j2.logger.maven.name = org.ops4j.pax.url.mvn -#log4j2.logger.maven.level = TRACE diff --git a/tests/dozer-osgi-tests/src/test/resources/mappings/mapping-with-el.xml b/tests/dozer-osgi-tests/src/test/resources/mappings/mapping-with-el.xml deleted file mode 100644 index aa86dfdcd..000000000 --- a/tests/dozer-osgi-tests/src/test/resources/mappings/mapping-with-el.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - com.github.dozermapper.osgitestsmodel.Person - - - - - ${person} - com.github.dozermapper.osgitestsmodel.Person - - name - name - - - - diff --git a/tests/dozer-osgi-tests/src/test/resources/mappings/mapping.xml b/tests/dozer-osgi-tests/src/test/resources/mappings/mapping.xml deleted file mode 100644 index 4d4f96bb9..000000000 --- a/tests/dozer-osgi-tests/src/test/resources/mappings/mapping.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - com.github.dozermapper.osgitestsmodel.Person - com.github.dozermapper.osgitestsmodel.Person - - name - name - - - - diff --git a/tests/dozer-wildfly-tests/pom.xml b/tests/dozer-wildfly-tests/pom.xml deleted file mode 100644 index b366524cd..000000000 --- a/tests/dozer-wildfly-tests/pom.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - 4.0.0 - - com.github.dozermapper.tests - dozer-tests-parent - 6.5.3-SNAPSHOT - ../ - - - dozer-wildfly-tests - Dozer :: Tests :: Wildfly Tests - - - com.github.dozermapper.wildflytests.* - - 1.4.0.Final - 2.1.0.Final - 2.2.6 - 10.1.0.Final - - - - - - org.jboss.arquillian - arquillian-bom - ${arquillian-bom.version} - import - pom - - - - - - - com.github.dozermapper - dozer-core - ${project.version} - test - - - com.github.dozermapper.tests - dozer-osgi-tests-model - ${project.version} - test - - - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.wildfly.arquillian - wildfly-arquillian-container-embedded - ${wildfly-arquillian-container-embedded.version} - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-depchain - ${shrinkwrap.version} - test - pom - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - process-test-classes - - unpack - - - - - org.wildfly - wildfly-dist - ${wildfly-dist.version} - zip - false - target - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.jboss.logmanager.LogManager - - - - - - - diff --git a/tests/dozer-wildfly-tests/src/main/resources/META-INF/LICENSE b/tests/dozer-wildfly-tests/src/main/resources/META-INF/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/tests/dozer-wildfly-tests/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/tests/dozer-wildfly-tests/src/test/java/com/github/dozermapper/wildflytests/MapperTest.java b/tests/dozer-wildfly-tests/src/test/java/com/github/dozermapper/wildflytests/MapperTest.java deleted file mode 100644 index f7185db15..000000000 --- a/tests/dozer-wildfly-tests/src/test/java/com/github/dozermapper/wildflytests/MapperTest.java +++ /dev/null @@ -1,132 +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.wildflytests; - -import com.github.dozermapper.core.DozerBeanMapperBuilder; -import com.github.dozermapper.core.Mapper; -import com.github.dozermapper.core.classmap.MappingDirection; -import com.github.dozermapper.core.loader.api.BeanMappingBuilder; -import com.github.dozermapper.osgitestsmodel.Person; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.resolver.api.maven.Maven; -import org.junit.Test; -import org.junit.runner.RunWith; - -import java.io.File; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -@RunWith(Arquillian.class) -public class MapperTest { - - @Deployment - public static Archive createDeployment() { - File[] deps = Maven.resolver() - .loadPomFromFile("pom.xml") - .importRuntimeAndTestDependencies() - .resolve() - .withTransitivity() - .asFile(); - - return ShrinkWrap.create(WebArchive.class) - .addAsLibraries(deps); - } - - @Test - public void canConstructDozerBeanMapper() { - Mapper mapper = DozerBeanMapperBuilder.create() - .withMappingFiles("mappings/mapping.xml") - .build(); - - assertNotNull(mapper); - } - - @Test - public void canMapUsingXML() { - Mapper mapper = DozerBeanMapperBuilder.create() - .withMappingFiles("mappings/mapping.xml") - .build(); - - Person answer = mapper.map(new Person("bob"), Person.class); - - assertNotNull(answer); - assertNotNull(answer.getName()); - assertEquals("bob", answer.getName()); - } - - @Test - public void testOneWayExcludeViaApi() { - Mapper mapper = DozerBeanMapperBuilder.create() - .withMappingFiles("mappings/mapping.xml") - .withMappingBuilder(new PersonMappingProfile()) - .build(); - - PersonDTO dto = mapper.map(new Person("bob", "000-000-01"), PersonDTO.class); - - assertEquals(dto.getName(), null); - - assertEquals(dto.getId(), null); - - Person entity = mapper.map(new PersonDTO("bob", "000-000-01"), Person.class); - - assertEquals(entity.getName(), null); - - assertEquals(entity.getId(), "000-000-01"); - } - - public static class PersonDTO { - private String name; - private String id; - - PersonDTO() { - } - - PersonDTO(String name, String id) { - this.name = name; - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - } - - class PersonMappingProfile extends BeanMappingBuilder { - @Override - protected void configure() { - mapping(Person.class, PersonDTO.class) - .exclude("name") - .exclude("id", MappingDirection.ONE_WAY); - } - } -} diff --git a/tests/dozer-wildfly-tests/src/test/resources/arquillian.xml b/tests/dozer-wildfly-tests/src/test/resources/arquillian.xml deleted file mode 100644 index 3f9d02f65..000000000 --- a/tests/dozer-wildfly-tests/src/test/resources/arquillian.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - target/wildfly-10.1.0.Final/ - target/wildfly-10.1.0.Final/modules - - - - diff --git a/tests/dozer-wildfly-tests/src/test/resources/mappings/mapping.xml b/tests/dozer-wildfly-tests/src/test/resources/mappings/mapping.xml deleted file mode 100644 index 4d4f96bb9..000000000 --- a/tests/dozer-wildfly-tests/src/test/resources/mappings/mapping.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - com.github.dozermapper.osgitestsmodel.Person - com.github.dozermapper.osgitestsmodel.Person - - name - name - - - - diff --git a/tests/pom.xml b/tests/pom.xml index 6eac9b0b3..70bc4f2f0 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -34,11 +34,6 @@ Dozer :: Tests - dozer-jmh-tests