geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r410478 - in /geronimo/sandbox/gshell/trunk/gshell-core/src: main/java/org/apache/geronimo/gshell/command/CommandDefinition.java test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
Date Wed, 31 May 2006 09:16:20 GMT
Author: jdillon
Date: Wed May 31 02:16:20 2006
New Revision: 410478

URL: http://svn.apache.org/viewvc?rev=410478&view=rev
Log:
Start test for defs

Added:
    geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
  (with props)
Modified:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java?rev=410478&r1=410477&r2=410478&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java
Wed May 31 02:16:20 2006
@@ -30,6 +30,10 @@
     private final String classname;
 
     public CommandDefinition(final Properties props) throws InvalidDefinitionException {
+        if (props == null) {
+            throw new IllegalArgumentException("Properties is null");
+        }
+
         this.name = props.getProperty("name");
         if (name == null) {
             throw new MissingPropertyException("name", props);

Added: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java?rev=410478&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
Wed May 31 02:16:20 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed 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.geronimo.gshell.command;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit tests for the {@link CommandDefinition} class.
+ *
+ * @version $Id$
+ */
+public class CommandDefinitionTest
+    extends TestCase
+{
+    public void testConstructorArgsNull() throws Exception {
+        try {
+            new CommandDefinition(null);
+            fail("Accepted a null value");
+        }
+        catch (IllegalArgumentException expected) {
+            // ignore
+        }
+    }
+
+    //
+    // TODO: Add more tests
+    //
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/CommandDefinitionTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message