diff --git a/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java b/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java index ea0a64f..9400bba 100644 --- a/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java +++ b/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java @@ -31,6 +31,7 @@ import org.apache.maven.tools.plugin.PluginToolsRequest; 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 JavaMojoDescriptorExtractorTest List 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 JavaMojoDescriptorExtractorTest 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 ); } } diff --git a/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml b/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml index e432db8..4b13937 100644 --- a/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml +++ b/maven-plugin-tools-java/src/test/resources/source/plugin-expected.xml @@ -29,31 +29,6 @@ false true - - ideaTwo - Create an IDEA project file from a Maven project. - compile - false - true - false - false - false - true - source.JavaExtractorTestTwo - java - per-lookup - once-per-session - false - - - project - java.lang.String[] - true - true - Maven project used to generate IDEA project files. - - - ideaOne Create an IDEA project file from a Maven project. @@ -79,6 +54,31 @@ + + ideaTwo + Create an IDEA project file from a Maven project. + compile + false + true + false + false + false + true + source.JavaExtractorTestTwo + java + per-lookup + once-per-session + false + + + project + java.lang.String[] + true + true + Maven project used to generate IDEA project files. + + + \ No newline at end of file