From d56014419a55fcd2c9ebdfc4771743807a7c43ac Mon Sep 17 00:00:00 2001 From: sjaakd Date: Sat, 11 Feb 2017 16:53:36 +0100 Subject: [PATCH] #1057 additional testing --- .../FishTankMapper.java | 16 ++++- .../NestedTargetPropertiesTest.java | 2 + .../NestedTargetPropertiesTest1.java | 71 +++++++++++++++++-- .../_target/FishTankDto.java | 36 ++++++++++ .../_target/MaterialDto.java | 46 ++++++++++++ .../_target/MaterialTypeDto.java | 37 ++++++++++ .../_target/OrnamentDto.java | 37 ++++++++++ .../_target/WaterQualityDto.java | 37 ++++++++++ .../_target/WaterQualityOrganisationDto.java | 46 ++++++++++++ .../_target/WaterQualityReportDto.java | 46 ++++++++++++ .../source/FishTank.java | 27 +++++++ .../source/Interior.java | 45 ++++++++++++ .../source/MaterialType.java | 37 ++++++++++ .../source/Ornament.java | 37 ++++++++++ .../source/WaterQuality.java | 37 ++++++++++ .../source/WaterQualityReport.java | 46 ++++++++++++ 16 files changed, 596 insertions(+), 7 deletions(-) create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialDto.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialTypeDto.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/OrnamentDto.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityDto.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityOrganisationDto.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityReportDto.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Interior.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/MaterialType.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Ornament.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQuality.java create mode 100644 processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQualityReport.java diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapper.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapper.java index 0626e6a38d..5494d3a511 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapper.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapper.java @@ -36,7 +36,21 @@ public interface FishTankMapper { @Mappings({ @Mapping(target = "fish.kind", source = "fish.type"), - @Mapping(target = "fish.name", ignore = true) + @Mapping(target = "ornament", source = "interior.ornament"), + @Mapping(target = "material.materialType", source = "material"), + @Mapping(target = "quality.report.organisation.name", source = "quality.report.organisationName") }) FishTankDto map( FishTank source ); + + @Mappings({ + @Mapping(target = "fish.kind", source = "source.fish.type"), + @Mapping(target = "ornament", source = "source.interior.ornament"), + @Mapping(target = "material.materialType", source = "source.material"), + @Mapping(target = "quality.report.organisation.name", source = "source.quality.report.organisationName") + }) + FishTankDto mapAsWell( FishTank source ); + + // how about reversing? + // ignores? + // constants, expressions? } diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest.java index b7e9f94e3f..40f2cbd434 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest.java @@ -19,6 +19,7 @@ package org.mapstruct.ap.test.nestedtargetproperties; import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -188,6 +189,7 @@ public void shouldMapNestedTargetWitUpdate() { } @Test + @Ignore // for the time being public void automappingAndTargetNestingDemonstrator() { FishTank source = new FishTank(); diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest1.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest1.java index 4855f549d5..a440477cf8 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest1.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/NestedTargetPropertiesTest1.java @@ -23,10 +23,21 @@ import org.junit.runner.RunWith; import org.mapstruct.ap.test.nestedtargetproperties._target.FishDto; import org.mapstruct.ap.test.nestedtargetproperties._target.FishTankDto; +import org.mapstruct.ap.test.nestedtargetproperties._target.MaterialDto; +import org.mapstruct.ap.test.nestedtargetproperties._target.MaterialTypeDto; +import org.mapstruct.ap.test.nestedtargetproperties._target.OrnamentDto; import org.mapstruct.ap.test.nestedtargetproperties._target.WaterPlantDto; +import org.mapstruct.ap.test.nestedtargetproperties._target.WaterQualityDto; +import org.mapstruct.ap.test.nestedtargetproperties._target.WaterQualityOrganisationDto; +import org.mapstruct.ap.test.nestedtargetproperties._target.WaterQualityReportDto; import org.mapstruct.ap.test.nestedtargetproperties.source.Fish; import org.mapstruct.ap.test.nestedtargetproperties.source.FishTank; +import org.mapstruct.ap.test.nestedtargetproperties.source.Interior; +import org.mapstruct.ap.test.nestedtargetproperties.source.MaterialType; +import org.mapstruct.ap.test.nestedtargetproperties.source.Ornament; import org.mapstruct.ap.test.nestedtargetproperties.source.WaterPlant; +import org.mapstruct.ap.test.nestedtargetproperties.source.WaterQuality; +import org.mapstruct.ap.test.nestedtargetproperties.source.WaterQualityReport; import org.mapstruct.ap.testutil.WithClasses; import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner; import org.mapstruct.ap.testutil.runner.WithSingleCompiler; @@ -39,9 +50,20 @@ FishDto.class, FishTankDto.class, WaterPlantDto.class, + MaterialDto.class, + MaterialTypeDto.class, + OrnamentDto.class, + WaterQualityDto.class, + WaterQualityReportDto.class, + WaterQualityOrganisationDto.class, Fish.class, FishTank.class, WaterPlant.class, + MaterialType.class, + Interior.class, + Ornament.class, + WaterQuality.class, + WaterQualityReport.class, FishTankMapper.class }) @RunWith(AnnotationProcessorTestRunner.class) @@ -52,26 +74,63 @@ public class NestedTargetPropertiesTest1 { public void automappingAndTargetNestingDemonstrator() { FishTank source = new FishTank(); - source.setName( "MyLittleFishTank" ); + Fish fish = new Fish(); fish.setType( "Carp" ); + WaterPlant waterplant = new WaterPlant(); waterplant.setKind( "Water Hyacinth" ); + + Interior interior = new Interior(); + interior.setDesigner( "MrVeryFamous" ); + Ornament ornament = new Ornament(); + ornament.setType( "castle" ); + interior.setOrnament( ornament ); + + WaterQuality quality = new WaterQuality(); + WaterQualityReport report = new WaterQualityReport(); + report.setVerdict( "PASSED" ); + report.setOrganisationName( "ACME" ); + quality.setReport( report ); + + source.setName( "MyLittleFishTank" ); source.setFish( fish ); source.setPlant( waterplant ); + source.setInterior( interior ); + FishTankDto target = FishTankMapper.INSTANCE.map( source ); - // the nested property generates a method fishTankToFishDto(FishTank fishTank, FishDto mappingTarget) - // when name based mapping continues MapStruct searches for a property called `name` in fishTank (type - // 'FishTank'. If it is there, it should most cerntainly not be mapped to a mappingTarget of type 'FishDto' + assertThat( target.getName() ).isEqualTo( source.getName() ); + assertThat( target.getFish() ).isNotNull(); - assertThat( target.getFish().getKind() ).isEqualTo( "Carp" ); + assertThat( target.getFish().getKind() ).isEqualTo( source.getFish().getType() ); assertThat( target.getFish().getName() ).isNull(); // automapping takes care of mapping property "waterPlant". assertThat( target.getPlant() ).isNotNull(); - assertThat( target.getPlant().getKind() ).isEqualTo( "Water Hyacinth" ); + assertThat( target.getPlant().getKind() ).isEqualTo( source.getPlant().getKind() ); + + // ornament (nested asymetric source) + assertThat( target.getOrnament() ).isNotNull(); + assertThat( target.getOrnament().getType() ).isEqualTo( source.getInterior().getOrnament().getType() ); + + // material (nested asymetric target) + assertThat( target.getMaterial() ).isNotNull(); + assertThat( target.getMaterial().getManufacturer() ).isNull(); + assertThat( target.getMaterial().getMaterialType() ).isNotNull(); + assertThat( target.getMaterial().getMaterialType().getType() ).isEqualTo( source.getMaterial().getType() ); + + // first symetric then asymetric + assertThat( target.getQuality() ).isNotNull(); + assertThat( target.getQuality().getReport() ).isNotNull(); + assertThat( target.getQuality().getReport().getVerdict() ) + .isEqualTo( source.getQuality().getReport().getVerdict() ); + assertThat( target.getQuality().getReport().getOrganisation() ).isNotNull(); + assertThat( target.getQuality().getReport().getOrganisation().getName() ) + .isEqualTo( source.getQuality().getReport().getOrganisationName() ); + assertThat( target.getQuality().getReport().getOrganisation().getName() ).isNull(); + } } diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/FishTankDto.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/FishTankDto.java index 081b567bba..253abf036a 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/FishTankDto.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/FishTankDto.java @@ -26,6 +26,10 @@ public class FishTankDto { private FishDto fish; private WaterPlantDto plant; + private String name; + private MaterialDto material; + private OrnamentDto ornament; + private WaterQualityDto quality; public FishDto getFish() { return fish; @@ -43,4 +47,36 @@ public void setPlant(WaterPlantDto plant) { this.plant = plant; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MaterialDto getMaterial() { + return material; + } + + public void setMaterial(MaterialDto material) { + this.material = material; + } + + public OrnamentDto getOrnament() { + return ornament; + } + + public void setOrnament(OrnamentDto ornament) { + this.ornament = ornament; + } + + public WaterQualityDto getQuality() { + return quality; + } + + public void setQuality(WaterQualityDto quality) { + this.quality = quality; + } + } diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialDto.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialDto.java new file mode 100644 index 0000000000..9a9a8c4eed --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialDto.java @@ -0,0 +1,46 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties._target; + +/** + * + * @author Sjaak Derksen + */ +public class MaterialDto { + + private String manufacturer; + private MaterialTypeDto materialType; + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public MaterialTypeDto getMaterialType() { + return materialType; + } + + public void setMaterialType(MaterialTypeDto materialType) { + this.materialType = materialType; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialTypeDto.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialTypeDto.java new file mode 100644 index 0000000000..eb7972a839 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/MaterialTypeDto.java @@ -0,0 +1,37 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties._target; + +/** + * + * @author Sjaak Derksen + */ +public class MaterialTypeDto { + + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/OrnamentDto.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/OrnamentDto.java new file mode 100644 index 0000000000..11d24c2254 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/OrnamentDto.java @@ -0,0 +1,37 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties._target; + +/** + * + * @author Sjaak Derksen + */ +public class OrnamentDto { + + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityDto.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityDto.java new file mode 100644 index 0000000000..affd73e1be --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityDto.java @@ -0,0 +1,37 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties._target; + +/** + * + * @author Sjaak Derksen + */ +public class WaterQualityDto { + + private WaterQualityReportDto report; + + public WaterQualityReportDto getReport() { + return report; + } + + public void setReport(WaterQualityReportDto report) { + this.report = report; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityOrganisationDto.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityOrganisationDto.java new file mode 100644 index 0000000000..3852009dc9 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityOrganisationDto.java @@ -0,0 +1,46 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties._target; + +/** + * + * @author Sjaak Derksen + */ +public class WaterQualityOrganisationDto { + + private String name; + private String approval; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getApproval() { + return approval; + } + + public void setApproval(String approval) { + this.approval = approval; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityReportDto.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityReportDto.java new file mode 100644 index 0000000000..cd55c287f4 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterQualityReportDto.java @@ -0,0 +1,46 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties._target; + +/** + * + * @author Sjaak Derksen + */ +public class WaterQualityReportDto { + + private WaterQualityOrganisationDto organisation; + private String verdict; + + public WaterQualityOrganisationDto getOrganisation() { + return organisation; + } + + public void setOrganisation(WaterQualityOrganisationDto organisation) { + this.organisation = organisation; + } + + public String getVerdict() { + return verdict; + } + + public void setVerdict(String verdict) { + this.verdict = verdict; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/FishTank.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/FishTank.java index d250898c41..469d5ce149 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/FishTank.java +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/FishTank.java @@ -27,6 +27,9 @@ public class FishTank { private Fish fish; private WaterPlant plant; private String name; + private MaterialType material; + private Interior interior; + private WaterQuality quality; public Fish getFish() { return fish; @@ -52,4 +55,28 @@ public void setName(String name) { this.name = name; } + public MaterialType getMaterial() { + return material; + } + + public void setMaterial(MaterialType material) { + this.material = material; + } + + public Interior getInterior() { + return interior; + } + + public void setInterior(Interior interior) { + this.interior = interior; + } + + public WaterQuality getQuality() { + return quality; + } + + public void setQuality(WaterQuality quality) { + this.quality = quality; + } + } diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Interior.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Interior.java new file mode 100644 index 0000000000..34453e4036 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Interior.java @@ -0,0 +1,45 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties.source; + +/** + * + * @author Sjaak Derksen + */ +public class Interior { + + private String designer; + private Ornament ornament; + + public String getDesigner() { + return designer; + } + + public void setDesigner(String designer) { + this.designer = designer; + } + + public Ornament getOrnament() { + return ornament; + } + + public void setOrnament(Ornament ornament) { + this.ornament = ornament; + } +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/MaterialType.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/MaterialType.java new file mode 100644 index 0000000000..baec5846dd --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/MaterialType.java @@ -0,0 +1,37 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties.source; + +/** + * + * @author Sjaak Derksen + */ +public class MaterialType { + + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Ornament.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Ornament.java new file mode 100644 index 0000000000..51a8dba8aa --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Ornament.java @@ -0,0 +1,37 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties.source; + +/** + * + * @author Sjaak Derksen + */ +public class Ornament { + + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQuality.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQuality.java new file mode 100644 index 0000000000..691d3ef314 --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQuality.java @@ -0,0 +1,37 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties.source; + +/** + * + * @author Sjaak Derksen + */ +public class WaterQuality { + + private WaterQualityReport report; + + public WaterQualityReport getReport() { + return report; + } + + public void setReport(WaterQualityReport report) { + this.report = report; + } + +} diff --git a/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQualityReport.java b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQualityReport.java new file mode 100644 index 0000000000..6af97e875a --- /dev/null +++ b/processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterQualityReport.java @@ -0,0 +1,46 @@ +/** + * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) + * and/or other contributors as indicated by the @authors tag. See the + * copyright.txt file in the distribution for a full listing of all + * contributors. + * + * 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 org.mapstruct.ap.test.nestedtargetproperties.source; + +/** + * + * @author Sjaak Derksen + */ +public class WaterQualityReport { + + private String organisationName; + private String verdict; + + public String getOrganisationName() { + return organisationName; + } + + public void setOrganisationName(String organisationName) { + this.organisationName = organisationName; + } + + public String getVerdict() { + return verdict; + } + + public void setVerdict(String verdict) { + this.verdict = verdict; + } + +}