Package org.apache.tapestry5.model

Examples of org.apache.tapestry5.model.MutableComponentModel


        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

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

        verify();
    }
View Full Code Here


        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

        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();
        Logger logger = mockLogger();

        replay();

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

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

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

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

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

        assertNull(child.getMeta("wilma"));

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

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

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

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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


        assertFalse(model.getHandledRenderPhases().contains(BeginRender.class));

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

        model.addRenderPhase(BeginRender.class);

        assertTrue(model.getHandledRenderPhases().contains(BeginRender.class));

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

        parent.addRenderPhase(BeginRender.class);


        assertTrue(child.getHandledRenderPhases().contains(BeginRender.class));

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

        assertTrue(model.isRootClass());

        MutableComponentModel subModel = new MutableComponentModelImpl(CLASS_NAME, logger, r, model, false);

        assertFalse(subModel.isRootClass());

        verify();
    }
View Full Code Here

        Resource r = mockResource();
        Logger logger = mockLogger();

        replay();

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

        assertTrue(model.getParameterNames().isEmpty());

        String parameterName = "value";

        model.addParameter(parameterName, true, true, BindingConstants.PROP);

        ParameterModel pm = model.getParameterModel(parameterName);

        assertEquals(pm.getName(), parameterName);
        assertEquals(true, pm.isRequired());
        assertEquals(pm.getDefaultBindingPrefix(), BindingConstants.PROP);

        assertEquals(model.getDeclaredParameterNames(), Arrays.asList(parameterName));

        // Verify that the binding prefix is actually stored:

        model.addParameter("fred", true, true, "flint");

        // Checks that parameter names are case insensitive

        assertEquals(model.getParameterModel("Fred").getDefaultBindingPrefix(), "flint");

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.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.