Package org.apache.tapestry5.internal

Examples of org.apache.tapestry5.internal.InternalPropertyConduit


    }

    @Test
    public void question_dot_operator_for_object_type()
    {
        InternalPropertyConduit normal = (InternalPropertyConduit) source.create(CompositeBean.class,
                "simple.firstName");
        InternalPropertyConduit smart = (InternalPropertyConduit) source.create(CompositeBean.class,
                "simple?.firstName");

        CompositeBean bean = new CompositeBean();
        bean.setSimple(null);

        assertEquals(normal.getPropertyName(), "firstName");
        assertEquals(smart.getPropertyName(), "firstName");

        try
        {
            normal.get(bean);
            unreachable();
        }
        catch (NullPointerException ex)
        {
            // Expected.
        }

        assertNull(smart.get(bean));

        try
        {
            normal.set(bean, "Howard");
            unreachable();
        }
        catch (NullPointerException ex)
        {
            // Expected.
        }

        // This will be a no-op due to the null property in the expression

        smart.set(bean, "Howard");
    }
View Full Code Here


    }

    @Test
    public void method_names_are_matched_caselessly()
    {
        InternalPropertyConduit conduit = (InternalPropertyConduit) source.create(CompositeBean.class,
                "GETSIMPLE().firstName");

        assertEquals(conduit.getPropertyName(), "firstName");

        CompositeBean bean = new CompositeBean();
        SimpleBean inner = new SimpleBean();
        bean.setSimple(inner);

        conduit.set(bean, "Howard");

        assertEquals(inner.getFirstName(), "Howard");
    }
View Full Code Here

    }

    @Test
    public void question_dot_operator_for_object_type()
    {
        InternalPropertyConduit normal = (InternalPropertyConduit) source.create(CompositeBean.class,
                "simple.firstName");
        InternalPropertyConduit smart = (InternalPropertyConduit) source.create(CompositeBean.class,
                "simple?.firstName");

        CompositeBean bean = new CompositeBean();
        bean.setSimple(null);

        assertEquals(normal.getPropertyName(), "firstName");
        assertEquals(smart.getPropertyName(), "firstName");

        try
        {
            normal.get(bean);
            unreachable();
        } catch (NullPointerException ex)
        {
            // Expected.
        }

        assertNull(smart.get(bean));

        try
        {
            normal.set(bean, "Howard");
            unreachable();
        } catch (NullPointerException ex)
        {
            // Expected.
        }

        // This will be a no-op due to the null property in the expression

        smart.set(bean, "Howard");
    }
View Full Code Here

    }

    @Test
    public void method_names_are_matched_caselessly()
    {
        InternalPropertyConduit conduit = (InternalPropertyConduit) source.create(CompositeBean.class,
                "GETSIMPLE().firstName");

        assertEquals(conduit.getPropertyName(), "firstName");

        CompositeBean bean = new CompositeBean();
        SimpleBean inner = new SimpleBean();
        bean.setSimple(inner);

        conduit.set(bean, "Howard");

        assertEquals(inner.getFirstName(), "Howard");
    }
View Full Code Here

    {
        List<OptionModel> options = CollectionFactory.newList();

        for (Locale l : supportedLocales)
        {
            options.add(new OptionModelImpl(l.getDisplayName(l), l));
        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

        for (Locale l : supportedLocales)
        {
            options.add(new OptionModelImpl(l.getDisplayName(l), l));
        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

    {
        this.parent = parent;
        this.transformer = transformer;
        this.logger = logger;
        this.internalRequestGlobals = internalRequestGlobals;
        this.changeTracker = new URLChangeTracker(classpathURLConverter);

        initializeService();
    }
View Full Code Here

        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.internal.InternalPropertyConduit

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.