Package org.apache.tapestry

Examples of org.apache.tapestry.Binding


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

        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 = newComponentResources();

        replay();

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

        assertEquals(binding.get(), expected);

        verify();
    }
View Full Code Here

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

        replay();

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

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

        bean.setObjectValue("first");

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

        binding.set("second");

        assertEquals(bean.getObjectValue(), "second");
        assertEquals(InternalUtils.locationOf(binding), l);

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

        verify();
    }
View Full Code Here

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

        replay();

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

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

        verify();
    }
View Full Code Here

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

        replay();

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

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

        verify();
    }
View Full Code Here

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

        replay();

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

        assertNull(binding.getAnnotation(Order.class));

        verify();
    }
View Full Code Here

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

        replay();

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

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

        verify();
    }
View Full Code Here

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

        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 = newLocation();

        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

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.