commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r661665 - /commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java
Date Fri, 30 May 2008 11:47:30 GMT
Author: ebourg
Date: Fri May 30 04:47:29 2008
New Revision: 661665

URL: http://svn.apache.org/viewvc?rev=661665&view=rev
Log:
Test coverage for OptionGroup.toString()

Modified:
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java?rev=661665&r1=661664&r2=661665&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java
Fri May 30 04:47:29 2008
@@ -197,4 +197,19 @@
         assertTrue("Confirm --import is set", cl2.hasOption("import"));
     }
 
+    public void testToString()
+    {
+        OptionGroup group1 = new OptionGroup();
+        group1.addOption(new Option(null, "foo", false, "Foo"));
+        group1.addOption(new Option(null, "bar", false, "Bar"));
+
+        assertEquals("[--foo Foo, --bar Bar]", group1.toString());
+
+        OptionGroup group2 = new OptionGroup();
+        group2.addOption(new Option("f", "foo", false, "Foo"));
+        group2.addOption(new Option("b", "bar", false, "Bar"));
+
+        assertEquals("[-f Foo, -b Bar]", group2.toString());
+    }
+
 }



Mime
View raw message