Hi Henry,
Henri Yandell wrote:
> Are these new errors Jörg, or do they happen with 1.1?
Hardly, both tests did not exist yet in 1.1 ;-)
OptionGroupTest.toString fails, because the option group is based on a
HashMap which is printed in arbitrary order. Since the options are mutually
exclusive, this is fine. I can commit an updated test at any time.
However, HelpFormatterTest.printOptionGroup is different and gives me really
a headache. The test fails when I run it using Maven. In Eclipse (also with
IBM JDK 1.6) it does not fail.
Have a look at the test code:
========== %< =============
OptionGroup group = new OptionGroup();
group.addOption(OptionBuilder.create("a"));
group.addOption(OptionBuilder.create("b"));
group.addOption(OptionBuilder.create("c"));
Options options = new Options();
options.addOptionGroup(group);
StringWriter out = new StringWriter();
HelpFormatter formatter = new HelpFormatter();
formatter.printUsage(new PrintWriter(out), 80, "app", options);
System.out.println(out.toString());
assertEquals("usage: app [-a | -b | -c]" + EOL, out.toString());
========== %< =============
I have no idea, what causes the combo Maven/IBM JDK 6 to render a String
of "usage: app [-a <arg>| -b | -c]" here. It simply does not make sence,
but it is reproducible on every run.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]