Package org.apache.tapestry

Examples of org.apache.tapestry.Binding


        ComponentResources resources = newComponentResources(bean);
        Location l = mockLocation();

        replay();

        Binding binding = _factory.newBinding("test binding", resources, null, "objectValue", l);

        assertEquals(binding.getAnnotation(Order.class).value(), 1000);

        verify();
    }
View Full Code Here


        ComponentResources resources = newComponentResources(bean);
        Location l = mockLocation();

        replay();

        Binding binding = _factory.newBinding(
                "test binding",
                resources,
                null,
                "stringHolder.value",
                l);

        assertSame(binding.getBindingType(), String.class);

        bean.getStringHolder().setValue("first");

        assertEquals(binding.get(), "first");

        binding.set("second");

        assertEquals(bean.getStringHolder().getValue(), "second");

        assertEquals(
                binding.toString(),
                "PropBinding[test binding foo.Bar:baz(stringHolder.value)]");

        verify();
    }
View Full Code Here

        ComponentResources resources = newComponentResources(bean);
        Location l = mockLocation();

        replay();

        Binding binding = _factory.newBinding(
                "test binding",
                resources,
                null,
                "stringHolderMethod().value",
                l);

        assertSame(binding.getBindingType(), String.class);

        bean.getStringHolder().setValue("first");

        assertEquals(binding.get(), "first");

        assertEquals(
                binding.toString(),
                "PropBinding[test binding foo.Bar:baz(stringHolderMethod().value)]");

        verify();
    }
View Full Code Here

        ComponentResources resources = newComponentResources(bean);
        Location l = mockLocation();

        replay();

        Binding binding = _factory.newBinding(
                "test binding",
                resources,
                null,
                "stringHolderMethod().stringValue()",
                l);

        assertSame(binding.getBindingType(), String.class);

        bean.getStringHolder().setValue("first");

        assertEquals(binding.get(), "first");

        try
        {
            binding.set("read-only");
            unreachable();
        }
        catch (TapestryException ex)
        {
            assertEquals(
View Full Code Here

        ComponentResources resources = newComponentResources(bean);
        Location l = mockLocation();

        replay();

        Binding binding = _factory.newBinding("test binding", resources, null, "intValue", l);

        assertSame(binding.getBindingType(), int.class);

        bean.setIntValue(1);

        assertEquals(binding.get(), 1);

        binding.set(2);

        assertEquals(bean.getIntValue(), 2);

        verify();
    }
View Full Code Here

        ComponentResources resources = newComponentResources(bean);
        Location l = mockLocation();

        replay();

        Binding binding = _factory.newBinding("test binding", resources, null, "readOnly", l);

        assertEquals(binding.get(), "ReadOnly");

        try
        {
            binding.set("fail");
            unreachable();
        }
        catch (TapestryException ex)
        {
            assertEquals(
View Full Code Here

        ComponentResources resources = newComponentResources(bean);
        Location l = mockLocation();

        replay();

        Binding binding = _factory.newBinding("test binding", resources, null, "writeOnly", l);

        binding.set("updated");

        assertEquals(bean._writeOnly, "updated");

        try
        {
            assertEquals(binding.get(), "ReadOnly");
            unreachable();
        }
        catch (TapestryException ex)
        {
            assertEquals(
View Full Code Here

        train_getComponent(resources, component);

        replay();

        Binding binding = _factory.newBinding(description, resources, null, "this", l);

        assertSame(binding.get(), component);

        verify();
    }
View Full Code Here

        String description = "my description";
        ComponentResources resources = mockComponentResources();

        replay();

        Binding binding = _factory.newBinding(description, resources, null, expression, l);

        assertEquals(binding.get(), expected);

        verify();
    }
View Full Code Here

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

        train_getId(resources, id);
        train_getContainer(resources, container);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.Binding

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.