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

ValidCommandsListTest

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

Fields Summary
ValidCommandsList
vcl
ValidCommand
vc
Constructors Summary
public ValidCommandsListTest(String name)

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

        if (args.length == 0){
            junit.textui.TestRunner.run(ValidCommandsListTest.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 ValidCommandsListTest(args[i]));
        }
        return ts;
    
private voidnyi()

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

        vcl = new ValidCommandsList();
        vc = new ValidCommand();
    
protected voidtearDown()

    
public voidtestAddGet()

        vcl.addCommand(vc);
        assertEquals(vc, vcl.getValidCommand(null));
    
public voidtestIterator()

        vcl.addCommand(vc);
        for (Iterator it=vcl.getCommands(); it.hasNext();){
            assertEquals(vc, (ValidCommand) it.next());
        }
    
public voidtestRemove()

        vcl.addCommand(vc);
        vcl.removeAllCommands();
        assertNull(vcl.getValidCommand(null));
        assertEquals(0, vcl.size());