commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jke...@apache.org
Subject cvs commit: jakarta-commons/cli/src/test/org/apache/commons/cli ApplicationTest.java BugsTest.java GnuParseTest.java OptionGroupTest.java ParseRequiredTest.java ParseTest.java PatternOptionBuilderTest.java TestHelpFormatter.java ValueTest.java ValuesTest.java
Date Thu, 19 Sep 2002 22:59:44 GMT
jkeyes      2002/09/19 15:59:44

  Modified:    cli/src/java/org/apache/commons/cli
                        AlreadySelectedException.java BasicParser.java
                        CommandLine.java CommandLineParser.java
                        GnuParser.java HelpFormatter.java
                        MissingArgumentException.java
                        MissingOptionException.java OptionBuilder.java
                        OptionGroup.java Parser.java PosixParser.java
               cli/src/test/org/apache/commons/cli ApplicationTest.java
                        BugsTest.java GnuParseTest.java
                        OptionGroupTest.java ParseRequiredTest.java
                        ParseTest.java PatternOptionBuilderTest.java
                        TestHelpFormatter.java ValueTest.java
                        ValuesTest.java
  Removed:     cli/src/java/org/apache/commons/cli
                        CommandLineParserFactory.java
  Log:
  changed my email add, removed CommandLineParserFactory
  
  Revision  Changes    Path
  1.4       +1 -1      jakarta-commons/cli/src/java/org/apache/commons/cli/AlreadySelectedException.java
  
  Index: AlreadySelectedException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/AlreadySelectedException.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AlreadySelectedException.java	26 Aug 2002 20:15:02 -0000	1.3
  +++ AlreadySelectedException.java	19 Sep 2002 22:59:43 -0000	1.4
  @@ -64,7 +64,7 @@
    * <p>Thrown when more than one option in an option group
    * has been provided.</p>
    *
  - * @author John Keyes ( jbjk at mac.com )
  + * @author John Keyes ( john at integralsource.com )
    * @see ParseException
    */
   public class AlreadySelectedException extends ParseException {
  
  
  
  1.3       +3 -3      jakarta-commons/cli/src/java/org/apache/commons/cli/BasicParser.java
  
  Index: BasicParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/BasicParser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicParser.java	26 Aug 2002 20:15:02 -0000	1.2
  +++ BasicParser.java	19 Sep 2002 22:59:43 -0000	1.3
  @@ -64,7 +64,7 @@
    * The class BasicParser provides a very simple implementation of
    * the {@link Parser#flatten(Options,String[],boolean) flatten} method.
    *
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    * @see Parser
    */
   public class BasicParser extends Parser {
  
  
  
  1.11      +18 -2     jakarta-commons/cli/src/java/org/apache/commons/cli/CommandLine.java
  
  Index: CommandLine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/CommandLine.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CommandLine.java	26 Aug 2002 20:15:02 -0000	1.10
  +++ CommandLine.java	19 Sep 2002 22:59:43 -0000	1.11
  @@ -60,6 +60,7 @@
    */
   package org.apache.commons.cli;
   
  +import java.util.ArrayList;
   import java.util.Collection;
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -80,7 +81,7 @@
    *
    * @author bob mcwhirter (bob @ werken.com)
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    */
   public class CommandLine {
       
  @@ -92,6 +93,8 @@
   
       /** Map of unique options for ease to get complete list of options */
       private Map hashcodeMap = new HashMap();
  +    private List optionList = new ArrayList();
  +    private List keyList    = new ArrayList();
   
       /** the processed options */
       private Option[] optionsArray;
  @@ -282,13 +285,16 @@
        *
        * @param opt the processed option
        */
  -    void setOpt( Option opt ) {
  +    void addOption( Option opt ) {
           hashcodeMap.put( new Integer( opt.hashCode() ), opt );
   
  +        optionList.add( opt );
           String key = opt.getOpt();
           if( " ".equals(key) ) {
               key = opt.getLongOpt();
           }
  +        keyList.add( key );
  +
           if( options.get( key ) != null ) {
               ((java.util.List)options.get( key )).add( opt );
           }
  @@ -316,6 +322,16 @@
       public Option[] getOptions( ) {
           Collection processed = hashcodeMap.values();
   
  +        // reinitialise array
  +        optionsArray = new Option[ processed.size() ];
  +
  +        // return the array
  +        return (Option[]) processed.toArray( optionsArray );
  +    }
  +
  +    public Option[] getOptions2() {
  +        System.out.println( "--2--" );
  +        Collection processed = optionList;
           // reinitialise array
           optionsArray = new Option[ processed.size() ];
   
  
  
  
  1.4       +4 -4      jakarta-commons/cli/src/java/org/apache/commons/cli/CommandLineParser.java
  
  Index: CommandLineParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/CommandLineParser.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CommandLineParser.java	26 Aug 2002 20:15:02 -0000	1.3
  +++ CommandLineParser.java	19 Sep 2002 22:59:43 -0000	1.4
  @@ -65,7 +65,7 @@
    * can parse a String array according to the {@link Options} specified
    * and return a {@link CommandLine}.
    *
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    */
   public interface CommandLineParser {
       
  
  
  
  1.10      +5 -5      jakarta-commons/cli/src/java/org/apache/commons/cli/GnuParser.java
  
  Index: GnuParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/GnuParser.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- GnuParser.java	31 Aug 2002 17:53:11 -0000	1.9
  +++ GnuParser.java	19 Sep 2002 22:59:43 -0000	1.10
  @@ -69,7 +69,7 @@
    * The class GnuParser provides an implementation of the 
    * {@link Parser#flatten(Options,String[],boolean) flatten} method.
    *
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    * @see Parser
    * @version $Revision$
    */
  
  
  
  1.7       +1 -1      jakarta-commons/cli/src/java/org/apache/commons/cli/HelpFormatter.java
  
  Index: HelpFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/HelpFormatter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HelpFormatter.java	9 Sep 2002 19:51:21 -0000	1.6
  +++ HelpFormatter.java	19 Sep 2002 22:59:43 -0000	1.7
  @@ -73,7 +73,7 @@
    * A formatter of help messages for the current command line options
    *
    * @author Slawek Zachcial
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    **/
   public class HelpFormatter
   {
  
  
  
  1.3       +1 -1      jakarta-commons/cli/src/java/org/apache/commons/cli/MissingArgumentException.java
  
  Index: MissingArgumentException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/MissingArgumentException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MissingArgumentException.java	26 Aug 2002 20:15:02 -0000	1.2
  +++ MissingArgumentException.java	19 Sep 2002 22:59:43 -0000	1.3
  @@ -65,7 +65,7 @@
    * <p>Thrown when an option requiring an argument
    * is not provided with an argument.</p>
    *
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    * @see ParseException
    */
   public class MissingArgumentException extends ParseException {
  
  
  
  1.3       +1 -1      jakarta-commons/cli/src/java/org/apache/commons/cli/MissingOptionException.java
  
  Index: MissingOptionException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/MissingOptionException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MissingOptionException.java	26 Aug 2002 20:15:02 -0000	1.2
  +++ MissingOptionException.java	19 Sep 2002 22:59:43 -0000	1.3
  @@ -64,7 +64,7 @@
   /** 
    * <p>Thrown when a required option has not been provided.</p>
    *
  - * @author John Keyes ( jbjk at mac.com )
  + * @author John Keyes ( john at integralsource.com )
    * @see ParseException
    */
   public class MissingOptionException extends ParseException {
  
  
  
  1.10      +4 -4      jakarta-commons/cli/src/java/org/apache/commons/cli/OptionBuilder.java
  
  Index: OptionBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/OptionBuilder.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- OptionBuilder.java	10 Sep 2002 21:35:57 -0000	1.9
  +++ OptionBuilder.java	19 Sep 2002 22:59:43 -0000	1.10
  @@ -67,7 +67,7 @@
    * <p>Details on the Builder pattern can be found at 
    * <a href="http://">http://</a>.</p>
    *
  - * @author John Keyes ( jbjk at mac.com )
  + * @author John Keyes ( john at integralsource.com )
    * @since 1.0
    */
   public class OptionBuilder {
  
  
  
  1.5       +1 -1      jakarta-commons/cli/src/java/org/apache/commons/cli/OptionGroup.java
  
  Index: OptionGroup.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/OptionGroup.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- OptionGroup.java	26 Aug 2002 20:15:02 -0000	1.4
  +++ OptionGroup.java	19 Sep 2002 22:59:43 -0000	1.5
  @@ -67,7 +67,7 @@
   
   /**
    * A group of mutually exclusive options.
  - * @author John Keyes ( jbjk at mac.com )
  + * @author John Keyes ( john at integralsource.com )
    * @version $Revision$
    */
   public class OptionGroup {
  
  
  
  1.5       +6 -6      jakarta-commons/cli/src/java/org/apache/commons/cli/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/Parser.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Parser.java	1 Sep 2002 22:54:56 -0000	1.4
  +++ Parser.java	19 Sep 2002 22:59:43 -0000	1.5
  @@ -70,7 +70,7 @@
   /**
    * <p><code>Parser</code> creates {@link CommandLine}s.</p>
    *
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    * @see Parser
    * @version $Revision$
    */
  @@ -274,6 +274,6 @@
           }
   
           // set the option on the command line
  -        cmd.setOpt( opt );
  +        cmd.addOption( opt );
       }
   }
  
  
  
  1.11      +5 -5      jakarta-commons/cli/src/java/org/apache/commons/cli/PosixParser.java
  
  Index: PosixParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/PosixParser.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PosixParser.java	9 Sep 2002 19:35:24 -0000	1.10
  +++ PosixParser.java	19 Sep 2002 22:59:43 -0000	1.11
  @@ -70,7 +70,7 @@
    * The class PosixParser provides an implementation of the 
    * {@link Parser#flatten(Options,String[],boolean) flatten} method.
    *
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    * @see Parser
    * @version $Revision$
    */
  
  
  
  1.9       +33 -2     jakarta-commons/cli/src/test/org/apache/commons/cli/ApplicationTest.java
  
  Index: ApplicationTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/ApplicationTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ApplicationTest.java	14 Aug 2002 22:27:40 -0000	1.8
  +++ ApplicationTest.java	19 Sep 2002 22:59:44 -0000	1.9
  @@ -17,7 +17,7 @@
    * </ul>
    * </p>
    *
  - * @author John Keyes (jbjk at mac.com)
  + * @author John Keyes (john at integralsource.com)
    */
   public class ApplicationTest extends TestCase {
   
  @@ -29,13 +29,44 @@
       {
           super(name);
       }
  +    
  +    /**
  +     *	
  +     */
  +    public void testLs() {
  +        // create the command line parser
  +        CommandLineParser parser = new PosixParser();
  +        Options options = new Options();
  +        options.addOption( "a", "all", false, "do not hide entries starting with ." );
  +        options.addOption( "A", "almost-all", false, "do not list implied . and .." );
  +        options.addOption( "b", "escape", false, "print octal escapes for nongraphic characters"
);
  +        options.addOption( OptionBuilder.withLongOpt( "block-size" )
  +                                        .withDescription( "use SIZE-byte blocks" )
  +                                        .withValueSeparator( '=' )
  +                                        .hasArg()
  +                                        .create() );
  +        options.addOption( "B", "ignore-backups", false, "do not list implied entried ending
with ~");
  +        options.addOption( "c", false, "with -lt: sort by, and show, ctime (time of last
modification of file status information) with -l:show ctime and sort by name otherwise: sort
by ctime" );
  +        options.addOption( "C", false, "list entries by columns" );
  +
  +        String[] args = new String[]{ "--block-size=10" };
  +
  +        try {
  +            CommandLine line = parser.parse( options, args );
  +            assertTrue( line.hasOption( "block-size" ) );
  +            assertEquals( line.getOptionValue( "block-size" ), "10" );
  +        }
  +        catch( ParseException exp ) {
  +            fail( "Unexpected exception:" + exp.getMessage() );
  +        }
  +    }
   
       /**
        * Ant test
        */
       public void testAnt() {
           // use the GNU parser
  -        CommandLineParser parser = CommandLineParserFactory.newParser( "org.apache.commons.cli.GnuParser"
);
  +        CommandLineParser parser = new GnuParser( );
           Options options = new Options();
           options.addOption( "help", false, "print this message" );
           options.addOption( "projecthelp", false, "print project help information" );
  
  
  
  1.7       +6 -6      jakarta-commons/cli/src/test/org/apache/commons/cli/BugsTest.java
  
  Index: BugsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/BugsTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BugsTest.java	1 Sep 2002 22:54:56 -0000	1.6
  +++ BugsTest.java	19 Sep 2002 22:59:44 -0000	1.7
  @@ -43,7 +43,7 @@
                              .create() );
           String[] args = new String[] { "--verbose" };
   
  -        CommandLineParser parser = CommandLineParserFactory.newParser();
  +        CommandLineParser parser = new PosixParser();
   
           try {
               CommandLine cmd = parser.parse( options, args );
  @@ -67,7 +67,7 @@
           String[] args = new String[] { "-DJAVA_HOME=/opt/java" ,
           "-pfile1:file2:file3" };
   
  -        CommandLineParser parser = CommandLineParserFactory.newParser();
  +        CommandLineParser parser = new PosixParser();
   
           try {
               CommandLine cmd = parser.parse( options, args );
  @@ -114,7 +114,7 @@
   	options.addOption("m", true, "missing");
           String[] args = new String[] { "-f" , "foo" };
   
  -        CommandLineParser parser = CommandLineParserFactory.newParser();
  +        CommandLineParser parser = new PosixParser();
   
           try {
               CommandLine cmd = parser.parse( options, args );
  @@ -142,7 +142,7 @@
                              .create( 'b' ) );
           String[] args = new String[] { "-a", "-bvalue" };
   
  -        CommandLineParser parser = CommandLineParserFactory.newParser();
  +        CommandLineParser parser = new PosixParser();
   
           try {
               CommandLine cmd = parser.parse( options, args );
  @@ -160,7 +160,7 @@
                              .create( 'b' ) );
           args = new String[] { "-a", "-b", "value" };
   
  -        parser = CommandLineParserFactory.newParser( "org.apache.commons.cli.GnuParser"
);
  +        parser = new GnuParser();
   
           try {
               CommandLine cmd = parser.parse( options, args );
  
  
  
  1.3       +2 -2      jakarta-commons/cli/src/test/org/apache/commons/cli/GnuParseTest.java
  
  Index: GnuParseTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/GnuParseTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GnuParseTest.java	25 Jul 2002 21:40:08 -0000	1.2
  +++ GnuParseTest.java	19 Sep 2002 22:59:44 -0000	1.3
  @@ -44,7 +44,7 @@
                          false,
                          "turn [c] on or off");
   
  -        _parser = CommandLineParserFactory.newParser( "org.apache.commons.cli.GnuParser"
);
  +        _parser = new GnuParser( );
       }
   
       public void tearDown()
  
  
  
  1.4       +1 -1      jakarta-commons/cli/src/test/org/apache/commons/cli/OptionGroupTest.java
  
  Index: OptionGroupTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/OptionGroupTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- OptionGroupTest.java	4 Jul 2002 22:32:12 -0000	1.3
  +++ OptionGroupTest.java	19 Sep 2002 22:59:44 -0000	1.4
  @@ -22,7 +22,7 @@
   {
   
       private Options _options = null;
  -    private CommandLineParser parser = CommandLineParserFactory.newParser();
  +    private CommandLineParser parser = new PosixParser();
   
   
       public static Test suite() 
  
  
  
  1.5       +1 -1      jakarta-commons/cli/src/test/org/apache/commons/cli/ParseRequiredTest.java
  
  Index: ParseRequiredTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/ParseRequiredTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ParseRequiredTest.java	30 Jul 2002 23:06:21 -0000	1.4
  +++ ParseRequiredTest.java	19 Sep 2002 22:59:44 -0000	1.5
  @@ -22,7 +22,7 @@
   {
   
       private Options _options = null;
  -    private CommandLineParser parser = CommandLineParserFactory.newParser();
  +    private CommandLineParser parser = new PosixParser();
   
       public static Test suite() { 
           return new TestSuite(ParseRequiredTest.class); 
  
  
  
  1.5       +1 -1      jakarta-commons/cli/src/test/org/apache/commons/cli/ParseTest.java
  
  Index: ParseTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/ParseTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ParseTest.java	3 Aug 2002 23:45:09 -0000	1.4
  +++ ParseTest.java	19 Sep 2002 22:59:44 -0000	1.5
  @@ -45,7 +45,7 @@
                          false,
                          "turn [c] on or off");
   
  -        _parser = CommandLineParserFactory.newParser();
  +        _parser = new PosixParser();
       }
   
       public void tearDown()
  
  
  
  1.6       +1 -1      jakarta-commons/cli/src/test/org/apache/commons/cli/PatternOptionBuilderTest.java
  
  Index: PatternOptionBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/PatternOptionBuilderTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PatternOptionBuilderTest.java	4 Aug 2002 23:04:53 -0000	1.5
  +++ PatternOptionBuilderTest.java	19 Sep 2002 22:59:44 -0000	1.6
  @@ -45,7 +45,7 @@
              Options options = PatternOptionBuilder.parsePattern("a:b@cde>f+n%t/");
              String[] args = new String[] { "-c", "-a", "foo", "-b", "java.util.Vector",
"-e", "build.xml", "-f", "java.util.Calendar", "-n", "4.5", "-t", "http://jakarta.apache.org/"
};
         
  -           CommandLineParser parser = CommandLineParserFactory.newParser();
  +           CommandLineParser parser = new PosixParser();
              CommandLine line = parser.parse(options,args);
   
              // tests the char methods of CommandLine that delegate to
  
  
  
  1.4       +1 -1      jakarta-commons/cli/src/test/org/apache/commons/cli/TestHelpFormatter.java
  
  Index: TestHelpFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/TestHelpFormatter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestHelpFormatter.java	22 Jul 2002 22:49:58 -0000	1.3
  +++ TestHelpFormatter.java	19 Sep 2002 22:59:44 -0000	1.4
  @@ -20,7 +20,7 @@
    * Test case for the HelpFormatter class 
    *
    * @author Slawek Zachcial
  - * @author John Keyes ( jbjk at mac.com )
  + * @author John Keyes ( john at integralsource.com )
    **/
   public class TestHelpFormatter extends TestCase
   {
  
  
  
  1.5       +9 -9      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ValueTest.java	10 Sep 2002 21:35:57 -0000	1.4
  +++ ValueTest.java	19 Sep 2002 22:59:44 -0000	1.5
  @@ -79,7 +79,7 @@
   
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               _cl = parser.parse(opts,args);
           }
           catch (ParseException e)
  @@ -125,7 +125,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("e") );
               assertNull( cmd.getOptionValue("e") );
  @@ -142,7 +142,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("e") );
               assertEquals( "everything", cmd.getOptionValue("e") );
  @@ -159,7 +159,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("fish") );
               assertNull( cmd.getOptionValue("fish") );
  @@ -176,7 +176,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("fish") );
               assertEquals( "face", cmd.getOptionValue("fish") );
  @@ -193,7 +193,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("j") );
               assertEquals( "ink", cmd.getOptionValue("j") );
  @@ -213,7 +213,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("gravy") );
               assertEquals( "gold", cmd.getOptionValue("gravy") );
  @@ -233,7 +233,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("i") );
               assertEquals( "ink", cmd.getOptionValue("i") );
  @@ -255,7 +255,7 @@
           };
           try
           {
  -            CommandLineParser parser = CommandLineParserFactory.newParser();
  +            CommandLineParser parser = new PosixParser();
               CommandLine cmd = parser.parse(opts,args);
               assertTrue( cmd.hasOption("hide") );
               assertEquals( "house", cmd.getOptionValue("hide") );
  
  
  
  1.8       +1 -1      jakarta-commons/cli/src/test/org/apache/commons/cli/ValuesTest.java
  
  Index: ValuesTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/ValuesTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ValuesTest.java	14 Aug 2002 22:27:40 -0000	1.7
  +++ ValuesTest.java	19 Sep 2002 22:59:44 -0000	1.8
  @@ -113,7 +113,7 @@
                                          "-kkey2=value2",
                                          "-mkey=value"};
   
  -        CommandLineParser parser = CommandLineParserFactory.newParser();
  +        CommandLineParser parser = new PosixParser();
   
           try
           {
  
  
  

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


Mime
View raw message