Index: maven-commandline-plugin/src/test/org/codelutin/util/GenerateTest.java diff -u maven-commandline-plugin/src/test/org/codelutin/util/GenerateTest.java:1.1 maven-commandline-plugin/src/test/org/codelutin/util/GenerateTest.java:1.2 --- maven-commandline-plugin/src/test/org/codelutin/util/GenerateTest.java:1.1 Wed Dec 12 21:03:15 2007 +++ maven-commandline-plugin/src/test/org/codelutin/util/GenerateTest.java Fri Dec 14 19:06:51 2007 @@ -1,3 +1,22 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin, +* Benjamin Poussin, Tony Chemit +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* ##% */ package org.codelutin.util; import org.codelutin.util.OptionParserAnnotationHelper.ApplicationA; @@ -22,12 +41,6 @@ private static final String PROPERTIES_FILE_PATH = HERE + "/src/test/testOptions.properties"; private static final String RST_FILE_NAME = HERE + "/target/gen/site/fr/rst/GenerateTest.rst"; - @Override - protected void setUp() throws Exception { - super.setUp(); - //ParserUtil.initI18n(); - } - public void testLaunch() throws Exception { Generate goal = new Generate(); @@ -37,47 +50,13 @@ goal.projectName = PROJECT_NAME; goal.out = new File(OUT_PATH); goal.rstFilePath = new File(RST_FILE_NAME); - goal.generateOptionImplementation = true; + goal.generateOptions = true; goal.typeSource = "properties"; goal.showErrors = true; + goal.force= true; + //goal.backupClass= true; goal.execute(); - //assertNotNull(goal.parser); - //todo make asserts on parser - - } - - public void estLaunchWithDetails() throws Exception { - - Generate goal = new Generate(); - - goal.source = new File(PROPERTIES_FILE_PATH); - goal.parserFullyQualifiedName = PARSER_NAME + "_details"; - goal.projectName = PROJECT_NAME + "_details"; - goal.out = new File(OUT_PATH); - goal.rstFilePath = new File(RST_FILE_NAME + "_details"); - goal.execute(); - - //assertNotNull(goal.parser); - //todo make asserts on parser - - } - - public void estLaunchWithDetailsAndErrors() throws Exception { - - Generate goal = new Generate(); - - goal.source = new File(PROPERTIES_FILE_PATH); - goal.parserFullyQualifiedName = PARSER_NAME + "_detailsAndErrors"; - goal.projectName = PROJECT_NAME + "_detailsAndErrors"; - goal.showErrors = true; - goal.generateOptionImplementation= true; - goal.out = new File(OUT_PATH); - goal.rstFilePath = new File(RST_FILE_NAME + "_detailsAndErrors"); - goal.execute(); - - //assertNotNull(goal.parser); - //todo make asserts on parser } public void testReloadParser() throws Exception { @@ -99,7 +78,7 @@ parser.doParse("argument00"); - assertFalse(parser.hasFailed()); + assertTrue(parser.hasFailed()); } public static OptionParser newParser(String className, ClassLoader loader) { Index: maven-commandline-plugin/src/test/org/codelutin/util/ParserTest.java diff -u maven-commandline-plugin/src/test/org/codelutin/util/ParserTest.java:1.3 maven-commandline-plugin/src/test/org/codelutin/util/ParserTest.java:1.4 --- maven-commandline-plugin/src/test/org/codelutin/util/ParserTest.java:1.3 Wed Dec 12 22:12:51 2007 +++ maven-commandline-plugin/src/test/org/codelutin/util/ParserTest.java Fri Dec 14 19:06:52 2007 @@ -1,3 +1,22 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin, +* Benjamin Poussin, Tony Chemit +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* ##% */ package org.codelutin.util; import org.apache.maven.plugin.MojoExecutionException; @@ -93,9 +112,10 @@ goal.parserFullyQualifiedName = PARSER_NAME; goal.projectName = PROJECT_NAME; goal.out = new File(OUT_PATH); - goal.generateOptionImplementation = true; + goal.generateOptions = true; goal.typeSource = "properties"; goal.showErrors = true; + goal.force= true; goal.execute(); parser = newParser(PARSER_NAME, ParserTest.class.getClassLoader()); }