commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r661358 - in /commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli: ./ bug/
Date Thu, 29 May 2008 15:30:41 GMT
Author: ebourg
Date: Thu May 29 08:30:40 2008
New Revision: 661358

URL: http://svn.apache.org/viewvc?rev=661358&view=rev
Log:
Removed the unused constructors, suite() and teardown() methods from the test cases

Modified:
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ApplicationTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ArgumentIsOptionTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BugsTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BuildTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/GnuParseTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterExamples.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionBuilderTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionGroupTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseRequiredTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PatternOptionBuilderTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/UtilTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValueTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValuesTest.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI133Test.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI13Test.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI148Test.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI18Test.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI51Test.java
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI71Test.java

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ApplicationTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ApplicationTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ApplicationTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ApplicationTest.java
Thu May 29 08:30:40 2008
@@ -14,11 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * <p>
@@ -37,15 +36,6 @@
  */
 public class ApplicationTest extends TestCase {
 
-    public static Test suite() { 
-        return new TestSuite(ApplicationTest.class); 
-    }
-
-    public ApplicationTest(String name)
-    {
-        super(name);
-    }
-    
     /**
      *	
      */

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ArgumentIsOptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ArgumentIsOptionTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ArgumentIsOptionTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ArgumentIsOptionTest.java
Thu May 29 08:30:40 2008
@@ -14,25 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 
 public class ArgumentIsOptionTest extends TestCase {
     private Options options = null;
     private CommandLineParser parser = null;
 
-    public ArgumentIsOptionTest(String name) {
-        super(name);
-    }
-
-    public static Test suite() {
-        return new TestSuite(ArgumentIsOptionTest.class);
-    }
-
     public void setUp() {
         options = new Options().addOption("p", false, "Option p").addOption("attr",
                 true, "Option accepts argument");
@@ -40,9 +30,6 @@
         parser = new PosixParser();
     }
 
-    public void tearDown() {
-    }
-
     public void testOptionAndOptionWithArgument() {
         String[] args = new String[] {
                 "-p",

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BugsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BugsTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BugsTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BugsTest.java Thu
May 29 08:30:40 2008
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import java.io.ByteArrayOutputStream;
@@ -22,33 +23,10 @@
 import java.io.StringWriter;
 import java.util.Properties;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 public class BugsTest extends TestCase
 {
-    /** CommandLine instance */
-    private CommandLine _cmdline = null;
-    private Option _option = null;
-
-    public static Test suite() { 
-        return new TestSuite( BugsTest.class );
-    }
-
-    public BugsTest( String name )
-    {
-        super( name );
-    }
-
-    public void setUp()
-    {
-    }
-
-    public void tearDown()
-    {
-    }
-
     public void test11457() {
         Options options = new Options();
         options.addOption( OptionBuilder.withLongOpt( "verbose" )

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BuildTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BuildTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BuildTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BuildTest.java Thu
May 29 08:30:40 2008
@@ -14,34 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 public class BuildTest extends TestCase
 {
-
-    public static Test suite() { 
-        return new TestSuite(BuildTest.class); 
-    }
-
-    public BuildTest(String name)
-    {
-        super(name);
-    }
-
-    public void setUp()
-    {
-
-    }
-
-    public void tearDown()
-    {
-
-    }
-
     public void testSimple()
     {
         Options opts = new Options();

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/GnuParseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/GnuParseTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/GnuParseTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/GnuParseTest.java
Thu May 29 08:30:40 2008
@@ -16,24 +16,13 @@
  */
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 public class GnuParseTest extends TestCase
 {
     private Options _options = null;
     private Parser _parser = null;
 
-    public static Test suite() { 
-        return new TestSuite( GnuParseTest.class ); 
-    }
-
-    public GnuParseTest( String name )
-    {
-        super( name );
-    }
-
     public void setUp()
     {
         _options = new Options()
@@ -53,11 +42,6 @@
         _parser = new GnuParser( );
     }
 
-    public void tearDown()
-    {
-
-    }
-
     public void testSimpleShort()
     {
         String[] args = new String[] { "-a",
@@ -129,14 +113,13 @@
 
     public void testMissingArg()
     {
-
         String[] args = new String[] { "-b" };
 
         boolean caught = false;
 
         try
         {
-            CommandLine cl = _parser.parse(_options, args);
+            _parser.parse(_options, args);
         }
         catch (MissingArgumentException e)
         {

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterExamples.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterExamples.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterExamples.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterExamples.java
Thu May 29 08:30:40 2008
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 /** 

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/HelpFormatterTest.java
Thu May 29 08:30:40 2008
@@ -14,15 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintWriter;
-
 import java.util.Comparator;
 
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /** 
  * Test case for the HelpFormatter class 
@@ -33,7 +32,6 @@
  **/
 public class HelpFormatterTest extends TestCase
 {
-
    private static final String EOL = System.getProperty("line.separator");
 
    public static void main( String[] args )
@@ -42,18 +40,7 @@
       junit.textui.TestRunner.main(testName);
    }
 
-   public static TestSuite suite()
-   {
-      return new TestSuite(HelpFormatterTest.class);
-   }
-
-   public HelpFormatterTest( String s )
-   {
-      super( s );
-   }
-
-   public void testFindWrapPos()
-      throws Exception
+   public void testFindWrapPos() throws Exception
    {
       HelpFormatter hf = new HelpFormatter();
 
@@ -67,8 +54,7 @@
       assertEquals("wrap position 3", 4, hf.findWrapPos(text, 3, 0));
    }
 
-   public void testPrintWrapped()
-      throws Exception
+   public void testPrintWrapped() throws Exception
    {
       StringBuffer sb = new StringBuffer();
       HelpFormatter hf = new HelpFormatter();
@@ -116,8 +102,7 @@
       assertEquals("multi-line padded text", expected, sb.toString());
    }
 
-   public void testPrintOptions()
-   throws Exception
+   public void testPrintOptions() throws Exception
    {
        StringBuffer sb = new StringBuffer();
        HelpFormatter hf = new HelpFormatter();
@@ -169,8 +154,7 @@
        assertEquals("multiple wrapped options", expected, sb.toString());
    }
 
-   public void testAutomaticUsage()
-   throws Exception
+   public void testAutomaticUsage() throws Exception
    {
        HelpFormatter hf = new HelpFormatter();
        Options options = null;

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java
Thu May 29 08:30:40 2008
@@ -14,32 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 
 /**
- * <p>
  * This is a collection of tests that test real world
  * applications command lines focusing on options with
  * long and short names.
- * </p>
  */
 public class LongOptionWithShort extends TestCase {
-    public LongOptionWithShort(String name) {
-        super(name);
-    }
-
-    public static Test suite() {
-        return new TestSuite(LongOptionWithShort.class);
-    }
 
-    /**
-     *
-     */
     public void testLongOptionWithShort() {
         Option help = new Option("h", "help", false, "print this message");
         Option version = new Option("v", "version", false,

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionBuilderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionBuilderTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionBuilderTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionBuilderTest.java
Thu May 29 08:30:40 2008
@@ -14,28 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import junit.textui.TestRunner;
 
 public class OptionBuilderTest extends TestCase {
 
-    public OptionBuilderTest( String name ) {
-        super( name );
-    }
-
-    public static Test suite() { 
-        return new TestSuite( OptionBuilderTest.class ); 
-    }
-
-    public static void main( String args[] ) { 
-        TestRunner.run( suite() );
-    }
-
     public void testCompleteOption( ) {
         Option simple = OptionBuilder.withLongOpt( "simple option")
                                      .hasArg( )
@@ -162,4 +147,4 @@
             fail( "IllegalArgumentException caught" );
         }
     }
-}
\ No newline at end of file
+}

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=661358&r1=661357&r2=661358&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
Thu May 29 08:30:40 2008
@@ -14,11 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * @author John Keyes (john at integralsource.com)
@@ -26,21 +25,9 @@
  */
 public class OptionGroupTest extends TestCase
 {
-
     private Options _options = null;
     private CommandLineParser parser = new PosixParser();
 
-
-    public static Test suite() 
-    { 
-        return new TestSuite ( OptionGroupTest.class ); 
-    }
-
-    public OptionGroupTest( String name )
-    {
-        super( name );
-    }
-
     public void setUp()
     {
         Option file = new Option( "f", "file", false, "file to process" );
@@ -68,10 +55,6 @@
         _options.addOption( "r", "revision", false, "revision number" );
     }
 
-    public void tearDown()
-    {
-    }
-
     public void testSingleOptionFromGroup()
     {
         String[] args = new String[] { "-f" };
@@ -204,7 +187,7 @@
 
         try
         {
-            CommandLine cl = parser.parse( _options, args);
+            parser.parse( _options, args);
             fail( "two arguments from group not allowed" );
         }
         catch (ParseException e)
@@ -222,7 +205,7 @@
 
         try
         {
-            CommandLine cl = parser.parse( _options, args);
+            parser.parse(_options, args);
             fail( "two arguments from group not allowed" );
         }
         catch (ParseException e)
@@ -277,5 +260,4 @@
         }
     }
 
-
 }

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionTest.java Thu
May 29 08:30:40 2008
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import junit.framework.TestCase;

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/OptionsTest.java Thu
May 29 08:30:40 2008
@@ -14,14 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import java.util.ArrayList;
 import java.util.Collection;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * @author Rob Oxspring roxspring@apache.org
@@ -29,25 +28,6 @@
  */
 public class OptionsTest extends TestCase
 {
-
-    public static Test suite() 
-    { 
-        return new TestSuite ( OptionsTest.class ); 
-    }
-
-    public OptionsTest( String name )
-    {
-        super( name );
-    }
-
-    public void setUp()
-    {
-    }
-
-    public void tearDown()
-    {
-    }
-    
     public void testHelpOptions(){
         
         Option longOnly1 = OptionBuilder
@@ -118,4 +98,3 @@
     }
 
 }
-

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseRequiredTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseRequiredTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseRequiredTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseRequiredTest.java
Thu May 29 08:30:40 2008
@@ -14,11 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /**
  * @author John Keyes (john at integralsource.com)
@@ -26,19 +25,9 @@
  */
 public class ParseRequiredTest extends TestCase
 {
-
     private Options _options = null;
     private CommandLineParser parser = new PosixParser();
 
-    public static Test suite() { 
-        return new TestSuite(ParseRequiredTest.class); 
-    }
-
-    public ParseRequiredTest(String name)
-    {
-        super(name);
-    }
-
     public void setUp()
     {
         _options = new Options()
@@ -53,11 +42,6 @@
                                      .create( 'b' ) );
     }
 
-    public void tearDown()
-    {
-
-    }
-
     public void testWithRequiredOption()
     {
         String[] args = new String[] {  "-b", "file" };

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ParseTest.java Thu
May 29 08:30:40 2008
@@ -14,27 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 public class ParseTest extends TestCase
 {
-
     private Options _options = null;
     private Parser _parser = null;
 
-    public static Test suite() { 
-        return new TestSuite(ParseTest.class); 
-    }
-
-    public ParseTest(String name)
-    {
-        super(name);
-    }
-
     public void setUp()
     {
         _options = new Options()
@@ -54,11 +43,6 @@
         _parser = new PosixParser();
     }
 
-    public void tearDown()
-    {
-
-    }
-
     public void testSimpleShort()
     {
         String[] args = new String[] { "-a",

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PatternOptionBuilderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PatternOptionBuilderTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PatternOptionBuilderTest.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PatternOptionBuilderTest.java
Thu May 29 08:30:40 2008
@@ -14,65 +14,49 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 /** 
  * Test case for the PatternOptionBuilder class 
  *
  * @author Henri Yandell
  **/
-public class PatternOptionBuilderTest
-extends TestCase
+public class PatternOptionBuilderTest extends TestCase
 {
-
-   public static TestSuite suite()
+   public void testSimplePattern() throws Exception
    {
-      return new TestSuite(PatternOptionBuilderTest.class);
-   }
+       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/" };
 
-   public void testSimplePattern()
-   {
-       try {
-           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 = new PosixParser();
-           CommandLine line = parser.parse(options,args);
-
-           assertEquals("flag a", "foo", line.getOptionValue("a"));
-           assertEquals("string flag a", "foo", line.getOptionObject("a"));
-           assertEquals("object flag b", new java.util.Vector(), line.getOptionObject("b"));
-           assertTrue("boolean true flag c", line.hasOption("c"));
-           assertFalse("boolean false flag d", line.hasOption("d"));
-           assertEquals("file flag e", new java.io.File("build.xml"), line.getOptionObject("e"));
-           assertEquals("class flag f", java.util.Calendar.class, line.getOptionObject("f"));
-           assertEquals("number flag n", new Double(4.5), line.getOptionObject("n"));
-           assertEquals("url flag t", new java.net.URL("http://jakarta.apache.org/"), line.getOptionObject("t"));
-
-           // tests the char methods of CommandLine that delegate to the String methods
-           assertEquals("flag a", "foo", line.getOptionValue('a'));
-           assertEquals("string flag a", "foo", line.getOptionObject('a'));
-           assertEquals("object flag b", new java.util.Vector(), line.getOptionObject('b'));
-           assertTrue("boolean true flag c", line.hasOption('c'));
-           assertFalse("boolean false flag d", line.hasOption('d'));
-           assertEquals("file flag e", new java.io.File("build.xml"), line.getOptionObject('e'));
-           assertEquals("class flag f", java.util.Calendar.class, line.getOptionObject('f'));
-           assertEquals("number flag n", new Double(4.5), line.getOptionObject('n'));
-           assertEquals("url flag t", new java.net.URL("http://jakarta.apache.org/"), line.getOptionObject('t'));
-
-           /// DATES NOT SUPPORTED YET.
-           //      assertEquals("number flag t", new java.util.Date(1023400137276L), line.getOptionObject('z'));
-           //     input is:  "Thu Jun 06 17:48:57 EDT 2002"
-       }
-       catch( ParseException exp ) {
-           fail( exp.getMessage() );
-       }
-       catch( java.net.MalformedURLException exp ) {
-           fail( exp.getMessage() );
-       }
-   }
+       CommandLineParser parser = new PosixParser();
+       CommandLine line = parser.parse(options,args);
 
+       assertEquals("flag a", "foo", line.getOptionValue("a"));
+       assertEquals("string flag a", "foo", line.getOptionObject("a"));
+       assertEquals("object flag b", new java.util.Vector(), line.getOptionObject("b"));
+       assertTrue("boolean true flag c", line.hasOption("c"));
+       assertFalse("boolean false flag d", line.hasOption("d"));
+       assertEquals("file flag e", new java.io.File("build.xml"), line.getOptionObject("e"));
+       assertEquals("class flag f", java.util.Calendar.class, line.getOptionObject("f"));
+       assertEquals("number flag n", new Double(4.5), line.getOptionObject("n"));
+       assertEquals("url flag t", new java.net.URL("http://jakarta.apache.org/"), line.getOptionObject("t"));
+
+       // tests the char methods of CommandLine that delegate to the String methods
+       assertEquals("flag a", "foo", line.getOptionValue('a'));
+       assertEquals("string flag a", "foo", line.getOptionObject('a'));
+       assertEquals("object flag b", new java.util.Vector(), line.getOptionObject('b'));
+       assertTrue("boolean true flag c", line.hasOption('c'));
+       assertFalse("boolean false flag d", line.hasOption('d'));
+       assertEquals("file flag e", new java.io.File("build.xml"), line.getOptionObject('e'));
+       assertEquals("class flag f", java.util.Calendar.class, line.getOptionObject('f'));
+       assertEquals("number flag n", new Double(4.5), line.getOptionObject('n'));
+       assertEquals("url flag t", new java.net.URL("http://jakarta.apache.org/"), line.getOptionObject('t'));
+
+       /// DATES NOT SUPPORTED YET.
+       //      assertEquals("number flag t", new java.util.Date(1023400137276L), line.getOptionObject('z'));
+       //     input is:  "Thu Jun 06 17:48:57 EDT 2002"
+   }
 }

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/UtilTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/UtilTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/UtilTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/UtilTest.java Thu
May 29 08:30:40 2008
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import junit.framework.TestCase;
@@ -22,6 +23,7 @@
  * @author brianegge
  */
 public class UtilTest extends TestCase {
+
     public void testStripLeadingHyphens() {
         assertEquals("f", Util.stripLeadingHyphens("-f"));
         assertEquals("foo", Util.stripLeadingHyphens("--foo"));

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValueTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValueTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValueTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValueTest.java Thu
May 29 08:30:40 2008
@@ -14,31 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.cli;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+package org.apache.commons.cli;
 
 import java.util.Arrays;
 import java.util.Properties;
 
+import junit.framework.TestCase;
+
 public class ValueTest extends TestCase
 {
-
-    public static Test suite() { 
-        return new TestSuite(ValueTest.class); 
-    }
-
     private CommandLine _cl = null;
-    private CommandLine _clOptional = null;
     private Options opts = new Options();
 
-    public ValueTest(String name)
-    {
-        super(name);
-    }
-
     public void setUp()
     {
         opts.addOption("a",
@@ -100,11 +88,6 @@
         }
     }
 
-    public void tearDown()
-    {
-
-    }
-
     public void testShortNoArg()
     {
         assertTrue( _cl.hasOption("a") );

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValuesTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValuesTest.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValuesTest.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/ValuesTest.java Thu
May 29 08:30:40 2008
@@ -14,13 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import java.util.Arrays;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
 
 public class ValuesTest extends TestCase
 {
@@ -28,15 +27,6 @@
     private CommandLine _cmdline = null;
     private Option _option = null;
 
-    public static Test suite() { 
-        return new TestSuite( ValuesTest.class );
-    }
-
-    public ValuesTest( String name )
-    {
-        super( name );
-    }
-
     public void setUp()
     {
         Options opts = new Options();
@@ -131,11 +121,6 @@
         }
     }
 
-    public void tearDown()
-    {
-
-    }
-
     public void testShortArgs()
     {
         assertTrue( _cmdline.hasOption("a") );

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI133Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI133Test.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI133Test.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI133Test.java
Thu May 29 08:30:40 2008
@@ -14,10 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli.bug;
 
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
+
 import junit.framework.TestCase;
-import org.apache.commons.cli.*;
 
 /**
  * @author brianegge

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI13Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI13Test.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI13Test.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI13Test.java
Thu May 29 08:30:40 2008
@@ -14,9 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli.bug;
 
-import junit.framework.TestCase;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.OptionBuilder;
@@ -24,14 +24,14 @@
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.PosixParser;
 
+import junit.framework.TestCase;
+
 /**
  * @author brianegge
  */
-public class BugCLI13Test
-    extends TestCase
+public class BugCLI13Test extends TestCase
 {
-    public void testCLI13()
-        throws ParseException
+    public void testCLI13() throws ParseException
     {
         final String debugOpt = "debug";
         Option debug = OptionBuilder

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI148Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI148Test.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI148Test.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI148Test.java
Thu May 29 08:30:40 2008
@@ -14,9 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli.bug;
 
-import org.apache.commons.cli.*;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.PosixParser;
+
 import junit.framework.TestCase;
 
 /**

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI18Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI18Test.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI18Test.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI18Test.java
Thu May 29 08:30:40 2008
@@ -14,30 +14,33 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.cli.bug;
 
-import org.apache.commons.cli.*;
+package org.apache.commons.cli.bug;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+
 import junit.framework.TestCase;
 
 /**
  * http://issues.apache.org/jira/browse/CLI-18
  */
-public class BugCLI18Test extends TestCase {
+public class BugCLI18Test extends TestCase
+{
+    public void testCLI18()
+    {
+        Options options = new Options();
+        options.addOption(new Option("a", "aaa", false, "aaaaaaa"));
+        options.addOption(new Option(null, "bbb", false, "bbbbbbb dksh fkshd fkhs dkfhsdk
fhskd hksdks dhfowehfsdhfkjshf skfhkshf sf jkshfk sfh skfh skf f"));
+        options.addOption(new Option("c", null, false, "ccccccc"));
 
-  public void testCLI18() {
-    Options options = new Options();
-    options.addOption(new Option("a","aaa",false,"aaaaaaa"));
-    options.addOption(new Option(null,"bbb",false,"bbbbbbb dksh fkshd fkhs dkfhsdk fhskd
hksdks dhfowehfsdhfkjshf skfhkshf sf jkshfk sfh skfh skf f"));
-    options.addOption(new Option("c",null,false,"ccccccc"));
+        HelpFormatter formatter = new HelpFormatter();
+        StringWriter out = new StringWriter();
 
-    HelpFormatter formatter = new HelpFormatter();
-    StringWriter out = new StringWriter();
-
-    formatter.printHelp(new PrintWriter(out),80, "foobar", "dsfkfsh kdh hsd hsdh fkshdf ksdh
fskdh fsdh fkshfk sfdkjhskjh fkjh fkjsh khsdkj hfskdhf skjdfh ksf khf s", options, 2, 2, "blort
j jgj j jg jhghjghjgjhgjhg jgjhgj jhg jhg hjg jgjhghjg jhg hjg jhgjg jgjhghjg jg jgjhgjgjg
jhg jhgjh" + '\r' + '\n' + "rarrr", true);
-  }
+        formatter.printHelp(new PrintWriter(out), 80, "foobar", "dsfkfsh kdh hsd hsdh fkshdf
ksdh fskdh fsdh fkshfk sfdkjhskjh fkjh fkjsh khsdkj hfskdhf skjdfh ksf khf s", options, 2,
2, "blort j jgj j jg jhghjghjgjhgjhg jgjhgj jhg jhg hjg jgjhghjg jhg hjg jhgjg jgjhghjg jg
jgjhgjgjg jhg jhgjh" + '\r' + '\n' + "rarrr", true);
+    }
 }
-

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI51Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI51Test.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI51Test.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI51Test.java
Thu May 29 08:30:40 2008
@@ -14,38 +14,38 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli.bug;
 
-import junit.framework.TestCase;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.OptionBuilder;
 import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.PosixParser;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Option;
+
+import junit.framework.TestCase;
 
 /**
  * @author brianegge
  */
-public class BugCLI51Test
-    extends TestCase
+public class BugCLI51Test extends TestCase
 {
     public void test() throws Exception
     {
         Options options = buildCommandLineOptions();
         CommandLineParser parser = new PosixParser();
-        String[] args = new String[] {"-t", "-something" };
-        CommandLine commandLine;
-        commandLine = parser.parse( options, args );
-        assertEquals("-something", commandLine.getOptionValue( 't'));
+        String[] args = new String[]{"-t", "-something"};
+
+        CommandLine commandLine = parser.parse(options, args);
+        assertEquals("-something", commandLine.getOptionValue('t'));
     }
 
     private Options buildCommandLineOptions()
     {
-        Option opt = OptionBuilder.withArgName( "t").hasArg().create('t');
+        Option opt = OptionBuilder.withArgName("t").hasArg().create('t');
         Options options = new Options();
-        options.addOption( opt);
+        options.addOption(opt);
         return options;
     }
 }

Modified: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI71Test.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI71Test.java?rev=661358&r1=661357&r2=661358&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI71Test.java
(original)
+++ commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/bug/BugCLI71Test.java
Thu May 29 08:30:40 2008
@@ -14,11 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+
 package org.apache.commons.cli.bug;
 
-import junit.framework.TestCase;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.MissingArgumentException;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.PosixParser;
 
-import org.apache.commons.cli.*;
+import junit.framework.TestCase;
 
 public class BugCLI71Test extends TestCase {
 



Mime
View raw message