Package org.apache.tapestry5

Examples of org.apache.tapestry5.Binding


        replay();
       
        BindingFactory factory = getService("SymbolBindingFactory", BindingFactory.class);
       
        Binding binding = factory.newBinding("Test binding", res, null, SymbolConstants.START_PAGE_NAME, l);
       
        assertEquals(binding.get(), "start");
       
        verify();
    }
View Full Code Here


        replay();

        BindingFactory factory = new ValidateBindingFactory(source, interner);

        Binding binding = factory.newBinding("descrip", container, component, expression, l);

        assertSame(binding.get(), validator);

        verify();
    }
View Full Code Here

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

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

        replay();

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

        assertEquals(binding.getAnnotation(Validate.class).value(), "readonly");

        verify();
    }
View Full Code Here

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

        replay();

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

        assertEquals(binding.getAnnotation(Validate.class).value(), "writeonly");

        verify();
    }
View Full Code Here

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

        replay();

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

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

        verify();
    }
View Full Code Here

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

        replay();

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

        assertNotNull(binding.getAnnotation(BeforeRenderBody.class));

        verify();
    }
View Full Code Here

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

        replay();

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

        assertEquals(binding.getAnnotation(Validate.class).value(), "getObjectValue");

        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

TOP

Related Classes of org.apache.tapestry5.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.