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

OptionsMapTest

public class OptionsMapTest extends TestCase
author
Jane Young
version
$Revision: 1.2 $

Fields Summary
OptionsMap
om
Constructors Summary
public OptionsMapTest(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(OptionsMapTest.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 OptionsMapTest(args[i]));
        }
        return ts;
    
private voidnyi()

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

        om = new OptionsMap();
        om.addOptionValue("one", "1");
        om.addCLValue("two", "2");
        om.addEnvValue("three", "3");
        om.addPrefValue("four", "4");
        om.addDefaultValue("five", "5");        
    
protected voidtearDown()

    
public voidtestContainsName()

        assertTrue(om.containsName("one"));
        assertFalse(om.containsName("ten"));        
    
public voidtestGetCLOptions()

        Map m = new HashMap();
        m.put("two", "2");
        assertEquals(m, om.getCLOptions());        
    
public voidtestGetDefaultOptions()

        Map m = new HashMap();
        m.put("five", "5");
        assertEquals(m, om.getDefaultOptions());        
    
public voidtestGetEnvOptions()

        Map m = new HashMap();
        m.put("three", "3");
        assertEquals(m, om.getEnvOptions());        
    
public voidtestGetOption()

        assertEquals("1", om.getOption("one"));
        assertEquals("2", om.getOption("two"));
        assertEquals("3", om.getOption("three"));
        assertEquals("4", om.getOption("four"));
        assertEquals("5", om.getOption("five"));                
    
public voidtestGetOptions()

        Map m = new HashMap();
        m.put("one", "1");
        m.put("two", "2");
        m.put("three", "3");
        m.put("four", "4");
        m.put("five", "5");                        
        assertEquals(m, om.getOptions());
    
public voidtestGetOtherOptions()

        Map m = new HashMap();
        m.put("one", "1");
        assertEquals(m, om.getOtherOptions());        
    
public voidtestNameSet()

        Set<String> s = new HashSet<String>();
        s.add("one");
        s.add("two");
        s.add("three");
        s.add("four");
        s.add("five");        
        assertEquals(s, om.nameSet());
    
public voidtestRemove()

        om.addOptionValue("six", "6");
        assertTrue(om.containsName("six"));
        om.remove("six");
        assertFalse(om.containsName("six"));        
    
public voidtestToString()

        assertEquals("<one,1>\n<two,2>\n<five,5>\n<four,4>\n<three,3>\n", om.toString());