commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schley Andrew Kutz <>
Subject [cli] C# port passes 80/81 unit tests / Bug found in
Date Sun, 27 Apr 2008 21:15:57 GMT
Hash: SHA1

The C# is almost 100% compatible with real deal, except for 1  
remaining unit test. The reason the port cannot pass this test is  
because there is a bug in - ProcessProperties. The  
relevant code bits are:

		if (opt.hasArg())
                     if ((opt.getValues() == null)
                         || (opt.getValues().length == 0))
                         catch (RuntimeException exp)
                             // if we cannot add the value don't worry  
about it
                 else if (!("yes".equalsIgnoreCase(value)
                            || "true".equalsIgnoreCase(value)
                            || "1".equalsIgnoreCase(value)))
                     // if the value is not yes, true or 1 then don't  
add the
                     // option to the CommandLine


Okay. Here is the problem. The 'break' precludes any property from  
being reached that is AFTER a property that is not set to yes|true|1.  
I changed the break to a continue, but that breaks another assertion  
in the same unit test. If a continue is used then when a property is  
set to false|0|no, but has arguments, such as 'e' in  
ValueTest::testPropertyOptionFlags(), it skips the 'else if' clause  
and gets added as an option, thus breaking the assertion that 'e'  
should not exist as an option. I fiddled with the bits some more,  
duplicating the yes|true|1 test inside the opt.hasArg() scope, but  
that breaks properties that have arguments which are not a boolean,  
such as the "hide" "seek" bit in testPropertyOptionSingularValue().

I really want this to work as when it does the C# will have passed ALL  
of the unit tests.

Thank you for your help!

- --
- -a

"condensing fact from the vapor of nuance"

gpg pubkey:
lostcreations ca:

Version: GnuPG v1.4.7 (Darwin)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message