Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.BindingFactory


    }

    @Test
    public void factory_throws_exception()
    {
        BindingFactory factory = mockBindingFactory();
        ComponentResources container = mockComponentResources();
        ComponentResources component = mockComponentResources();
        Location l = mockLocation();
        Throwable t = new RuntimeException("Simulated failure.");

        String defaultPrefix = "def";
        String description = "descrip";
        String expression = "full expression";

        factory.newBinding(description, container, component, expression, l);
        setThrowable(t);

        replay();

        Map<String, BindingFactory> map = newMap();
View Full Code Here


        ComponentResources res = mockInternalComponentResources();
        Location l = mockLocation();

        replay();

        BindingFactory factory = new LiteralBindingFactory();

        Binding b = factory.newBinding("test binding", res, null, "Tapestry5", l);

        assertSame(InternalUtils.locationOf(b), l);

        assertEquals(b.get(), "Tapestry5");
        assertTrue(b.isInvariant());
View Full Code Here

        expect(source.get(expression)).andReturn(translator);

        replay();

        BindingFactory factory = new TranslateBindingFactory(source);

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

        assertSame(binding.get(), translator);

        assertSame(InternalUtils.locationOf(binding), l);
View Full Code Here

        train_getComponent(component, instance);
        train_getCompleteId(component, "foo.Bar:baz");

        replay();

        BindingFactory factory = new ValidateBindingFactory(source);

        try
        {
            factory.newBinding("descrip", container, component, "zip,zoom", l);
        }
        catch (TapestryException ex)
        {
            assertEquals(
                    ex.getMessage(),
View Full Code Here

        expect(source.createValidators(instance, expression)).andReturn(validator);

        replay();

        BindingFactory factory = new ValidateBindingFactory(source);

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

        assertSame(binding.get(), validator);

        verify();
    }
View Full Code Here

        ComponentResources res = newInternalComponentResources();
        Location l = newLocation();

        replay();

        BindingFactory factory = new LiteralBindingFactory();

        Binding b = factory.newBinding("test binding", res, null, "Tapestry5", l);

        assertSame(InternalUtils.locationOf(b), l);

        assertEquals(b.get(), "Tapestry5");
        assertTrue(b.isInvariant());
View Full Code Here

        expect(source.get(expression)).andReturn(translator);

        replay();

        BindingFactory factory = new TranslateBindingFactory(source);

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

        assertSame(binding.get(), translator);

        assertSame(InternalUtils.locationOf(binding), l);
View Full Code Here

        train_getComponent(component, instance);
        train_getCompleteId(component, "foo.Bar:baz");

        replay();

        BindingFactory factory = new ValidateBindingFactory(source);

        try
        {
            factory.newBinding("descrip", container, component, "zip,zoom", l);
        }
        catch (TapestryException ex)
        {
            assertEquals(
                    ex.getMessage(),
View Full Code Here

        expect(source.createValidators(instance, expression)).andReturn(validator);

        replay();

        BindingFactory factory = new ValidateBindingFactory(source);

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

        assertSame(binding.get(), validator);

        verify();
    }
View Full Code Here

public class BindingSourceImplTest extends InternalBaseTestCase
{
    @Test
    public void expression_has_no_prefix()
    {
        BindingFactory factory = newBindingFactory();
        Binding binding = newBinding();
        ComponentResources container = newComponentResources();
        ComponentResources component = newComponentResources();
        Location l = newLocation();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.BindingFactory

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.