Package org.apache.tapestry.ioc.services

Examples of org.apache.tapestry.ioc.services.PropertyAccess


    }

    @Test
    public void caching()
    {
        PropertyAccess access = getService("tapestry.ioc.PropertyAccess", PropertyAccess.class);
        ClassFactory classFactory = getService("tapestry.ioc.ClassFactory", ClassFactory.class);

        PropBindingFactory factory = new PropBindingFactory(access, classFactory);

        TargetBean bean1 = new TargetBean();
View Full Code Here


        Class transformed = _classPool.toClass(targetObjectCtClass, _loader);

        Object target = ct.createInstantiator(transformed).newInstance(resources);

        PropertyAccess access = new PropertyAccessImpl();

        try
        {
            access.set(target, "value", "anything");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            // The PropertyAccess layer adds a wrapper exception around the real one.
View Full Code Here

        Class transformed = _classPool.toClass(targetObjectCtClass, _loader);

        Object target = ct.createInstantiator(transformed).newInstance(resources);

        PropertyAccess access = new PropertyAccessImpl();

        assertEquals(access.get(target, "value"), "from constructor");

        verify();
    }
View Full Code Here

        Class transformed = _classPool.toClass(targetObjectCtClass, _loader);

        Object target = ct.createInstantiator(transformed).newInstance(resources);

        PropertyAccess access = new PropertyAccessImpl();

        assertEquals(access.get(target, "value"), "Tapestry");

        try
        {
            access.set(target, "value", "anything");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            // The PropertyAccess layer adds a wrapper exception around the real one.
View Full Code Here

        Object target = ct.createInstantiator(transformed).newInstance(resources);

        // target is no longer assignable to FieldAccessBean; its a new class from a new class
        // loader. So we use reflective access, which doesn't care about such things.

        PropertyAccess access = new PropertyAccessImpl();

        checkReplacedFieldAccess(access, target, "foo");
        checkReplacedFieldAccess(access, target, "bar");

        verify();
View Full Code Here

    @Test
    public void integration()
    {
        Registry registry = buildRegistry();

        PropertyAccess pa = registry
                .getService("tapestry.ioc.PropertyAccess", PropertyAccess.class);

        Bean b = new Bean();

        int value = _random.nextInt();

        pa.set(b, "value", value);

        assertEquals(b.getValue(), value);
    }
View Full Code Here

    @Test
    public void integration()
    {
        Registry registry = buildRegistry();

        PropertyAccess pa = registry.getService("PropertyAccess", PropertyAccess.class);

        Bean b = new Bean();

        int value = _random.nextInt();

        pa.set(b, "value", value);

        assertEquals(b.getValue(), value);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.services.PropertyAccess

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.