Package org.apache.tapestry.runtime

Examples of org.apache.tapestry.runtime.Component


    @Test
    public void store_result_when_aborted_is_failure()
    {
        Object result = new Object();
        ComponentEventHandler handler = mockComponentEventHandler();
        Component component = mockComponent();

        expect(handler.handleResult(result, component, "foo.Bar.baz()")).andReturn(true);

        replay();
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void invocation_is_failure()
    {
        ComponentResources resources = mockComponentResources();
        Component component = mockComponent();
        String result = "*INVALID*";

        train_getComponentResources(component, resources);
        train_getCompleteId(resources, "foo.Bar:gnip.gnop");

View Full Code Here

    /** More of an integration test. */
    @Test
    public void load_component_via_service() throws Exception
    {
        Component target = createComponent(BasicComponent.class);

        // Should not be an instance, since it is loaded by a different class loader.
        assertFalse(BasicComponent.class.isInstance(target));

        _access.set(target, "value", "some default value");
        assertEquals(_access.get(target, "value"), "some default value");

        _access.set(target, "retainedValue", "some retained value");
        assertEquals(_access.get(target, "retainedValue"), "some retained value");

        // Setting a property value before pageDidLoad will cause that value
        // to be the default when the page detaches.

        target.containingPageDidLoad();

        _access.set(target, "value", "some transient value");
        assertEquals(_access.get(target, "value"), "some transient value");

        target.containingPageDidDetach();

        assertEquals(_access.get(target, "value"), "some default value");
        assertEquals(_access.get(target, "retainedValue"), "some retained value");
    }
View Full Code Here

    }

    @Test
    public void load_sub_component_via_service() throws Exception
    {
        Component target = createComponent(BasicSubComponent.class);

        target.containingPageDidLoad();

        _access.set(target, "value", "base class");
        assertEquals(_access.get(target, "value"), "base class");

        _access.set(target, "intValue", 33);
        assertEquals(_access.get(target, "intValue"), 33);

        target.containingPageDidDetach();

        assertNull(_access.get(target, "value"));
        assertEquals(_access.get(target, "intValue"), 0);
    }
View Full Code Here

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

        Instantiator inst = _source.findInstantiator(classname);

        Component target = inst.newInstance(resources);

        verify();

        return target;
    }
View Full Code Here

        String parameterName = "myparam";

        String id = "mycomponentid";

        ComponentResources resources = mockComponentResources();
        Component container = mockComponent();
        PropertyAccess access = newPropertyAccess();
        ClassPropertyAdapter classPropertyAdapter = newClassPropertyAdapter();
        BindingSource bindingSource = mockBindingSource();

        train_getId(resources, id);
View Full Code Here

        String parameterName = "myparam";

        String id = "mycomponentid";

        ComponentResources resources = mockComponentResources();
        Component container = mockComponent();
        PropertyAccess access = newPropertyAccess();
        ClassPropertyAdapter classPropertyAdapter = newClassPropertyAdapter();
        PropertyAdapter propertyAdapter = newPropertyAdapter();
        BindingSource bindingSource = mockBindingSource();
        Binding binding = mockBinding();
View Full Code Here

{
    @Test
    public void render_informal_parameters_no_bindings()
    {
        ComponentPageElement element = mockComponentPageElement();
        Component component = mockComponent();
        Instantiator ins = mockInstantiator(component);
        MarkupWriter writer = mockMarkupWriter();
        TypeCoercer coercer = mockTypeCoercer();
        ComponentModel model = mockComponentModel();
View Full Code Here

    @Test
    public void render_informal_parameters_skips_formal_parameters()
    {
        ComponentPageElement element = mockComponentPageElement();
        Component component = mockComponent();
        Instantiator ins = mockInstantiator(component);
        MarkupWriter writer = mockMarkupWriter();
        TypeCoercer coercer = mockTypeCoercer();
        ComponentModel model = mockComponentModel();
        ParameterModel pmodel = mockParameterModel();
View Full Code Here

    @Test
    public void render_an_informal_parameter()
    {
        ComponentPageElement element = mockComponentPageElement();
        Component component = mockComponent();
        Instantiator ins = mockInstantiator(component);
        MarkupWriter writer = mockMarkupWriter();
        TypeCoercer coercer = mockTypeCoercer();
        ComponentModel model = mockComponentModel();
        Binding binding = mockBinding();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.runtime.Component

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.