Author: ebourg
Date: Fri May 30 02:04:02 2008
New Revision: 661604

URL: http://svn.apache.org/viewvc?rev=661604&view=rev
Log:
Added a test case for BasicParser

Added:
    
commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BasicParserTest.java
   (with props)

Added: 
commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BasicParserTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BasicParserTest.java?rev=661604&view=auto
==============================================================================
--- 
commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BasicParserTest.java
 (added)
+++ 
commons/proper/cli/branches/cli-1.x/src/test/org/apache/commons/cli/BasicParserTest.java
 Fri May 30 02:04:02 2008
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.cli;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Emmanuel Bourg
+ * @version $Revision$, $Date$
+ */
+public class BasicParserTest extends TestCase
+{
+    public void testParser() throws Exception {
+        String[] args = new String[] { "-f", "1" };
+
+        Options options = new Options();
+        options.addOption("f", "foo", true, null);
+
+        CommandLine cl = new BasicParser().parse(options, args);
+
+        assertNotNull("null CommandLine", cl);
+        assertEquals("1", cl.getOptionValue("foo"));
+
+    }
+}

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

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


Reply via email to