Author: hboutemy Date: Mon May 28 09:39:00 2012 New Revision: 1343175 URL: http://svn.apache.org/viewvc?rev=1343175&view=rev Log: extended IT for javadoc tags
Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java (with props) maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java (with props) Removed: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/verify.groovy Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java?rev=1343175&view=auto ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java (added) +++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java Mon May 28 09:39:00 2012 @@ -0,0 +1,71 @@ +package org.apache.maven.plugin.coreit; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.project.MavenProjectHelper; + +/** + * Checks maximum annotations with non-default values. + * + * @goal maximal + * @aggregator + * @configurator configurator-hint + * @execute phase="compile" + * @executionStrategy always + * @inheritByDefault false + * @instantiationStrategy singleton + * @phase package + * @requiresDependencyResolution compile + * @requiresDependencyCollection test + * @requiresDirectInvocation true + * @requiresOnline true + * @requiresProject false + * @requiresReports true + * @threadSafe + * @since since-text + * @deprecated deprecated-text + */ +public class Maximal + extends AbstractMojo +{ + /** + * Parameter description. + * + * @parameter alias="myAlias" implementation="my.implementation" property="aProperty" default-value="${anExpression}" + * @readonly + * @required + * @since since-text + * @deprecated deprecated-text + */ + private String param; + + /** + * @component role="org.apache.maven.project.MavenProjectHelper" roleHint="test" + * @since since-text + * @deprecated deprecated-text + */ + private Object projectHelper; + + public void execute() + { + } + +} Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Maximal.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java?rev=1343175&view=auto ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java (added) +++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java Mon May 28 09:39:00 2012 @@ -0,0 +1,46 @@ +package org.apache.maven.plugin.coreit; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.project.MavenProjectHelper; + +// minimum annotations => default values +/** + * @goal minimal + */ +public class Minimal + extends AbstractMojo +{ + /** + * @parameter + */ + private String param; + + /** + * @component + */ + private MavenProjectHelper projectHelper; + + public void execute() + { + } + +} Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/src/main/java/org/apache/maven/plugin/coreit/Minimal.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/verify.groovy?rev=1343175&r1=1343174&r2=1343175&view=diff ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/verify.groovy (original) +++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/java-basic/verify.groovy Mon May 28 09:39:00 2012 @@ -132,9 +132,76 @@ assert parameter.required.text() == 'tru assert parameter.editable.text() == 'true' assert parameter.description.text() == '' -mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "second"}[0] +// check default values +mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "minimal"}[0] -assert mojo.requiresDependencyCollection.text() == 'compile' +assert mojo.goal.text() == 'minimal' +assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.Minimal' +assert mojo.language.text() == 'java' +assert mojo.description.text() == '' +assert mojo.deprecated.text() == '' +assert mojo.requiresDependencyResolution.text() == '' +assert mojo.requiresDependencyCollection.text() == '' +assert mojo.requiresProject.text() == 'true' +assert mojo.requiresOnline.text() == 'false' +assert mojo.requiresDirectInvocation.text() == 'false' +assert mojo.requiresReports.text() == 'false' +assert mojo.aggregator.text() == 'false' +assert mojo.threadSafe.text() == 'false' +assert mojo.phase.text() == '' +assert mojo.executePhase.text() == '' +assert mojo.executeLifecycle.text() == '' +assert mojo.executionStrategy.text() == 'once-per-session' +assert mojo.inheritedByDefault.text() == 'true' +assert mojo.instantiationStrategy.text() == 'per-lookup' + +parameter = mojo.parameters.parameter.findAll{ it.name.text() == "param" }[0] +assert parameter.name.text() == 'param' +assert parameter.alias.text() == '' +assert parameter.type.text() == 'java.lang.String' +assert parameter.deprecated.text() == '' +assert parameter.required.text() == 'false' +assert parameter.editable.text() == 'true' +assert parameter.description.text() == '' + +def requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "projectHelper" }[0] +assert requirement.role.text() == 'org.apache.maven.project.MavenProjectHelper' + +// check values set by every annotation +mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "maximal"}[0] + +assert mojo.goal.text() == 'maximal' +assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.Maximal' +assert mojo.language.text() == 'java' +assert mojo.description.text() == 'Checks maximum annotations with non-default values.' +assert mojo.deprecated.text() == 'deprecated-text' +assert mojo.requiresDependencyResolution.text() == 'compile' +assert mojo.requiresDependencyCollection.text() == 'test' +assert mojo.requiresProject.text() == 'false' +assert mojo.requiresOnline.text() == 'true' +assert mojo.requiresDirectInvocation.text() == 'true' +assert mojo.requiresReports.text() == 'true' +assert mojo.aggregator.text() == 'true' +assert mojo.configurator.text() == 'configurator-hint' assert mojo.threadSafe.text() == 'true' +assert mojo.phase.text() == 'package' +assert mojo.executePhase.text() == 'compile' +assert mojo.executeLifecycle.text() == '' +assert mojo.executionStrategy.text() == 'always' +assert mojo.inheritedByDefault.text() == 'false' +assert mojo.instantiationStrategy.text() == 'singleton' + +parameter = mojo.parameters.parameter.findAll{ it.name.text() == "param" }[0] +assert parameter.name.text() == 'param' +assert parameter.alias.text() == 'myAlias' +assert parameter.type.text() == 'java.lang.String' +assert parameter.since.text() == 'since-text' +assert parameter.deprecated.text() == 'deprecated-text' +assert parameter.required.text() == 'true' +assert parameter.editable.text() == 'false' +assert parameter.description.text() == 'Parameter description.' + +requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "projectHelper" }[0] +assert requirement.role.text() == 'org.apache.maven.project.MavenProjectHelper' return true;