Package org.apache.tapestry.model

Examples of org.apache.tapestry.model.MutableComponentModel


        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);

        assertEquals(parent.setFieldPersistenceStrategy("wilma", "session"), "wilma");

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);

        assertEquals(model.setFieldPersistenceStrategy("fred", "session"), "fred");
        assertEquals(model.setFieldPersistenceStrategy("barney", "client"), "barney");

        assertEquals(model.getPersistentFieldNames(), Arrays.asList("barney", "fred", "wilma"));

        verify();
    }
View Full Code Here


        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
        assertEquals(parent.setFieldPersistenceStrategy("wilma", "session"), "wilma");

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);

        assertEquals(model.setFieldPersistenceStrategy("wilma", "session"), "wilma_0");

        assertEquals(model.getPersistentFieldNames(), Arrays.asList("wilma", "wilma_0"));

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);

        model.setFieldPersistenceStrategy("fred", "session");
        model.setFieldPersistenceStrategy("barney", "client");

        assertEquals(model.getFieldPersistenceStrategy("fred"), "session");
        assertEquals(model.getFieldPersistenceStrategy("barney"), "client");

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);

        try
        {
            model.getFieldPersistenceStrategy("someField");
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);

        parent.setFieldPersistenceStrategy("wilma", "parent");

        model.setFieldPersistenceStrategy("fred", "session");

        assertEquals(model.getFieldPersistenceStrategy("wilma"), "parent");

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);

        assertFalse(model.getSupportsInformalParameters());

        model.enableSupportsInformalParameters();

        assertTrue(model.getSupportsInformalParameters());

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);

        parent.addMixinClassName("Wilma");

        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);

        child.addMixinClassName("Fred");
        child.addMixinClassName("Barney");

        assertEquals(child.getMixinClassNames(), Arrays.asList("Barney", "Fred", "Wilma"));

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);

        assertSame(child.getParentModel(), parent);
        assertNull(parent.getParentModel());

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);

        model.setMeta("fred", "flintstone");
        model.setMeta("barney", "rubble");

        assertEquals(model.getMeta("fred"), "flintstone");
        assertEquals(model.getMeta("barney"), "rubble");

        // Ensure case insensitive:

        assertEquals(model.getMeta("FRED"), "flintstone");
        assertEquals(model.getMeta("BARNEY"), "rubble");

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Log log = mockLog();

        replay();

        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);

        parent.setMeta("fred", "flintstone");

        assertEquals(child.getMeta("fred"), "flintstone");

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.model.MutableComponentModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.