From a28ba3d065541ff7453767cac86c14f6871106cb Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 27 Apr 2014 13:17:05 +0000 Subject: [PATCH] [MPLUGIN-262] prepare more precise checks of help output git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1590389 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/it/help-basic/expected-help.txt | 20 +++++++++++++++++++ .../src/it/help-basic/verify.groovy | 10 ++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 maven-plugin-plugin/src/it/help-basic/expected-help.txt diff --git a/maven-plugin-plugin/src/it/help-basic/expected-help.txt b/maven-plugin-plugin/src/it/help-basic/expected-help.txt new file mode 100644 index 0000000..de82804 --- /dev/null +++ b/maven-plugin-plugin/src/it/help-basic/expected-help.txt @@ -0,0 +1,20 @@ +[INFO] help 1.0-SNAPSHOT + Tests generation and compilation of the help mojo. + +help:test + MOJO-DESCRIPTION. Some 'quotation' marks and backslashes '\\', some important + javadoc + and an inline link to AnotherMojo. + + Available parameters: + + defaultParam + This parameter uses 'quotation' marks and backslashes '\\' in its + description. Those characters must be escaped in Java string literals. + + deprecatedParam + This parameter is deprecated. + + undocumentedParam + + Required: Yes diff --git a/maven-plugin-plugin/src/it/help-basic/verify.groovy b/maven-plugin-plugin/src/it/help-basic/verify.groovy index 635f9a6..9808379 100644 --- a/maven-plugin-plugin/src/it/help-basic/verify.groovy +++ b/maven-plugin-plugin/src/it/help-basic/verify.groovy @@ -17,10 +17,12 @@ * under the License. */ -log = new File( basedir, "help.log" ).text; -log = log.substring( log.indexOf( "[INFO] help 1.0-SNAPSHOT" ) ) -log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ) +expected = new File( basedir, "expected-help.txt" ).text.trim(); -println "$log"; +log = new File( basedir, "help.log" ).text; +log = log.substring( log.indexOf( "[INFO] help 1.0-SNAPSHOT" ) ); +log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ).trim(); + +assert log == expected; return true; \ No newline at end of file