Author: hboutemy
Date: Sat Dec 10 22:40:00 2011
New Revision: 1212910
URL: http://svn.apache.org/viewvc?rev=1212910&view=rev
Log:
fixed comparison reprodicibility problems against plugin-expected.xml by
sorting mojos and parameters lists
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java?rev=1212910&r1=1212909&r2=1212910&view=diff
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
(original)
+++
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
Sat Dec 10 22:40:00 2011
@@ -31,6 +31,7 @@ import org.apache.maven.tools.plugin.Plu
import org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor;
import org.apache.maven.tools.plugin.generator.Generator;
import org.apache.maven.tools.plugin.generator.PluginDescriptorGenerator;
+import org.apache.maven.tools.plugin.util.PluginUtils;
import org.codehaus.plexus.component.repository.ComponentDependency;
import org.codehaus.plexus.util.FileUtils;
import org.custommonkey.xmlunit.Diff;
@@ -98,8 +99,14 @@ public class JavaMojoDescriptorExtractor
List<MojoDescriptor> mojoDescriptors = extractor.execute( request );
+ // to ensure order against plugin-expected.xml
+ PluginUtils.sortMojos( mojoDescriptors );
+
for ( MojoDescriptor mojoDescriptor : mojoDescriptors )
{
+ // to ensure order against plugin-expected.xml
+ PluginUtils.sortMojoParameters( mojoDescriptor.getParameters() );
+
request.getPluginDescriptor().addMojo( mojoDescriptor );
}
@@ -130,8 +137,7 @@ public class JavaMojoDescriptorExtractor
if ( !diff.identical() )
{
- // elements order is not the same on every machine, cause problems
with lists...
- //fail( "generated plugin.xml is not identital as
plugin-expected.xml for " + directory + ": " + diff );
+ fail( "generated plugin.xml is not identical as
plugin-expected.xml for " + directory + ": " + diff );
}
}
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml?rev=1212910&r1=1212909&r2=1212910&view=diff
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml
(original)
+++
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml
Sat Dec 10 22:40:00 2011
@@ -30,16 +30,16 @@
<inheritedByDefault>true</inheritedByDefault>
<mojos>
<mojo>
- <goal>ideaTwo</goal>
+ <goal>ideaOne</goal>
<description>Create an IDEA project file from a Maven
project.</description>
- <requiresDependencyResolution>compile</requiresDependencyResolution>
+ <requiresDependencyResolution>runtime</requiresDependencyResolution>
<requiresDirectInvocation>false</requiresDirectInvocation>
<requiresProject>true</requiresProject>
<requiresReports>false</requiresReports>
<aggregator>false</aggregator>
<requiresOnline>false</requiresOnline>
<inheritedByDefault>true</inheritedByDefault>
- <implementation>source.JavaExtractorTestTwo</implementation>
+ <implementation>source.JavaExtractorTestOne</implementation>
<language>java</language>
<instantiationStrategy>per-lookup</instantiationStrategy>
<executionStrategy>once-per-session</executionStrategy>
@@ -55,16 +55,16 @@
</parameters>
</mojo>
<mojo>
- <goal>ideaOne</goal>
+ <goal>ideaTwo</goal>
<description>Create an IDEA project file from a Maven
project.</description>
- <requiresDependencyResolution>runtime</requiresDependencyResolution>
+ <requiresDependencyResolution>compile</requiresDependencyResolution>
<requiresDirectInvocation>false</requiresDirectInvocation>
<requiresProject>true</requiresProject>
<requiresReports>false</requiresReports>
<aggregator>false</aggregator>
<requiresOnline>false</requiresOnline>
<inheritedByDefault>true</inheritedByDefault>
- <implementation>source.JavaExtractorTestOne</implementation>
+ <implementation>source.JavaExtractorTestTwo</implementation>
<language>java</language>
<instantiationStrategy>per-lookup</instantiationStrategy>
<executionStrategy>once-per-session</executionStrategy>