geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r411391 - in /geronimo/sandbox/gshell/trunk: gshell-assemblies/gshell-assembly/ gshell-commands/gshell-scripting-commands/ gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/ gshell-testsuite...
Date Sat, 03 Jun 2006 06:34:40 GMT
Author: jdillon
Date: Fri Jun  2 23:34:40 2006
New Revision: 411391

URL: http://svn.apache.org/viewvc?rev=411391&view=rev
Log:
Added simple test... more as a placeholder for future integration tests
Fixed bug found in echo command thanks to tests

Added:
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/java/org/apache/geronimo/gshell/testsuite/
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/java/org/apache/geronimo/gshell/testsuite/EchoCommandTest.java
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties   (with
props)
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/org/
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/org/apache/
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/org/apache/geronimo/
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/org/apache/geronimo/gshell/
    geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/org/apache/geronimo/gshell/testsuite/
Modified:
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-assembly/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-scripting-commands/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/EchoCommand.java
    geronimo/sandbox/gshell/trunk/gshell-testsuite/pom.xml

Modified: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-assembly/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-assembly/pom.xml?rev=411391&r1=411390&r2=411391&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-assembly/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-assembly/pom.xml Fri Jun  2 23:34:40
2006
@@ -27,7 +27,7 @@
             <version>${pom.version}</version>
         </dependency>
         
-	    <dependency>
+        <dependency>
             <groupId>${pom.groupId}</groupId>
             <artifactId>gshell-cli</artifactId>
             <version>${pom.version}</version>

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-scripting-commands/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-scripting-commands/pom.xml?rev=411391&r1=411390&r2=411391&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-scripting-commands/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-scripting-commands/pom.xml Fri Jun
 2 23:34:40 2006
@@ -21,6 +21,14 @@
     <packaging>jar</packaging>
 
     <dependencies>
+
+        <!-- FIXME: Need to abstract InteractiveConsole and move it to API, until then
depend on core -->
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>gshell-core</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>bsf</groupId>
             <artifactId>bsf</artifactId>

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/EchoCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/EchoCommand.java?rev=411391&r1=411390&r2=411391&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/EchoCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/EchoCommand.java
Fri Jun  2 23:34:40 2006
@@ -95,9 +95,11 @@
     private void echo(final String[] args) {
         IO io = getIO();
 
-        for (String arg : args) {
-            io.out.print(arg);
-            io.out.print(" ");
+        for (int i=0; i < args.length; i++) {
+            io.out.print(args[i]);
+            if (i + 1 < args.length) {
+                io.out.print(" ");
+            }
         }
         
         if (trailingNewline) {

Modified: geronimo/sandbox/gshell/trunk/gshell-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-testsuite/pom.xml?rev=411391&r1=411390&r2=411391&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-testsuite/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-testsuite/pom.xml Fri Jun  2 23:34:40 2006
@@ -29,13 +29,31 @@
         
         <dependency>
             <groupId>${pom.groupId}</groupId>
-            <artifactId>gshell-server</artifactId>
+            <artifactId>gshell-cli</artifactId>
             <version>${pom.version}</version>
         </dependency>
-        
+
         <dependency>
             <groupId>${pom.groupId}</groupId>
-            <artifactId>gshell-commands</artifactId>
+            <artifactId>gshell-server-core</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>gshell-server-telnet</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>gshell-standard-commands</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>gshell-scripting-commands</artifactId>
             <version>${pom.version}</version>
         </dependency>
     </dependencies>

Added: geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/java/org/apache/geronimo/gshell/testsuite/EchoCommandTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/java/org/apache/geronimo/gshell/testsuite/EchoCommandTest.java?rev=411391&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/java/org/apache/geronimo/gshell/testsuite/EchoCommandTest.java
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/java/org/apache/geronimo/gshell/testsuite/EchoCommandTest.java
Fri Jun  2 23:34:40 2006
@@ -0,0 +1,50 @@
+/*
+ * 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.testsuite;
+
+import junit.framework.TestCase;
+import org.apache.geronimo.gshell.Shell;
+import org.apache.geronimo.gshell.console.IO;
+
+import java.io.ByteArrayOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
+import java.io.BufferedReader;
+
+/**
+ * ???
+ *
+ * @version $Id$
+ */
+public class EchoCommandTest
+    extends TestCase
+{
+    public void testSimple() throws Exception {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        IO io = new IO(System.in, out);
+
+        Shell shell = new Shell(io);
+        shell.execute("echo", "1");
+
+        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+
+        String line1 = reader.readLine();
+        assertNotNull(line1);
+        assertEquals("1", line1);
+    }
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/java/org/apache/geronimo/gshell/testsuite/EchoCommandTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties?rev=411391&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties (added)
+++ geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties Fri
Jun  2 23:34:40 2006
@@ -0,0 +1,19 @@
+##
+## $Id$
+##
+
+log4j.rootCategory=DEBUG, CONSOLE
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Target=System.out
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
+
+log4j.appender.FILE=org.apache.log4j.FileAppender
+log4j.appender.FILE.File=${basedir}/target/test.log
+log4j.appender.FILE.Append=false
+log4j.appender.FILE.Threshold=DEBUG
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p (%t) [%c] %m%n
+

Propchange: geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-testsuite/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message