Package org.apache.tapestry5.model

Examples of org.apache.tapestry5.model.MutableComponentModel


        final InternalComponentResources resources = mockInternalComponentResources();
        _binding = mockBinding();
        String boundValue = "yowza!";
        final Logger logger = mockLogger();

        MutableComponentModel model = mockMutableComponentModel(logger);

        model.addParameter("value", false, true, BindingConstants.PROP);

        Runnable phaseTwoTraining = new Runnable()
        {
            public void run()
            {
View Full Code Here


     * This is for the majority of tests.
     */
    private Component setupForIntegrationTest(final InternalComponentResources resources) throws Exception
    {
        final Logger logger = mockLogger();
        MutableComponentModel model = mockMutableComponentModel(logger);

        model.addParameter("invariantObject", false, true, BindingConstants.PROP);
        model.addParameter("invariantPrimitive", false, true, BindingConstants.PROP);
        model.addParameter("object", false, true, BindingConstants.PROP);
        model.addParameter("primitive", true, true, BindingConstants.PROP);
        model.addParameter("uncached", false, true, BindingConstants.LITERAL);


        Runnable phaseTwoTraining = new Runnable()
        {
            public void run()
View Full Code Here

        Resource baseResource = new ClasspathResource(classname.replace(".", "/") + ".class");

        ComponentModel parentModel = nameToComponentModel.get(parentClassname);

        MutableComponentModel model = new MutableComponentModelImpl(classname, logger, baseResource, parentModel);

        InternalClassTransformation transformation =
                parentTransformation == null
                ? new InternalClassTransformationImpl(classFactory, ctClass, componentClassCache, model, classSource)
                : parentTransformation.createChildTransformation(ctClass, model);
View Full Code Here

{
    @Test
    public void annotation_not_present()
    {
        PlasticClass pc = newMock(PlasticClass.class);
        MutableComponentModel model = mockMutableComponentModel();

        expect(pc.hasAnnotation(MixinAfter.class)).andReturn(false);

        replay();
View Full Code Here

    @Test
    public void annotation_present()
    {
        PlasticClass pc = newMock(PlasticClass.class);
        MutableComponentModel model = mockMutableComponentModel();


        expect(pc.hasAnnotation(MixinAfter.class)).andReturn(true);

        model.setMixinAfter(true);

        replay();

        new MixinAfterWorker().transform(pc, null, model);
View Full Code Here

    @Test
    public void annotation_present()
    {
        PlasticClass plasticClass = mockPlasticClass();

        MutableComponentModel model = mockMutableComponentModel();

        expect(plasticClass.hasAnnotation(SupportsInformalParameters.class)).andReturn(true);

        model.enableSupportsInformalParameters();

        replay();

        new SupportsInformalParametersWorker().transform(plasticClass, null, model);
View Full Code Here

    @Test
    public void annotation_missing()
    {
        PlasticClass plasticClass = mockPlasticClass();

        MutableComponentModel model = mockMutableComponentModel();

        expect(plasticClass.hasAnnotation(SupportsInformalParameters.class)).andReturn(false);

        replay();
View Full Code Here

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

        replay();

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

        assertNull(model.getParameterModel("foo"));

        verify();
    }
View Full Code Here

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

        replay();

        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false);
        model.addParameter("fred", true, true, BindingConstants.PROP);

        assertNull(model.getParameterModel("barney"));

        verify();
    }
View Full Code Here

        Logger logger = mockLogger();
        Location l = mockLocation();

        replay();

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

        assertTrue(model.getEmbeddedComponentIds().isEmpty());

        MutableEmbeddedComponentModel fred = model.addEmbeddedComponent("fred", "Fred", COMPONENT_CLASS_NAME, false, l);

        assertEquals(fred.getId(), "fred");
        assertEquals(fred.getComponentType(), "Fred");
        assertFalse(fred.getInheritInformalParameters());
        assertSame(fred.getLocation(), l);

        MutableEmbeddedComponentModel barney = model.addEmbeddedComponent("barney", "Barney", COMPONENT_CLASS_NAME,
                false, null);

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

        assertSame(model.getEmbeddedComponentModel("fred"), fred);
        assertSame(model.getEmbeddedComponentModel("barney"), barney);

        // Access by id is case insensitive

        assertSame(model.getEmbeddedComponentModel("FRED"), fred);
        assertSame(model.getEmbeddedComponentModel("BARNEY"), barney);

        assertEquals(fred.toString(),
                "EmbeddedComponentModel[id=fred type=Fred class=org.example.components.Fred inheritInformals=false]");

        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.