You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jk...@apache.org on 2003/05/21 23:05:02 UTC

cvs commit: jakarta-commons/cli/src/test/org/apache/commons/cli ValueTest.java BugzillaTest.java

jkeyes      2003/05/21 14:05:02

  Modified:    cli/src/test/org/apache/commons/cli Tag: cli_1_x
                        ValueTest.java BugzillaTest.java
  Log:
  . modified to use withOptionalValues method
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.3   +7 -47     jakarta-commons/cli/src/test/org/apache/commons/cli/ValueTest.java
  
  Index: ValueTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/ValueTest.java,v
  retrieving revision 1.7.2.2
  retrieving revision 1.7.2.3
  diff -u -r1.7.2.2 -r1.7.2.3
  --- ValueTest.java	20 May 2003 23:08:54 -0000	1.7.2.2
  +++ ValueTest.java	21 May 2003 21:05:02 -0000	1.7.2.3
  @@ -38,92 +38,52 @@
       	Option a = obuilder.withDescription("toggle -a")
       	    .withName("a").create();
       	opts.add(a);   
  -        //opts.addOption("a",
  -        //               false,
  -        //               "toggle -a");
   
   		Argument b = abuilder.withDescription("set -b")
   		    .withName("b").create();
   		opts.add(b);   
   		    
  -        //opts.addOption("b",
  -        //               true,
  -        //               "set -b");
  -
           Option c = obuilder.withDescription("toggle -c")
               .withName("c").withLongName("c").create();
   		opts.add(c);   
               
  -        //opts.addOption("c",
  -        //               "c",
  -        //               false,
  -        //               "toggle -c");
  -
   		Argument d = abuilder.withDescription("set -d")
   			.withName("d").withLongName("d").create();
   		opts.add(d);   
   			
  -        //opts.addOption("d",
  -        //               "d",
  -        //               true,
  -        //               "set -d");
  -
  -		Argument e = abuilder.hasOptionalValues()
  +		Argument e = abuilder.withOptionalValues(true)
   			.withName("e").create();
   		opts.add(e);   
   
  -        //opts.addOption( OptionBuilder.hasOptionalArg()
  -        //                .create( 'e') );
  -
  -		Argument fish = abuilder.hasOptionalValues()
  +		Argument fish = abuilder.withOptionalValues(true)
   			.withLongName("fish").create();
   		opts.add(fish);   
   			
  -        //opts.addOption( OptionBuilder.hasOptionalArg()
  -        //                .withLongOpt( "fish" )
  -        //                .create( ) );
  -
  -		Argument gravy = abuilder.hasOptionalValues()
  +		Argument gravy = abuilder.withOptionalValues(true)
   		    .withSize(100)
   			.withLongName("gravy").create();
   		opts.add(gravy);   
   
  -        //opts.addOption( OptionBuilder.hasOptionalArgs()
  -        //                .withLongOpt( "gravy" )
  -        //                .create( ) );
  -
  -		Argument hide = abuilder.hasOptionalValues()
  +		Argument hide = abuilder.withOptionalValues(true)
   		    .withSize(2)
   			.withLongName("hide").create();
   		opts.add(hide);   
   
  -        //opts.addOption( OptionBuilder.hasOptionalArgs( 2 )
  -        //                .withLongOpt( "hide" )
  -        //                .create( ) );
   
  -		Argument i = abuilder.hasOptionalValues()
  +		Argument i = abuilder.withOptionalValues(true)
   		    .withSize(2)
   			.withName("i").create();
   		opts.add(i);   
   
  -        //opts.addOption( OptionBuilder.hasOptionalArgs( 2 )
  -        //                .create( 'i' ) );
  -
  -		Argument j = abuilder.hasOptionalValues()
  +		Argument j = abuilder.withOptionalValues(true)
   		    .withSize(2)
   			.withName("j").create();
   		opts.add(j);   
   			
  -        //opts.addOption( OptionBuilder.hasOptionalArgs( )
  -        //                .create( 'j' ) );
  -
  -		Argument k = abuilder.hasOptionalValues()
  +		Argument k = abuilder.withOptionalValues(true)
   		    .withValueSeparator(',')
   			.withName("k").create();
   		opts.add(k);   
  -
  -        //opts.addOption( OptionBuilder.hasArgs( ).withValueSeparator( ',' )
  -        //                .create( 'k' ) );
   
   		opts.add( abuilder.createAnonymous("anon") );
   		
  
  
  
  1.1.2.3   +1 -1      jakarta-commons/cli/src/test/org/apache/commons/cli/Attic/BugzillaTest.java
  
  Index: BugzillaTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/Attic/BugzillaTest.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- BugzillaTest.java	20 May 2003 23:08:54 -0000	1.1.2.2
  +++ BugzillaTest.java	21 May 2003 21:05:02 -0000	1.1.2.3
  @@ -291,7 +291,7 @@
   		Options options = new Options();
   		
   		ArgumentBuilder builder = new ArgumentBuilder();
  -		Option a = builder.hasOptionalValues().withName("a").create();
  +		Option a = builder.withOptionalValues(true).withName("a").create();
   		//options.addOption( OptionBuilder.hasOptionalArg()
   		//				   .create( 'a' ) );
   		Option b = builder.withName("b").create();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org