From: jprocter Date: Fri, 13 Jan 2006 14:06:10 +0000 (+0000) Subject: extracted serial command processing for use by other test classes X-Git-Tag: Release_0.2~413 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e07fbd1d17103a07e04c790291d2b419b1a708ee;p=vamsas.git extracted serial command processing for use by other test classes git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@107 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/org/vamsas/test/simpleclient/ClientsFileTest.java b/src/org/vamsas/test/simpleclient/ClientsFileTest.java index 6ccd736..9ab68ac 100644 --- a/src/org/vamsas/test/simpleclient/ClientsFileTest.java +++ b/src/org/vamsas/test/simpleclient/ClientsFileTest.java @@ -10,162 +10,300 @@ import org.vamsas.client.simpleclient.FileWatcher; import org.vamsas.client.simpleclient.Lock; public class ClientsFileTest { + private static CommandProcessor cproc; + private static Vector commands; static { - ClientsFileTest.commands=new Vector(); + cproc = new CommandProcessor(); + ClientsFileTest.commands = new Vector(); ClientsFileTest.commands.add(new String("add")); + cproc.addCommand("add", 2, "for the Client's 'Name' and 'Version'"); ClientsFileTest.commands.add(new String("remove")); - ClientsFileTest.commands.add(new String("list")); + cproc.addCommand("remove", 3, "for the Client's 'Name', Version and URN"); + ClientsFileTest.commands.add(new String("list")); + cproc.addCommand("list", 0, "no args needed"); ClientsFileTest.commands.add(new String("clear")); - ClientsFileTest.commands.add(new String("watch")); - ClientsFileTest.commands.add(new String("monitor")); + cproc.addCommand("clear", 0, "no args needed"); + ClientsFileTest.commands.add(new String("watch")); + cproc.addCommand("watch", 0, "no args needed"); + ClientsFileTest.commands.add(new String("monitor")); + cproc.addCommand("monitor", 2, "for the Client's 'Name' and 'Version'"); } - private static void complainArgs(int argl, int argpos, String cmd, int argneed, String msg) { - if (argl-argpos2) + complainArgs(args.length, argc+1, comnext); + return com; + } + } + return -1; + + } +}