FileDocCategorySizeDatePackage
FrameHolderTest.javaAPI DocGlassfish v2 API4316Fri May 04 22:24:40 BST 2007com.sun.enterprise.config.serverbeans.validation

FrameHolderTest

public class FrameHolderTest extends TestCase
author
Toby H Ferguson
version
$Revision: 1.4 $

Fields Summary
Constructors Summary
public FrameHolderTest(String name)

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

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

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

    
protected voidtearDown()

    
public voidtestBasics()

        FrameHolder fh = new FrameHolder();
        assertNotNull(fh.getDomainFrame());
        fh.getDomainFrame().put("k", "v");
        assertNotNull(fh.getConfigFrame("config0"));
        fh.getConfigFrame("config0").inheritFrom(fh.getDomainFrame());
        assertEquals("v", fh.getConfigFrame("config0").lookup("k"));
        assertNotNull(fh.getConfigFrame("config1"));
        assertFalse(fh.getConfigFrame("config0").equals(fh.getConfigFrame("config1")));
        assertNotNull(fh.getServerFrame("frame0"));
        fh.getServerFrame("frame0").inheritFrom(fh.getConfigFrame("config0"));
        assertEquals("v", fh.getServerFrame("frame0").lookup("k"));
        assertNotNull(fh.getClusterFrame("frame0"));
        fh.getConfigFrame("config1").put("k", "config");
        fh.getClusterFrame("frame0").inheritFrom(fh.getConfigFrame("config1"));
        fh.getServerFrame("frame1").inheritFrom(fh.getClusterFrame("frame0"));
        assertEquals("config", fh.getServerFrame("frame1").lookup("k"));
    
public voidtestEquality()

        FrameHolder fh1 = new FrameHolder();
        FrameHolder fh2 = new FrameHolder();
        assertEquals(fh1, fh2);
        assertFalse(fh1.equals(new Object()));
        assertFalse(fh1.equals(null));
        assertEquals(fh1, fh1);
        fh1.getDomainFrame().put("k", "v");
        assertFalse(fh1.equals(fh2));
        assertFalse(fh2.equals(fh1));