Examples of PropertyConduit


Examples of org.apache.tapestry.PropertyConduit

        assertEquals(firstName.getPropertyType(), String.class);
        assertEquals(firstName.getDataType(), "text");

        assertEquals(model.get("lastName").getLabel(), "Last Name");

        PropertyConduit conduit = model.get("lastName").getConduit();

        SimpleBean instance = new SimpleBean();

        instance.setLastName("Lewis Ship");

        assertEquals(conduit.get(instance), "Lewis Ship");

        conduit.set(instance, "TapestryDude");

        assertEquals(instance.getLastName(), "TapestryDude");

        // Now, one with some type coercion.
View Full Code Here

Examples of org.apache.tapestry.beaneditor.PropertyConduit

public class ValidateAnnotationConstraintGeneratorTest extends InternalBaseTestCase
{
    @Test
    public void no_annotation()
    {
        PropertyConduit conduit = newPropertyConduit();

        train_getAnnotation(conduit, Validate.class, null);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

    }

    @Test
    public void list_as_method_argument()
    {
        PropertyConduit conduit = source.create(EchoBean.class, "echoList([ 1, 2.0, storedString ])");
        EchoBean bean = new EchoBean();

        bean.setStoredString("Bart");

        List l = (List) conduit.get(bean);

        assertListsEquals(l, new Long(1), new Double(2.0), "Bart");
    }
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

    }
   
    @Test
    public void arrays_as_method_argument()
    {
        PropertyConduit conduit = source.create(EchoBean.class, "echoArray(storedArray)");
        EchoBean bean = new EchoBean();

        bean.setStoredArray(new Number[][]{ new Integer[] {1, 2}, new Double[] {3.0, 4.0}});

        Number[][] array = (Number[][]) conduit.get(bean);

        assertArraysEqual(array[0], 1, 2);
        assertArraysEqual(array[1], 3.0, 4.0);
    }
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

   

    @Test
    public void not_operator()
    {
        PropertyConduit conduit = source.create(IntegerHolder.class, "! value");
        IntegerHolder holder = new IntegerHolder();

        assertEquals(conduit.get(holder), Boolean.TRUE);

        holder.setValue(99);

        assertEquals(conduit.get(holder), Boolean.FALSE);
    }
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

    }

    @Test
    public void not_operator_in_subexpression()
    {
        PropertyConduit conduit = source.create(Switch.class, "label(! value)");

        Switch sw = new Switch();

        assertEquals(conduit.get(sw), "aye");

        sw.setValue(true);

        assertEquals(conduit.get(sw), "nay");
    }
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

     * TAP5-330
     */
    @Test
    public void object_methods_can_be_invoked()
    {
        PropertyConduit conduit = source.create(Block.class, "toString()");

        Block b = new Block()
        {
            @Override
            public String toString()
            {
                return "Do You Grok Ze Block?";
            }
        };

        assertEquals(conduit.get(b), "Do You Grok Ze Block?");
    }
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

    @Test
    public void boolean_constant_as_method_parameter()
    {
        Bedrock bedrock = new Bedrock();

        PropertyConduit trueConduit = source.create(Bedrock.class, "toName(true)");
        PropertyConduit falseConduit = source.create(Bedrock.class, "toName(false)");

        assertEquals(trueConduit.get(bedrock), "Fred");
        assertEquals(falseConduit.get(bedrock), "Barney");
    }
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

    /** TAP5-747 */
    @Test
    public void dereference_result_of_method_invocation()
    {
        ComplexObject co = new ComplexObject();
        PropertyConduit pc = source.create(ComplexObject.class, "get(nestedIndex).name");

        assertEquals(pc.get(co), "zero");

        co.setNestedIndex(1);

        assertEquals(pc.get(co), "one");
    }
View Full Code Here

Examples of org.apache.tapestry5.PropertyConduit

    {
        PublicFieldBean bean = new PublicFieldBean();

        bean.stringField = "x";

        PropertyConduit pc = source.create(PublicFieldBean.class, "stringField");

        assertEquals(pc.get(bean), "x");

        pc.set(bean, "y");

        assertEquals(bean.stringField, "y");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.