diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java index f8be033ee..48904c23d 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3827PluginConfigTest.java @@ -19,7 +19,6 @@ * under the License. */ -import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; import java.io.File; @@ -95,6 +94,7 @@ public void testitMNG3827() assertEquals( "field", props.getProperty( "beanParam.fieldParam" ) ); assertEquals( "setter", props.getProperty( "beanParam.setterParam" ) ); + assertEquals( "false", props.getProperty( "beanParam.setCalled" ) ); assertEquals( "true", props.getProperty( "beanParam.setterCalled" ) ); assertEquals( "4", props.getProperty( "domParam.children" ) ); diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java index 7a7c6ee1d..4c97e421b 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3864PerExecPluginConfigTest.java @@ -19,7 +19,6 @@ * under the License. */ -import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; import java.io.File; @@ -95,6 +94,7 @@ public void testitMNG3864() assertEquals( "field", props.getProperty( "beanParam.fieldParam" ) ); assertEquals( "setter", props.getProperty( "beanParam.setterParam" ) ); + assertEquals( "false", props.getProperty( "beanParam.setCalled" ) ); assertEquals( "true", props.getProperty( "beanParam.setterCalled" ) ); assertEquals( "4", props.getProperty( "domParam.children" ) ); diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java index 9282b1406..c6507c969 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5013ConfigureParamBeanFromScalarValueTest.java @@ -19,7 +19,6 @@ * under the License. */ -import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; import java.io.File; @@ -54,7 +53,8 @@ public void testit() Properties props = verifier.loadProperties( "target/config.properties" ); assertEquals( "PASSED", props.getProperty( "beanParam.fieldParam" ) ); - assertEquals( "true", props.getProperty( "beanParam.setterCalled" ) ); + assertEquals( "true", props.getProperty( "beanParam.setCalled" ) ); + assertEquals( "false", props.getProperty( "beanParam.setterCalled" ) ); } } diff --git a/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/Bean.java b/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/Bean.java index 8529d3a8d..668d4adc4 100644 --- a/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/Bean.java +++ b/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/Bean.java @@ -32,12 +32,20 @@ public class Bean String setterParam; + /** + * default method of bean was called + */ + boolean setCalled; + + /** + * setter method of ben was called + */ boolean setterCalled; public void set( String value ) { fieldParam = value; - setterCalled = true; + setCalled = true; } public void setSetterParam( String value ) @@ -49,7 +57,7 @@ public void setSetterParam( String value ) public String toString() { return getClass().getName() + "[fieldParam=" + fieldParam + ", setterParam=" + setterParam - + ", setterCalled=" + setterCalled + "]"; + + ", setterCalled=" + setterCalled + ", setCalled=" + setCalled + "]"; } } diff --git a/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/ConfigMojo.java b/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/ConfigMojo.java index 53d450e8c..6f75e34ec 100644 --- a/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/ConfigMojo.java +++ b/core-it-support/core-it-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/ConfigMojo.java @@ -246,6 +246,7 @@ public class ConfigMojo * * @parameter */ + private Bean beanParam; /** @@ -335,6 +336,7 @@ private void dumpConfiguration( Properties props ) { PropertiesUtil.serialize( props, "beanParam.fieldParam", beanParam.fieldParam ); PropertiesUtil.serialize( props, "beanParam.setterParam", beanParam.setterParam ); + PropertiesUtil.serialize( props, "beanParam.setCalled", beanParam.setCalled ); PropertiesUtil.serialize( props, "beanParam.setterCalled", beanParam.setterCalled ); } }