commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r748914 - /commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java
Date Sat, 28 Feb 2009 20:02:51 GMT
Author: bayard
Date: Sat Feb 28 20:02:51 2009
New Revision: 748914

URL: http://svn.apache.org/viewvc?rev=748914&view=rev
Log:
Changing the toString test so it is not dependent on insertion ordering

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=748914&r1=748913&r2=748914&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
Sat Feb 28 20:02:51 2009
@@ -201,13 +201,17 @@
         group1.addOption(new Option(null, "foo", false, "Foo"));
         group1.addOption(new Option(null, "bar", false, "Bar"));
 
-        assertEquals("[--foo Foo, --bar Bar]", group1.toString());
+        assertEquals("[--foo Foo, --bar Bar]".length(), group1.toString().length());
+        assertTrue(group1.toString().contains("--foo Foo"));
+        assertTrue(group1.toString().contains("--bar Bar"));
 
         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());
+        assertEquals("[-f Foo, -b Bar]".length(), group2.toString().length());
+        assertTrue(group2.toString().contains("-f Foo"));
+        assertTrue(group2.toString().contains("-b Bar"));
     }
 
     public void testGetNames()



Mime
View raw message