Skip to Content.
Sympa Menu

notify-dpml - r1780 - trunk/main/util/cli/src/test/net/dpml/cli/bug

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1780 - trunk/main/util/cli/src/test/net/dpml/cli/bug
  • Date: Mon, 30 Oct 2006 19:20:22 +0100

Author: mcconnell
Date: 2006-10-30 19:20:22 +0100 (Mon, 30 Oct 2006)
New Revision: 1780

Modified:
trunk/main/util/cli/src/test/net/dpml/cli/bug/Bug27575Test.java
Log:
update testcase to be compliance with changes to jre6 involving removal or
ordering assumptions in the testcase on list contents in a group of options
(no implementation changes)

Modified: trunk/main/util/cli/src/test/net/dpml/cli/bug/Bug27575Test.java
===================================================================
--- trunk/main/util/cli/src/test/net/dpml/cli/bug/Bug27575Test.java
2006-10-15 00:42:02 UTC (rev 1779)
+++ trunk/main/util/cli/src/test/net/dpml/cli/bug/Bug27575Test.java
2006-10-30 18:20:22 UTC (rev 1780)
@@ -22,7 +22,8 @@
import net.dpml.cli.builder.PatternBuilder;
import net.dpml.cli.option.GroupImpl;

-import java.util.Iterator;
+import java.util.List;
+//import java.util.Iterator;

/**
* DOCUMENT ME!
@@ -39,14 +40,23 @@
{
PatternBuilder builder = new PatternBuilder( );
builder.withPattern( "hc!<" );
-
Option option = builder.create( );
assertTrue( option instanceof GroupImpl );
-
GroupImpl group = (GroupImpl) option;
- Iterator i = group.getOptions( ).iterator( );
- assertEquals( "[-h]", i.next( ).toString( ) );
- assertEquals( "-c <arg>", i.next( ).toString( ) );
- assertFalse( i.hasNext( ) );
+ List options = group.getOptions();
+ assertEquals( "size", 2, options.size() );
+ Object[] entries = options.toArray();
+ for( int i=0; i<entries.length; i++ )
+ {
+ String entry = entries[i].toString();
+ if( entry.equals( "[-h]" ) || entry.equals( "-c <arg>" ) )
+ {
+ // ok
+ }
+ else
+ {
+ throw new RuntimeException( "Incorrect option [" + entry +
"]" );
+ }
+ }
}
}




  • r1780 - trunk/main/util/cli/src/test/net/dpml/cli/bug, mcconnell at BerliOS, 10/30/2006

Archive powered by MHonArc 2.6.24.

Top of Page