1020 Commits

Author SHA1 Message Date
Filip Hrisafov
d4268e87e5 Migrate tests to use new JUnit Jupiter Infrastructure
Update test annotations to be JUnit Jupiter compatible

Replace all Test annotations from tests that are run with the AnnotationProcessorTestRunner with ProcessorTest.
Replace JUnit 4 Test#expected with assertThatThrownBy from AssertJ.
Replace Rule for GeneratedSource with RegisterExtension.
Fix some tests that were not reverting the changes to the default Locale and TimeZone.
Replace usage of org.junit.Assert with equivalent from org.junit.jupiter.api.Assertions or AssertJ.
2020-02-09 19:04:23 +01:00
Filip Hrisafov
ff27b2f70d Migrate the processor test infrastructure from Junit 4 to JUnit Jupiter
With JUnit Jupiter it is still not possible to set the ClassLoader for loading the test class.
Therefore, use the ModifiedClassLoaderExtension (heavily inspired by the Spring Boot bde7bd0a1a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtension.java).
Once JUnit Jupiter 201 is resolved we can simplify this.
With this extension we can catch all the tests in a class and then run them once the Class Extension Store gets closed with a modified ClassLoader.

The CompilationCache is stored in the GlobalCache with the CompilationRequest as key.
This means that even when methods are not executed in some particular order if they have same WithClasses
then they would reuse the cache.
2020-02-09 19:03:56 +01:00
Tim J. Baumann
a6b3cc364a Fix Javadoc of resolveViaMethodAndConversion
and fix some smaller Javadoc typos.
2020-02-07 17:38:59 +01:00
Filip Hrisafov
95ceba1a1e #2016 Update Checkstyle to 8.29
Adapt checkstyle configuration with new changes:
* Move cacheFile to Checker module
* Move LineLength to Checker module
* Use SuppressWithPlainTextCommentFilter
2020-02-02 14:33:45 +01:00
Sjaak Derksen
58da2d293f
#695 user control over mapping means (direct, method, conversion, 2step) 2020-02-02 10:05:26 +01:00
Sjaak Derksen
2d3761051a
#2011 Introduce gem as replacement of hickory:prism (#2007) 2020-01-27 20:16:04 +01:00
sjaakd
6b49c838eb #1998 simplify usage of inheritance of annotation fields 2020-01-25 09:13:50 +01:00
sjaakd
b84526b24a #1998 preparation move classes to new names 2 2020-01-25 09:13:50 +01:00
sjaakd
2b36c220a3 #1998 preparation move classes to new names 1 2020-01-25 09:13:50 +01:00
Filip Hrisafov
d056570267 #2001 Avoid NPE when checking whether import type element is nested
When the typeToAdd is an array then TypeElement is null and ComponentType is the one that would be imported
2020-01-24 22:02:51 +01:00
ttzn
779eb1bd47 #1420 Add support for Gradle incremental annotation processing (#1971)
* Add relevant file in META-INF
* Add integration test with Gradle test kit dependencies
* Test with Gradle 5 and Gradle 6
2019-12-08 19:55:16 +01:00
Sjaak Derksen
ee794d042c
#807 meta annotations and duck typing (#1979) 2019-12-07 22:20:11 +01:00
Sjaak Derksen
071e5dc6b2
#1966 extra unit test (#1967) 2019-11-10 20:14:33 +01:00
Andrei Arlou
b26cd4e0cb
#1953 Fix TODO items for: integrationtest-java8Test, integrationtest-lombokBuilderTest, processor-nullvaluemappingTest (#1955) 2019-10-26 22:24:59 +03:00
Andrei Arlou
efea2fb662
#1951 Use Map.computeIfAbsent in NestedTargetPropertyMappingHolder (#1952) 2019-10-20 22:11:17 +03:00
Andrei Arlou
74a2e358e8 #1946 Simplify conditions in classes: Parameter, SelectionParameters, MethodReference, PropertyMapping 2019-10-20 21:01:58 +02:00
Andrei Arlou
e8a7832d5b
#1948 Fix minor warnings with using collection in package model and class util/workarounds/EclipseAsMemberOfWorkaround (#1949) 2019-10-20 14:16:26 +03:00
Andrei Arlou
fe37b01c65
#1944 Remove unused constants in JavaStreamConstants (#1945) 2019-10-20 14:13:38 +03:00
Sjaak Derksen
5fbc86d92f
#1788 allowing enum / not enum by removing checks (#1939) 2019-10-08 21:06:47 +02:00
Sjaak Derksen
507ec1b384
#1557 & #1936 String-to-enum and enum-to-String (#1938)
* #1557 making enum-to-string and string-to-enum

* #1936 <ANY_REMAINING> and <ANY_UNMAPPED> not ignored when inverting
2019-10-07 20:30:20 +02:00
Filip Hrisafov
44ae27d7ca #1881 Use ReportingPolicy#IGNORE for unmappedSourcePolicy when mapping references are for forged methods
This aligns with the way the ReportingPolicy is handled for unmappedTargetPolicy when mapping references are for forged methods
2019-10-06 21:05:25 +02:00
Sjaak Derksen
1cb8291fb9
#1933 ignoreByDefault not inherited from config (#1935) 2019-10-05 15:47:25 +02:00
Filip Hrisafov
b3023b3902
#1828 Use update method when nested property of target is populated with multiple nested properties of source (#1931) 2019-09-29 17:21:20 +02:00
Filip Hrisafov
999d428ad8 #1742 Add test case 2019-09-28 19:15:22 +02:00
Andrei Arlou
81cd439343 #1921 Fix minor warnings in testutil 2019-09-26 20:02:53 +02:00
Sjaak Derksen
0d23f09e37
#1918 multiple target this mappings (#1920) 2019-09-23 20:04:56 +02:00
Andrei Arlou
70de843bea
#1911 Change return type MapperConfiguration.getBuilderPrism from Optional<BuilderPrism> to BuilderPrism (#1912) 2019-09-22 20:41:35 +03:00
Sjaak Derksen
ade4f4d7e2
#1821 nullpointer due to @BeanMapping via inheritance (#1822) 2019-09-22 19:25:43 +02:00
Filip Hrisafov
1c4bbba442 #1799 Fluent setters starting with set should work properly 2019-09-22 19:09:04 +02:00
Dainius Figoras
88a8669642 #1406 targeting . as current object 2019-09-22 19:08:05 +02:00
dekelpilli
f84f6501c8 #1851 Do not allow using qualifiedBy and qualifiedByName with expression in Mapping 2019-09-22 13:53:19 +02:00
Andrei Arlou
55fe94a93e
#1914 Remove unused method Type.isAnnotatedWith (#1915) 2019-09-22 10:50:38 +03:00
Andrei Arlou
f4c9313972
#1791 Support for conversion between java.time.LocalDateTime and javax.xml.datatype.XMLGregorianCalendar (#1894) 2019-09-21 22:27:45 +03:00
Filip Hrisafov
fcdf852a17 #1904 Do not include private methods when getting enclosed executable elements 2019-09-21 21:10:58 +02:00
Filip Hrisafov
e92e3b45c6 #1904 Create compilation error if a mapper could not be created due to a TypeHierarchyErroneousException 2019-09-21 21:10:58 +02:00
Andrei Arlou
750ce48023 #1792 Annotation processor option for default injection strategy 2019-09-18 19:51:36 +02:00
Filip Hrisafov
d018aed251
#1790 Use mapperPrism.values.nullValuePropertyMappingStrategy when retrieving NullValuePropertyMappingStrategy 2019-09-18 13:09:40 +02:00
Sjaak Derksen
7e0327767f
#1801 Using constructor as builderCreationMethod in custom builder (#1905) 2019-09-15 21:43:22 +02:00
Andrei Arlou
c044a87969
#1889 Remove unused parameters from classes TargetTypeSelector, ValueMapping, MethodRetrievalProcessor (#1890) 2019-09-14 04:12:38 +03:00
Andrei Arlou
2043506179
#1895 Refactor class org.mapstruct.ap.internal.util.Filters (#1896) 2019-09-14 03:57:42 +03:00
Andrei Arlou
3868735da7
#1897 Remove unused methods from class SourceMethod (#1898) 2019-09-14 03:43:27 +03:00
Andrei Arlou
7af107c9f2
#1883 Remove not used method "asCollectionOrMap" from TypeFactory (#1884) 2019-09-14 03:24:43 +03:00
Andrei Arlou
f95648cef8
#1088 Refactor constructor ForgedMethod (#1888) 2019-09-14 03:03:13 +03:00
Sjaak Derksen
e12f9ffd7b
Refactoring of BeanMapping and Source/TargetReferences (common base class) (#1903) 2019-09-13 19:41:06 +02:00
Sjaak Derksen
6d9a50601e
#1867 refactor make the source model only a reflection of the source (#1868) 2019-09-12 20:21:39 +02:00
Andrei Arlou
8e37159a00 Fix minor warnings:
remove unnecessary generic type for collections,
remove unnecessary exceptions from signature,
fix typos
2019-08-24 09:23:58 +02:00
Andrei Arlou
55048ab045 Simplify consistent checks in class Mapping 2019-08-19 20:43:14 +02:00
Andrei Arlou
ee8f9283f2 Simplify conditions in package org.mapstruct.ap.internal.model
and classes: Conversions.java, MappingResolverImpl.java,
EclipseAsMemberOfWorkaround.java
2019-08-18 21:01:05 +02:00
Andrei Arlou
59a5182dab Fix minor warnings:
remove unnecessary generic type for collections,
replace Charset.forName on StandartCharset
2019-08-18 16:24:14 +02:00
Andrei Arlou
dbe761e738 Fix minor warnings in packages test and testutil:
remove unnecessary generic types for collection,
replace numbers months on Calendar constants,
remove unnecessary exceptions from signature test methods
2019-08-18 15:53:50 +02:00