From: <cr...@us...> - 2008-11-10 10:30:21
|
Revision: 4696 http://jnode.svn.sourceforge.net/jnode/?rev=4696&view=rev Author: crawley Date: 2008-11-10 10:30:17 +0000 (Mon, 10 Nov 2008) Log Message: ----------- More conversion of commands to use 'execute()' and PrintWriter(s) Modified Paths: -------------- trunk/gui/src/test/org/jnode/test/gui/FBTest.java trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java trunk/shell/src/shell/org/jnode/shell/command/JavaCommand.java trunk/shell/src/shell/org/jnode/shell/command/KillCommand.java trunk/shell/src/shell/org/jnode/shell/command/LoadkeysCommand.java trunk/shell/src/shell/org/jnode/shell/command/LocaleCommand.java trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java trunk/shell/src/shell/org/jnode/shell/command/NamespaceCommand.java trunk/shell/src/shell/org/jnode/shell/command/OnHeapCommand.java trunk/shell/src/shell/org/jnode/shell/command/RunCommand.java trunk/shell/src/shell/org/jnode/shell/command/SetCommand.java trunk/shell/src/shell/org/jnode/shell/command/SleepCommand.java trunk/shell/src/shell/org/jnode/shell/command/SyntaxCommand.java trunk/shell/src/shell/org/jnode/shell/command/ThreadCommand.java trunk/shell/src/test/org/jnode/test/shell/MyAliasCommand.java trunk/shell/src/test/org/jnode/test/shell/MyCatCommand.java trunk/shell/src/test/org/jnode/test/shell/MyCompileCommand.java trunk/shell/src/test/org/jnode/test/shell/MyDirCommand.java trunk/shell/src/test/org/jnode/test/shell/MyDuhCommand.java trunk/shell/src/test/org/jnode/test/shell/help/DefaultHelpTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/AlternativesSyntaxTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentBundleTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentMultiplicityTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentTypesTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/CommandLineTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/DefaultTokenizerTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest2.java trunk/shell/src/test/org/jnode/test/shell/syntax/MuSyntaxTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSetSyntaxTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSyntaxTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/PowersetSyntaxTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/RepeatedSyntaxTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/SequenceSyntaxTest.java trunk/shell/src/test/org/jnode/test/shell/syntax/TestAliasManager.java trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java Modified: trunk/gui/src/test/org/jnode/test/gui/FBTest.java =================================================================== --- trunk/gui/src/test/org/jnode/test/gui/FBTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/gui/src/test/org/jnode/test/gui/FBTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -109,8 +109,7 @@ new FBTest().execute(args); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) { + public void execute() { Device dev = ARG_DEVICE.getValue(); count = ARG_LOOPS.isSet() ? ARG_LOOPS.getValue() : 100; @@ -120,7 +119,7 @@ if (dev == null) { final Collection<Device> devs = DeviceUtils.getDevicesByAPI(FrameBufferAPI.class); if (devs.size() == 0) { - err.println("No framebuffer devices to test"); + getError().getPrintWriter().println("No framebuffer devices to test"); exit(1); } dev = new ArrayList<Device>(devs).get(0); Modified: trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/GcCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,12 +21,9 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; import java.io.PrintWriter; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.EnumArgument; import org.jnode.shell.syntax.FlagArgument; Modified: trunk/shell/src/shell/org/jnode/shell/command/JavaCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/JavaCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/JavaCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -24,8 +24,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -33,7 +32,6 @@ import java.net.URL; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.ClassNameArgument; import org.jnode.shell.syntax.StringArgument; @@ -66,13 +64,13 @@ /** * Execute the command */ - public void execute(CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { - + public void execute() throws Exception { + PrintWriter err = getError().getPrintWriter(); + // Build our classloader final ClassLoader parent_cl = Thread.currentThread().getContextClassLoader(); JCClassLoader cl = new JCClassLoader(parent_cl, new String[]{"./"}); - + Method mainMethod = null; String className = ARG_CLASS.getValue(); try { Modified: trunk/shell/src/shell/org/jnode/shell/command/KillCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/KillCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/KillCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,9 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FlagArgument; import org.jnode.shell.syntax.IntegerArgument; @@ -51,8 +49,8 @@ } @SuppressWarnings("deprecation") - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { + PrintWriter out = getError().getPrintWriter(); boolean debug = FLAG_DEBUG.isSet(); int threadId = ARG_THREADID.getValue(); if (debug) { Modified: trunk/shell/src/shell/org/jnode/shell/command/LoadkeysCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/LoadkeysCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/LoadkeysCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,8 +21,7 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import java.util.Collection; import org.jnode.driver.Device; @@ -33,7 +32,6 @@ import org.jnode.driver.input.KeyboardLayoutManager; import org.jnode.naming.InitialNaming; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.help.SyntaxErrorException; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.ClassNameArgument; @@ -90,8 +88,9 @@ /** * Execute this command */ - public void execute(CommandLine cmdLine, InputStream in, PrintStream out, - PrintStream err) throws Exception { + public void execute() throws Exception { + PrintWriter out = getOutput().getPrintWriter(); + PrintWriter err = getError().getPrintWriter(); final KeyboardLayoutManager mgr = InitialNaming.lookup(KeyboardLayoutManager.NAME); final Collection<Device> kbDevs = DeviceUtils.getDevicesByAPI(KeyboardAPI.class); Modified: trunk/shell/src/shell/org/jnode/shell/command/LocaleCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/LocaleCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/LocaleCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,15 +21,13 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import java.util.Arrays; import java.util.Comparator; import java.util.Locale; import java.util.TreeSet; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.CountryArgument; import org.jnode.shell.syntax.FlagArgument; @@ -63,8 +61,8 @@ } @Override - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { + PrintWriter out = getOutput().getPrintWriter(); if (ARG_LANGUAGE.isSet()) { final String language = ARG_LANGUAGE.getValue(); @@ -73,7 +71,8 @@ Locale locale = findLocale(language, country, variant); if (locale == null) { - err.println("No Locale is available for " + language + " " + country + " " + variant); + getError().getPrintWriter().println( + "No Locale is available for " + language + " " + country + " " + variant); exit(1); } out.println("Setting default Locale to " + formatLocale(locale)); @@ -90,7 +89,7 @@ * * @param out destination for the listing */ - private void listLocales(PrintStream out) { + private void listLocales(PrintWriter out) { // (The getAvailableLocales() method returns a cloned array ...) Locale[] locales = Locale.getAvailableLocales(); TreeSet<Locale> treeSet = new TreeSet<Locale>(new Comparator<Locale>() { Modified: trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,9 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.util.NumberUtils; /** @@ -43,8 +41,8 @@ /** * Execute this command */ - public void execute(CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { + PrintWriter out = getOutput().getPrintWriter(); final Runtime rt = Runtime.getRuntime(); out.println("Total memory " + NumberUtils.toBinaryByte(rt.totalMemory())); out.println("Used memory " + NumberUtils.toBinaryByte(rt.totalMemory() - rt.freeMemory())); Modified: trunk/shell/src/shell/org/jnode/shell/command/NamespaceCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/NamespaceCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/NamespaceCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,13 +21,11 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import java.util.Set; import org.jnode.naming.InitialNaming; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; /** * @author epr @@ -45,9 +43,8 @@ /** * Execute this command */ - public void execute(CommandLine cmdLine, InputStream in, PrintStream out, - PrintStream err) throws Exception { - + public void execute() throws Exception { + PrintWriter out = getOutput().getPrintWriter(); Set<Class< ? >> names = InitialNaming.nameSet(); for (Class< ? > name : names) { out.println(name); Modified: trunk/shell/src/shell/org/jnode/shell/command/OnHeapCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/OnHeapCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/OnHeapCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,9 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.IntegerArgument; import org.jnode.shell.syntax.LongArgument; @@ -56,8 +54,8 @@ * Execute this command */ @Override - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { + PrintWriter out = getOutput().getPrintWriter(); out.println("on heap:"); final HeapStatistics stats = Vm.getHeapManager().getHeapStatistics(); Modified: trunk/shell/src/shell/org/jnode/shell/command/RunCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/RunCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/RunCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,13 +21,11 @@ package org.jnode.shell.command; import java.io.File; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import javax.naming.NameNotFoundException; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.Shell; import org.jnode.shell.ShellUtils; import org.jnode.shell.syntax.Argument; @@ -53,8 +51,8 @@ } @Override - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { + final PrintWriter err = getError().getPrintWriter(); final File file = ARG_FILE.getValue(); Shell shell = null; Modified: trunk/shell/src/shell/org/jnode/shell/command/SetCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/SetCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/SetCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,9 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.PropertyNameArgument; import org.jnode.shell.syntax.StringArgument; @@ -54,8 +52,8 @@ new SetCommand().execute(args); } - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { + PrintWriter out = getOutput().getPrintWriter(); String key = keyArg.getValue(); if (!valueArg.isSet()) { out.println("Removing " + key); Modified: trunk/shell/src/shell/org/jnode/shell/command/SleepCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/SleepCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/SleepCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,7 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; - import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.IntegerArgument; @@ -49,8 +45,7 @@ new SleepCommand().execute(args); } - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { Integer seconds = SECONDS_ARG.getValue(); if (seconds > 0) { Thread.sleep(seconds * 1000); Modified: trunk/shell/src/shell/org/jnode/shell/command/SyntaxCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/SyntaxCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/SyntaxCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -25,15 +25,11 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStreamWriter; -import java.io.PrintStream; -import java.io.Writer; +import java.io.PrintWriter; import java.util.Hashtable; import org.jnode.nanoxml.XMLElement; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.ShellUtils; import org.jnode.shell.syntax.AliasArgument; import org.jnode.shell.syntax.Argument; @@ -74,8 +70,9 @@ new SyntaxCommand().execute(args); } - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { + PrintWriter out = getOutput().getPrintWriter(); + PrintWriter err = getError().getPrintWriter(); SyntaxManager synMgr = ShellUtils.getCurrentSyntaxManager(); if (ARG_DUMP_ALL.isSet()) { for (String alias : synMgr.getKeys()) { @@ -130,7 +127,7 @@ return ARG_ALIAS.getValue(); } - private void dumpSyntax(String alias, SyntaxBundle bundle, PrintStream out) + private void dumpSyntax(String alias, SyntaxBundle bundle, PrintWriter out) throws IOException { XMLElement element = new XMLElement(new Hashtable<String, Object>(), false, false); element.setName("syntax"); @@ -143,9 +140,7 @@ for (Syntax syntax : syntaxes) { element.addChild(syntax.toXML()); } - Writer writer = new OutputStreamWriter(out); - element.write(writer); - writer.flush(); + element.write(out); out.println(); } Modified: trunk/shell/src/shell/org/jnode/shell/command/ThreadCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/ThreadCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/shell/org/jnode/shell/command/ThreadCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,9 @@ package org.jnode.shell.command; -import java.io.InputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FlagArgument; import org.jnode.shell.syntax.ThreadNameArgument; @@ -61,8 +59,7 @@ /** * Execute this command */ - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { // If threadName is null, we'll print all threads String threadName = (ARG_NAME.isSet()) ? ARG_NAME.getValue() : null; boolean dump = FLAG_GROUP_DUMP.isSet(); @@ -74,11 +71,13 @@ } if (dump) { - // Produce an ugly (but useful) ThreadGroup dump + // Produce an ugly (but useful) ThreadGroup dump. Unfortunately, + // it goes to System.out, and we cannot fix it w/o changing a Java + // standard API. grp.list(); } else { // Show the threads in the ThreadGroup tree. - showThreads(grp, out, threadName); + showThreads(grp, getOutput().getPrintWriter(), threadName); } } @@ -91,7 +90,7 @@ * @param out the destination for output * @param threadName if non-null, only display this thread. */ - private void showThreads(ThreadGroup grp, PrintStream out, String threadName) { + private void showThreads(ThreadGroup grp, PrintWriter out, String threadName) { if (threadName == null) { out.println(GROUP + grp.getName()); } Modified: trunk/shell/src/test/org/jnode/test/shell/MyAliasCommand.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/MyAliasCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/MyAliasCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,7 @@ package org.jnode.test.shell; -import java.io.InputStream; -import java.io.PrintStream; - import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.AliasArgument; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.ClassNameArgument; @@ -47,7 +43,6 @@ registerArguments(ARG_ALIAS, ARG_CLASS, ARG_REMOVE); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { } } Modified: trunk/shell/src/test/org/jnode/test/shell/MyCatCommand.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/MyCatCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/MyCatCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,7 @@ package org.jnode.test.shell; -import java.io.InputStream; -import java.io.PrintStream; - import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.Syntax; @@ -61,8 +57,7 @@ }); - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { } } Modified: trunk/shell/src/test/org/jnode/test/shell/MyCompileCommand.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/MyCompileCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/MyCompileCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -1,10 +1,6 @@ package org.jnode.test.shell; -import java.io.InputStream; -import java.io.PrintStream; - import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.ClassNameArgument; import org.jnode.shell.syntax.FlagArgument; @@ -27,9 +23,7 @@ } @Override - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { // nothing to see here, move along } Modified: trunk/shell/src/test/org/jnode/test/shell/MyDirCommand.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/MyDirCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/MyDirCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,7 @@ package org.jnode.test.shell; -import java.io.InputStream; -import java.io.PrintStream; - import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.help.Help; import org.jnode.shell.help.Parameter; import org.jnode.shell.help.argument.FileArgument; @@ -42,7 +38,7 @@ "List the entries of the given path", new Parameter[]{new Parameter(ARG_PATH, Parameter.OPTIONAL)}); - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { + // suddenly ... nothing happened } } Modified: trunk/shell/src/test/org/jnode/test/shell/MyDuhCommand.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/MyDuhCommand.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/MyDuhCommand.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,11 +21,7 @@ package org.jnode.test.shell; -import java.io.InputStream; -import java.io.PrintStream; - import org.jnode.shell.AbstractCommand; -import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FileArgument; @@ -41,7 +37,7 @@ registerArguments(ARG_PATH); } - public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) - throws Exception { + public void execute() throws Exception { + // Well duh ... } } Modified: trunk/shell/src/test/org/jnode/test/shell/help/DefaultHelpTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/help/DefaultHelpTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/help/DefaultHelpTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -24,6 +24,7 @@ import java.io.PrintWriter; import junit.framework.TestCase; + import org.jnode.shell.help.def.DefaultHelp; /** Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/AlternativesSyntaxTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/AlternativesSyntaxTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/AlternativesSyntaxTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -52,8 +51,7 @@ registerArguments(fileArg, intArg, flagArg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentBundleTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentBundleTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentBundleTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -22,7 +22,9 @@ package org.jnode.test.shell.syntax; import java.io.File; + import junit.framework.TestCase; + import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.ArgumentBundle; import org.jnode.shell.syntax.FileArgument; Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentMultiplicityTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentMultiplicityTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentMultiplicityTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -44,9 +43,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } @@ -57,9 +55,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } @@ -71,9 +68,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } @@ -85,9 +81,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentTypesTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentTypesTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/ArgumentTypesTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -59,9 +58,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } @@ -97,9 +95,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/CommandLineTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/CommandLineTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/CommandLineTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,15 +21,14 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; import org.jnode.shell.CommandLine; -import org.jnode.shell.CommandLine.Token; import org.jnode.shell.SymbolSource; +import org.jnode.shell.CommandLine.Token; import org.jnode.shell.syntax.ArgumentSyntax; import org.jnode.shell.syntax.StringArgument; @@ -102,9 +101,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/DefaultTokenizerTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/DefaultTokenizerTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/DefaultTokenizerTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -22,7 +22,9 @@ package org.jnode.test.shell.syntax; import java.util.NoSuchElementException; + import junit.framework.TestCase; + import org.jnode.shell.CommandLine; import org.jnode.shell.DefaultInterpreter; import org.jnode.shell.ShellException; Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,6 +21,7 @@ package org.jnode.test.shell.syntax; import junit.framework.TestCase; + import org.jnode.shell.CommandLine; import org.jnode.shell.NoTokensAvailableException; import org.jnode.shell.syntax.CommandSyntaxException; Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest2.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest2.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/MuParserTest2.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -22,7 +22,9 @@ package org.jnode.test.shell.syntax; import java.io.File; + import junit.framework.TestCase; + import org.jnode.shell.CommandLine; import org.jnode.shell.NoTokensAvailableException; import org.jnode.shell.syntax.Argument; Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/MuSyntaxTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/MuSyntaxTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/MuSyntaxTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -22,6 +22,7 @@ package org.jnode.test.shell.syntax; import junit.framework.TestCase; + import org.jnode.shell.syntax.MuAlternation; import org.jnode.shell.syntax.MuArgument; import org.jnode.shell.syntax.MuBackReference; Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSetSyntaxTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSetSyntaxTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSetSyntaxTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -57,8 +56,7 @@ registerArguments(fileArg, intArg, flagArg1, flagArg2, flagArg3, flagArg4); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSyntaxTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSyntaxTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/OptionSyntaxTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -52,8 +51,7 @@ registerArguments(fileArg, intArg, flagArg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/PowersetSyntaxTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/PowersetSyntaxTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/PowersetSyntaxTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -50,8 +49,7 @@ registerArguments(fileArg, intArg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/RepeatedSyntaxTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/RepeatedSyntaxTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/RepeatedSyntaxTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -46,9 +45,8 @@ registerArguments(arg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { - out.print(arg.getValue()); + public void execute() throws Exception { + getOutput().getPrintWriter().print(arg.getValue()); } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/SequenceSyntaxTest.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/SequenceSyntaxTest.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/SequenceSyntaxTest.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -21,9 +21,8 @@ package org.jnode.test.shell.syntax; -import java.io.InputStream; -import java.io.PrintStream; import junit.framework.TestCase; + import org.jnode.shell.AbstractCommand; import org.jnode.shell.Command; import org.jnode.shell.CommandInfo; @@ -50,8 +49,7 @@ registerArguments(fileArg, intArg); } - public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) throws Exception { + public void execute() throws Exception { } } Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/TestAliasManager.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/TestAliasManager.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/TestAliasManager.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -25,6 +25,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; + import org.jnode.shell.alias.AliasManager; import org.jnode.shell.alias.NoSuchAliasException; Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java 2008-11-10 10:12:31 UTC (rev 4695) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java 2008-11-10 10:30:17 UTC (rev 4696) @@ -23,6 +23,7 @@ import java.util.Collection; import java.util.HashMap; + import org.jnode.shell.syntax.SyntaxBundle; import org.jnode.shell.syntax.SyntaxManager; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |