FileDocCategorySizeDatePackage
CommandValidatorTest.javaAPI DocGlassfish v2 API4681Fri May 04 22:25:30 BST 2007com.sun.enterprise.cli.framework

CommandValidatorTest

public class CommandValidatorTest extends TestCase
author
Toby H Ferguson
version
$Revision: 1.5 $

Fields Summary
CommandValidator
cv
Constructors Summary
public CommandValidatorTest(String name)

        super(name);
    
Methods Summary
public static voidmain(java.lang.String[] args)

        if (args.length == 0){
            junit.textui.TestRunner.run(CommandValidatorTest.class);
        } else {
            junit.textui.TestRunner.run(makeSuite(args));
        }
    
private static junit.framework.TestSuitemakeSuite(java.lang.String[] args)

        final TestSuite ts = new TestSuite();
        for (int i = 0; i < args.length; i++){
            ts.addTest(new CommandValidatorTest(args[i]));
        }
        return ts;
    
private voidnyi()

        fail("Not Yet Implemented");
    
protected voidsetUp()

         cv = new CommandValidator();
    
protected voidtearDown()

    
public voidtestValidCommand1()

        final Vector vos = new Vector();
        vos.add(new ValidOption("vo", "String", 1, ""));
        final Vector ros = new Vector();
        ros.add(new ValidOption("ro", "Integer", 0, ""));
		final Vector dos = new Vector();
        final ValidCommand vc = new ValidCommand("name", "3", vos, ros, dos, "useage");
        cv.validateCommandAndOptions(vc, new HashMap(),
                                     new Vector(Arrays.asList(new String[] {"1", "2", "3"})));
    
public voidtestValidCommand2()

        final Vector vos = new Vector();
        vos.add(new ValidOption("vo", "foo", 0, "value"));
        final Vector ros = new Vector();
        ros.add(new ValidOption("ro", "fee", 1, "v"));
		final Vector dos = new Vector();
        final ValidCommand vc = new ValidCommand("name", "*", vos, ros, dos, "useage");
        cv.validateCommandAndOptions(vc, new HashMap(), new Vector());
    
public voidtestValidCommand3()

        final Vector vos = new Vector();
        vos.add(new ValidOption("vo", "foo", 0, "value"));
        final Vector ros = new Vector();
        ros.add(new ValidOption("ro", "fee", 1, "v"));
		final Vector dos = new Vector();
        final ValidCommand vc = new ValidCommand("name", "*", vos, ros, dos, "useage");
        cv.validateCommandAndOptions(vc, new HashMap(), new Vector());
    
public voidtestValidCommandWithSimpleConstructors()

        final ValidCommand vc = new ValidCommand();
        //cv.validateCommandAndOptions(vc, new HashMap(), new Vector());