commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r661607 - /commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java
Date Fri, 30 May 2008 09:11:57 GMT
Author: ebourg
Date: Fri May 30 02:11:57 2008
New Revision: 661607

URL: http://svn.apache.org/viewvc?rev=661607&view=rev
Log:
Added a test for Options.toString()

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

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java?rev=661607&r1=661606&r2=661607&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java Fri
May 30 02:11:57 2008
@@ -97,4 +97,15 @@
         }
     }
 
+    public void testToString() {
+        Options options = new Options();
+        options.addOption("f", "foo", true, "Foo");
+        options.addOption("b", "bar", false, "Bar");
+
+        String s = options.toString();
+        assertNotNull("null string returned", s);
+        assertTrue("foo option missing", s.toLowerCase().indexOf("foo") != -1);
+        assertTrue("bar option missing", s.toLowerCase().indexOf("bar") != -1);
+    }
+
 }



Mime
View raw message