commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roxspr...@apache.org
Subject cvs commit: jakarta-commons/cli/src/test/org/apache/commons/cli2 CLITestCase.java
Date Sun, 22 Feb 2004 13:13:32 GMT
roxspring    2004/02/22 05:13:32

  Modified:    cli/src/test/org/apache/commons/cli2/impl Tag:
                        RESEARCH_CLI_2_ROXSPRING OptionTestCase.java
  Added:       cli/src/test/org/apache/commons/cli2/commandline Tag:
                        RESEARCH_CLI_2_ROXSPRING CommandLineImplTest.java
               cli/src/test/org/apache/commons/cli2 Tag:
                        RESEARCH_CLI_2_ROXSPRING CLITestCase.java
  Log:
  Added tests for CommandLineImpl
  Refactored general assert utils out of OptionTestCase into the new CLITestCase
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.1   +182 -0    jakarta-commons/cli/src/test/org/apache/commons/cli2/commandline/Attic/CommandLineImplTest.java
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.5   +2 -86     jakarta-commons/cli/src/test/org/apache/commons/cli2/impl/Attic/OptionTestCase.java
  
  Index: OptionTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli2/impl/Attic/OptionTestCase.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- OptionTestCase.java	17 Feb 2004 21:14:14 -0000	1.1.2.4
  +++ OptionTestCase.java	22 Feb 2004 13:13:32 -0000	1.1.2.5
  @@ -15,15 +15,9 @@
    */
   package org.apache.commons.cli2.impl;
   
  -import java.util.Arrays;
  -import java.util.Collection;
  -import java.util.Collections;
  -import java.util.Iterator;
  -import java.util.LinkedList;
   import java.util.List;
   
  -import junit.framework.TestCase;
  -
  +import org.apache.commons.cli2.CLITestCase;
   import org.apache.commons.cli2.Option;
   import org.apache.commons.cli2.OptionException;
   import org.apache.commons.cli2.WriteableCommandLine;
  @@ -32,90 +26,12 @@
   /**
    * @author Rob Oxspring
    */
  -public abstract class OptionTestCase extends TestCase {
  +public abstract class OptionTestCase extends CLITestCase {
   
       public static WriteableCommandLine commandLine(
           final Option option,
           final List args) {
           return new WriteableCommandLineImpl(option, args);
  -    }
  -
  -    public static List list() {
  -        return Collections.EMPTY_LIST;
  -    }
  -
  -    public static List list(final Object args[]) {
  -        return new LinkedList(Arrays.asList(args));
  -    }
  -
  -    public static List list(final Object arg0) {
  -        return list(new Object[] { arg0 });
  -    }
  -
  -    public static List list(final Object arg0, final Object arg1) {
  -        return list(new Object[] { arg0, arg1 });
  -    }
  -
  -    public static List list(
  -        final Object arg0,
  -        final Object arg1,
  -        final Object arg2) {
  -        return list(new Object[] { arg0, arg1, arg2 });
  -    }
  -
  -    public static List list(
  -        final Object arg0,
  -        final Object arg1,
  -        final Object arg2,
  -        final Object arg3) {
  -        return list(new Object[] { arg0, arg1, arg2, arg3 });
  -    }
  -
  -    public static List list(
  -        final Object arg0,
  -        final Object arg1,
  -        final Object arg2,
  -        final Object arg3,
  -        final Object arg4) {
  -        return list(new Object[] { arg0, arg1, arg2, arg3, arg4 });
  -    }
  -
  -    public static List list(
  -        final Object arg0,
  -        final Object arg1,
  -        final Object arg2,
  -        final Object arg3,
  -        final Object arg4,
  -        final Object arg5) {
  -        return list(new Object[] { arg0, arg1, arg2, arg3, arg4, arg5 });
  -    }
  -
  -    public static void assertListContentsEqual(
  -        final List expected,
  -        final List found) {
  -
  -        final Iterator e = expected.iterator();
  -        final Iterator f = found.iterator();
  -
  -        while (e.hasNext() && f.hasNext()) {
  -            assertEquals(e.next(), f.next());
  -        }
  -
  -        if (e.hasNext()) {
  -            fail("Expected more elements");
  -        }
  -
  -        if (f.hasNext()) {
  -            fail("Found more elements");
  -        }
  -    }
  -
  -    public static void assertContentsEqual(
  -        final Collection expected,
  -        final Collection found) {
  -        assertTrue(expected.containsAll(found));
  -        assertTrue(found.containsAll(expected));
  -        assertEquals(expected.size(), found.size());
       }
   
       public abstract void testTriggers();
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +84 -0     jakarta-commons/cli/src/test/org/apache/commons/cli2/Attic/CLITestCase.java
  
  
  
  

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


Mime
View raw message