Author: pidster
Date: Tue Jan 11 13:51:39 2011
New Revision: 1057631
URL: http://svn.apache.org/viewvc?rev=1057631&view=rev
Log:
Add test to new location
Added:
incubator/kitty/trunk/src/test/
incubator/kitty/trunk/src/test/java/
incubator/kitty/trunk/src/test/java/org/
incubator/kitty/trunk/src/test/java/org/apache/
incubator/kitty/trunk/src/test/java/org/apache/kitty/
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy
(with props)
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java (with
props)
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy
(with props)
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java
(with props)
Added:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy
URL:
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy?rev=1057631&view=auto
==============================================================================
---
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy
(added)
+++
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy
Tue Jan 11 13:51:39 2011
@@ -0,0 +1,57 @@
+/*
+ * 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.kitty.test;
+
+import groovy.util.GroovyTestCase;
+
+/**
+ *
+ * @version $Id: ClientTest0.groovy 1041618 2010-12-02 22:31:53Z pidster $
+ *
+ */
+class ClientTest extends GroovyTestCase {
+
+ /**
+ * @param name
+ */
+ public ClientTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
+
+ /**
+ * Test method for {...@link
org.apache.kitty.client.Client#connect(java.lang.Object, java.lang.Object)}.
+ */
+ public final void testConnect(){
+ fail("Not yet implemented"); // TODO
+ }
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy
------------------------------------------------------------------------------
svn:keywords = "Id Author Date Rev"
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/ClientTest0.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java
URL:
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java?rev=1057631&view=auto
==============================================================================
--- incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java (added)
+++ incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java Tue Jan
11 13:51:39 2011
@@ -0,0 +1,42 @@
+/*
+ * 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.kitty.test;
+
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.management.ObjectName;
+import javax.management.MBeanInfo;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+import java.lang.management.ManagementFactory;
+import javax.management.AttributeNotFoundException;
+
+/**
+ * <pre>
+ * Test some simple concepts and assumptions here
+ * </pre>
+ *
+ * @version $Id$
+ *
+ */
+public class Test {
+
+}
Propchange: incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java
------------------------------------------------------------------------------
svn:keywords = "Id Author Date Rev"
Propchange: incubator/kitty/trunk/src/test/java/org/apache/kitty/test/Test.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy
URL:
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy?rev=1057631&view=auto
==============================================================================
---
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy
(added)
+++
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy
Tue Jan 11 13:51:39 2011
@@ -0,0 +1,146 @@
+/*
+* 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.kitty.test
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import org.apache.kitty.utils.Help;
+
+/**
+ * @version $Id: TestGroovyShell.groovy 1041619 2010-12-02 22:33:28Z pidster $
+ *
+ */
+class TestGroovyShell {
+
+ def static final PROMPT = "kitty>"
+ static InputStreamReader inReader;
+ static BufferedReader bReader;
+ static commands = ["help", "connect", "disconnect", "exit", "ls",
"echo"]
+
+ /**
+ *
+ */
+ public TestGroovyShell() {
+ // TODO Auto-generated constructor stub
+ }
+
+
+ static main(args) {
+ startShell()
+ }
+
+ static startShell()
+ {
+ def input
+ this.inReader = new InputStreamReader(System.in)
+ this.bReader = new BufferedReader(inReader)
+
+ while(!(input.equals("exit")))
+ {
+ print PROMPT
+ input = getUserInput()
+ inputHandler(input)
+ }
+ this.inReader.close()
+ this.bReader.close()
+
+ }
+
+ static inputHandler(String input)
+ {
+ //print input
+
+ Integer index = 0
+
+ if(this.commands.contains(input))
+ {
+ index = commands.indexOf(input)
+ //println "The index is" + index
+
+ switch(index)
+ {
+ case 0:
+ cmdHelp()
+ break;
+ case 1:
+ cmdConnect()
+ break;
+ case 2:
+ cmdDisconnect()
+ break;
+ case 3:
+ cmdExit()
+ break;
+ case 4:
+ cmdLs()
+ break;
+ case 5:
+ cmdEcho(input)
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ println input + " is not a valid command"
+ }
+
+
+ }
+
+ static String getUserInput()
+ {
+ def userInput
+ userInput = bReader.readLine()
+ return userInput;
+ }
+
+ static cmdHelp()
+ {
+ Help h = new Help()
+ println h.toString()
+ }
+
+ static cmdConnect()
+ {
+ println "connecting...."
+ }
+
+ static cmdDisconnect()
+ {
+ println "disconnecting..."
+ }
+
+ static cmdExit()
+ {
+ println "exiting..."
+ }
+
+ static cmdLs()
+ {
+ println "listing files and directories..."
+ }
+
+ static cmdEcho(def input)
+ {
+ println input
+ }
+
+}
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy
------------------------------------------------------------------------------
svn:keywords = "Id Author Date Rev"
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestGroovyShell.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java
URL:
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java?rev=1057631&view=auto
==============================================================================
--- incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java
(added)
+++ incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java
Tue Jan 11 13:51:39 2011
@@ -0,0 +1,105 @@
+/*
+ * 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.kitty.test;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+/**
+ * @version $Id$
+ *
+ */
+public class TestShell {
+
+ protected static final String PROMPT = "kitty>";
+ static InputStreamReader inReader;
+ static BufferedReader bReader;
+
+ /**
+ *
+ */
+ public TestShell() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ startShell();
+
+ }
+
+ public static void startShell()
+ {
+ String input = "";
+ inReader = new InputStreamReader(System.in);
+ bReader = new BufferedReader(inReader);
+ while(!(input.equals("exit")))
+ {
+ getPrompt();
+ input = getUserInput();
+ validateInput(input);
+ processInput(input);
+ }
+
+ try
+ {
+ inReader.close();
+ bReader.close();
+ }
+ catch(IOException ioe)
+ {
+ System.err.println(ioe.getMessage());
+ }
+ System.out.println("kitty session terminated");
+ }
+
+ public static void getPrompt()
+ {
+ System.out.print(PROMPT);
+ }
+
+ public static String getUserInput()
+ {
+ String userInput = null;
+ try
+ {
+ userInput = bReader.readLine();
+ }
+ catch(IOException ioe)
+ {
+ System.err.println(ioe.getMessage());
+ }
+
+ return userInput;
+ }
+
+ private static void validateInput(String input)
+ {
+ //TODO
+ }
+
+ private static void processInput(String input)
+ {
+ //TODO
+ }
+
+}
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java
------------------------------------------------------------------------------
svn:keywords = "Id Author Date Rev"
Propchange:
incubator/kitty/trunk/src/test/java/org/apache/kitty/test/TestShell.java
------------------------------------------------------------------------------
svn:mime-type = text/plain