Author: bayard Date: Thu Feb 19 06:43:49 2009 New Revision: 745755 URL: http://svn.apache.org/viewvc?rev=745755&view=rev Log: Fixing the previous commit so the right variable is used. There's no reason to share the options class between methods, so deleting the setUp()
Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI162Test.java Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI162Test.java URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI162Test.java?rev=745755&r1=745754&r2=745755&view=diff ============================================================================== --- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI162Test.java (original) +++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI162Test.java Thu Feb 19 06:43:49 2009 @@ -32,14 +32,9 @@ public class BugCLI162Test extends TestCase { - private Options options; - - public void setUp() { - options = new Options(); - options.addOption("h", "help", false, "This is a looooong description"); - } - public void testInfiniteLoop() { + Options options = new Options(); + options.addOption("h", "help", false, "This is a looooong description"); HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(20); formatter.printHelp("app", options); // used to hang & crash @@ -229,7 +224,7 @@ "Converts the JDBC file in the first argument to an SMFD file specified in the second argument."); option.setArgs(2); commandLineOptions.addOption(option); - new HelpFormatter().printHelp(this.getClass().getName(), options); + new HelpFormatter().printHelp(this.getClass().getName(), commandLineOptions); } }