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

ValidOptionTest

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

Fields Summary
ValidOption
vo
Constructors Summary
public ValidOptionTest(String name)

        super(name);
    
Methods Summary
public static voidassertFalse(boolean t)

        assertTrue(!t);
    
public static voidmain(java.lang.String[] args)

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

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

        vo = new ValidOption();
    
protected voidtearDown()

    
public voidtestDefault()

        assertFalse(vo.hasDefaultValue());
        vo.setDefaultValue("def");
        assertEquals("def", vo.getDefaultValue());
        assertTrue(vo.hasDefaultValue());
    
public voidtestName()

        assertNull(vo.getName());
        vo.setName("foo");
        assertEquals("foo", vo.getName());
    
public voidtestRequired()

        assertEquals(0, vo.isValueRequired());
        vo.setRequired(12345);
        assertEquals(12345, vo.isValueRequired());
    
public voidtestShortNames()

        assertTrue(vo.getShortNames().isEmpty());
        assertFalse(vo.hasShortName());
        vo.setShortName("foo");
        assertEquals(1, vo.getShortNames().size());
        assertTrue(vo.getShortNames().contains("foo"));
        assertTrue(vo.hasShortName());
    
public voidtestToString()

        assertEquals("null null  null", vo.toString());
        vo.setShortName("foo");
        assertEquals("null null foo, null", vo.toString());
    
public voidtestType()

        assertNull(vo.getType());
        vo.setType("t1");
        assertEquals("t1", vo.getType());