commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r661363 - in /commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli: LongOptionWithShort.java PosixParserTest.java
Date Thu, 29 May 2008 15:39:36 GMT
Author: ebourg
Date: Thu May 29 08:39:35 2008
New Revision: 661363

URL: http://svn.apache.org/viewvc?rev=661363&view=rev
Log:
Renamed the test case LongOptionWithShort into PosixParserTest to make it executed by Maven

Added:
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PosixParserTest.java
  (contents, props changed)
      - copied, changed from r661358, commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java
Removed:
    commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java

Copied: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PosixParserTest.java
(from r661358, 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/PosixParserTest.java?p2=commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PosixParserTest.java&p1=commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/LongOptionWithShort.java&r1=661358&r2=661363&rev=661363&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/PosixParserTest.java
Thu May 29 08:39:35 2008
@@ -24,16 +24,13 @@
  * applications command lines focusing on options with
  * long and short names.
  */
-public class LongOptionWithShort extends TestCase {
+public class PosixParserTest extends TestCase {
 
-    public void testLongOptionWithShort() {
+    public void testLongOptionWithShort() throws Exception {
         Option help = new Option("h", "help", false, "print this message");
-        Option version = new Option("v", "version", false,
-                "print version information");
-        Option newRun = new Option("n", "new", false,
-                "Create NLT cache entries only for new items");
-        Option trackerRun = new Option("t", "tracker", false,
-                "Create NLT cache entries only for tracker items");
+        Option version = new Option("v", "version", false, "print version information");
+        Option newRun = new Option("n", "new", false, "Create NLT cache entries only for
new items");
+        Option trackerRun = new Option("t", "tracker", false, "Create NLT cache entries only
for tracker items");
 
         Option timeLimit = OptionBuilder.withLongOpt("limit").hasArg()
                                         .withValueSeparator()
@@ -84,17 +81,12 @@
                 "filename"
             };
 
-        try {
-            CommandLine line = parser.parse(options, args);
-            assertTrue(line.hasOption("v"));
-            assertEquals(line.getOptionValue("l"), "10");
-            assertEquals(line.getOptionValue("limit"), "10");
-            assertEquals(line.getOptionValue("a"), "5");
-            assertEquals(line.getOptionValue("age"), "5");
-            assertEquals(line.getOptionValue("file"), "filename");
-        }
-        catch (ParseException exp) {
-            fail("Unexpected exception:" + exp.getMessage());
-        }
+        CommandLine line = parser.parse(options, args);
+        assertTrue(line.hasOption("v"));
+        assertEquals(line.getOptionValue("l"), "10");
+        assertEquals(line.getOptionValue("limit"), "10");
+        assertEquals(line.getOptionValue("a"), "5");
+        assertEquals(line.getOptionValue("age"), "5");
+        assertEquals(line.getOptionValue("file"), "filename");
     }
 }

Propchange: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PosixParserTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/PosixParserTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message