Package org.apache.tapestry.internal

Examples of org.apache.tapestry.internal.InternalComponentResources


    }

    @Test
    public void cached_primitive_write() throws Exception
    {
        InternalComponentResources resources = mockInternalComponentResources();

        Component component = setupForIntegrationTest(resources);

        train_isLoaded(resources, true);
        train_isBound(resources, "primitive", true);
        resources.writeParameter("primitive", 321);

        train_isRendering(resources, false);

        train_isLoaded(resources, true);
        train_isBound(resources, "primitive", true);
        train_readParameter(resources, "primitive", int.class, 123);
        train_isRendering(resources, false);

        replay();

        _access.set(component, "primitive", 321);
        assertEquals(_access.get(component, "primitive"), 123);

        verify();

        // Now try during rendering ...

        train_isLoaded(resources, true);
        train_isBound(resources, "primitive", true);
        resources.writeParameter("primitive", 567);
        train_isRendering(resources, true);

        replay();

        _access.set(component, "primitive", 567);
View Full Code Here


    }

    @Test
    public void uncached_object_read() throws Exception
    {
        InternalComponentResources resources = mockInternalComponentResources();

        Component component = setupForIntegrationTest(resources);

        // Notice no check for isRendering() since that is irrelevant to uncached parameters.
        // Also note difference between field name and parameter name, due to Parameter.name() being
View Full Code Here

    }

    @Test
    public void uncached_object_write() throws Exception
    {
        InternalComponentResources resources = mockInternalComponentResources();

        Component component = setupForIntegrationTest(resources);

        // Notice no check for isRendering() since that is irrelevant to uncached parameters.
        // Also note difference between field name and parameter name, due to Parameter.name() being
        // specified.

        train_isLoaded(resources, true);
        train_isBound(resources, "uncached", true);
        resources.writeParameter("uncached", "first");

        train_isLoaded(resources, true);
        train_isBound(resources, "uncached", true);
        train_readParameter(resources, "uncached", String.class, "second");
View Full Code Here

    @Test
    public void parameter_with_default() throws Exception
    {
        final BindingSource source = mockBindingSource();
        final InternalComponentResources resources = mockInternalComponentResources();
        final Binding binding = mockBinding();
        String boundValue = "howdy!";

        MutableComponentModel model = mockMutableComponentModel();

        model.addParameter("value", false, TapestryConstants.PROP_BINDING_PREFIX);

        Runnable phaseTwoTraining = new Runnable()
        {
            public void run()
            {
                train_isBound(resources, "value", false);

                expect(
                        source.newBinding(
                                "default value",
                                resources,
                                TapestryConstants.PROP_BINDING_PREFIX,
                                "literal:greeting")).andReturn(binding);

                resources.bindParameter("value", binding);

                train_isInvariant(resources, "value", true);

            };
        };
View Full Code Here

    @Test
    public void default_binding_method() throws Exception
    {
        BindingSource source = mockBindingSource();
        final InternalComponentResources resources = mockInternalComponentResources();
        _binding = mockBinding();
        String boundValue = "yowza!";

        MutableComponentModel model = mockMutableComponentModel();

        model.addParameter("value", false, TapestryConstants.PROP_BINDING_PREFIX);

        Runnable phaseTwoTraining = new Runnable()
        {
            public void run()
            {
                train_isBound(resources, "value", false);

                // How can this happen? Only if the generated code invokes defaultValue().

                resources.bindParameter("value", _binding);

                train_isInvariant(resources, "value", true);
            };
        };
View Full Code Here

        return createComponent(classname);
    }

    private Component createComponent(String classname)
    {
        InternalComponentResources resources = mockInternalComponentResources();

        replay();

        // Can't wait for the HiveMind code base to start using some generics for this kind of
        // thing.
View Full Code Here

    }

    @Test
    public void add_injected_field() throws Exception
    {
        InternalComponentResources resources = mockInternalComponentResources();

        CtClass targetObjectCtClass = findCtClass(TargetObject.class);

        Logger logger = mockLogger();
View Full Code Here

    @Test
    public void add_injected_field_from_parent_transformation() throws Exception
    {
        final String value = "from the parent";

        InternalComponentResources resources = mockInternalComponentResources();

        CtClass targetObjectCtClass = findCtClass(TargetObject.class);

        Logger logger = mockLogger();
View Full Code Here

    }

    @Test
    public void add_interface_to_class() throws Exception
    {
        InternalComponentResources resources = mockInternalComponentResources();

        CtClass targetObjectCtClass = findCtClass(TargetObject.class);

        Logger logger = mockLogger();
View Full Code Here

    }

    @Test
    public void make_field_read_only() throws Exception
    {
        InternalComponentResources resources = mockInternalComponentResources();

        Logger logger = mockLogger();

        replay();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.internal.InternalComponentResources

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.