geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r573943 - in /geronimo/sandbox/gshell/trunk: gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java gshell-support/gshell-common/src/test/java/org/apache/geronimo/gshell/common/ArgumentsTest.java
Date Sun, 09 Sep 2007 02:10:16 GMT
Author: jdillon
Date: Sat Sep  8 19:10:15 2007
New Revision: 573943

URL: http://svn.apache.org/viewvc?rev=573943&view=rev
Log:
Add some tests for the Arguments class... blah, seems like its not happy shifting()... eh,
whatever...

Added:
    geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/test/java/org/apache/geronimo/gshell/common/ArgumentsTest.java
      - copied, changed from r573906, geronimo/sandbox/gshell/trunk/gshell-support/gshell-ansi/src/test/java/org/apache/geronimo/gshell/ansi/BufferTest.java
Modified:
    geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java

Modified: geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=573943&r1=573942&r2=573943&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Sat Sep  8 19:10:15 2007
@@ -191,8 +191,12 @@
         if (file.exists()) {
             log.debug("Loading user-script: {}", file);
 
+            //
+            // FIXME: For some reason the non-command-line version pukes up and an ArrayStoreException
in Arguments.shift()
+            //
 
             // shell.execute("source", file.toURI().toURL());
+
             shell.execute("source " + file.toURI().toURL());
 
             //

Copied: geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/test/java/org/apache/geronimo/gshell/common/ArgumentsTest.java
(from r573906, geronimo/sandbox/gshell/trunk/gshell-support/gshell-ansi/src/test/java/org/apache/geronimo/gshell/ansi/BufferTest.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/test/java/org/apache/geronimo/gshell/common/ArgumentsTest.java?p2=geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/test/java/org/apache/geronimo/gshell/common/ArgumentsTest.java&p1=geronimo/sandbox/gshell/trunk/gshell-support/gshell-ansi/src/test/java/org/apache/geronimo/gshell/ansi/BufferTest.java&r1=573906&r2=573943&rev=573943&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-support/gshell-ansi/src/test/java/org/apache/geronimo/gshell/ansi/BufferTest.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-support/gshell-common/src/test/java/org/apache/geronimo/gshell/common/ArgumentsTest.java
Sat Sep  8 19:10:15 2007
@@ -17,29 +17,27 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.ansi;
+package org.apache.geronimo.gshell.common;
 
 import junit.framework.TestCase;
 
 /**
- * Tests for the {@link org.apache.geronimo.gshell.ansi.Code} class.
+ * Tests for the {@link Arguments} class.
  *
  * @version $Rev$ $Date$
  */
-public class BufferTest
+public class ArgumentsTest
     extends TestCase
 {
-    public void testIsAnsiEnabledOverride() throws Exception {
-        boolean detected = ANSI.isEnabled();
-        Buffer buff = new Buffer();
+    public void testShift() {
+        Object[] args = { 1, 2, 3, 4 };
 
-        // Make sure the buffer starts out with the system detected value
-        assertEquals(detected, buff.isAnsiEnabled());
+        Object[] shifted = Arguments.shift(args);
 
-        // Then flip it
-        buff.ansiEnabled = !buff.ansiEnabled;
+        assertEquals(args.length - 1, shifted.length);
 
-        // And make sure it sticks
-        assertEquals(!detected, buff.isAnsiEnabled());
+        assertEquals(2, shifted[0]);
+        assertEquals(3, shifted[1]);
+        assertEquals(4, shifted[2]);
     }
 }



Mime
View raw message