Index: maven-commandline-plugin/src/test/org/codelutin/option/generate/GenerateJavaTest.java diff -u /dev/null maven-commandline-plugin/src/test/org/codelutin/option/generate/GenerateJavaTest.java:1.1 --- /dev/null Sun Dec 30 23:34:16 2007 +++ maven-commandline-plugin/src/test/org/codelutin/option/generate/GenerateJavaTest.java Sun Dec 30 23:34:11 2007 @@ -0,0 +1,84 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin, +* +* 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.option.generate; + +import junit.framework.TestCase; +import org.codelutin.option.Config; +import org.codelutin.option.Option; +import org.codelutin.option.OptionAction; +import org.codelutin.option.OptionParser; + +import java.io.File; + +/** + * DefinitionParser Tester. + * + * @author chemit + * @version 1.0 + * @since
11/16/2007+ */ +public class GenerateJavaTest extends TestCase { + + private static final String HERE = new File("").getAbsolutePath(); + private static final String OUT_PATH = new File(HERE, "target/gen/java").getAbsolutePath(); + + JavaGeneratorGoal goal; + + public void testGenerate() throws Exception { + goal = new JavaGeneratorGoal("Test", HERE + "/src/target/gen/i18n", false); + goal.source = new File(HERE + "/src/test/testOptions.properties"); + goal.parserPackageName = "org.codelutin.option.test.init"; + goal.optionPackageName = "org.codelutin.option.test.init"; + goal.configPackageName = "org.codelutin.option.test.init"; + goal.actionPackageName = "org.codelutin.option.test.init"; + goal.parserSimpleName = "TestOptionParser"; + goal.optionSimpleName = "Option"; + goal.configSimpleName = "Config"; + goal.actionSimpleName = "AbstractOptionAction"; + goal.parserSuperClass = OptionParser.class.getName(); + goal.optionSuperClass = Option.class.getName(); + goal.actionSuperClass = OptionAction.class.getName(); + goal.configSuperClass = Config.class.getName(); + goal.out = new File(OUT_PATH); + goal.typeSource = "properties"; + goal.showErrors = true; + goal.execute(); + } + + public void testGenerate2() throws Exception { + goal = new JavaGeneratorGoal("Test2", HERE + "/src/target/gen/i18n", false); + goal.source = new File(HERE + "/src/test/testOptions2.properties"); + goal.parserPackageName = "org.codelutin.option.test2.init"; + goal.optionPackageName = "org.codelutin.option.test2.init.option"; + goal.configPackageName = "org.codelutin.option.test2.init.config"; + goal.actionPackageName = "org.codelutin.option.test2.init.action"; + goal.parserSimpleName = "Test2OptionParser"; + goal.optionSimpleName = "Option"; + goal.configSimpleName = "Config"; + goal.actionSimpleName = "AbstractOptionAction"; + goal.parserSuperClass = OptionParser.class.getName(); + goal.optionSuperClass = Option.class.getName(); + goal.actionSuperClass = OptionAction.class.getName(); + goal.configSuperClass = Config.class.getName(); + goal.out = new File(OUT_PATH); + goal.typeSource = "properties"; + goal.showErrors = true; + goal.execute(); + } + +}