Examples of BeanBlockSource


Examples of org.apache.tapestry5.services.BeanBlockSource

        RequestPageCache cache = mockRequestPageCache();
        Collection<BeanBlockContribution> configuration = newList();

        replay();

        BeanBlockSource source = new BeanBlockSourceImpl(cache, createBeanBlockOverrideSource(cache), configuration);

        try
        {
            source.getEditBlock("MyData");
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

Examples of org.apache.tapestry5.services.BeanBlockSource

        train_get(cache, "MyPage", page);
        train_getBlock(page, "mydisplay", block);

        replay();

        BeanBlockSource source = new BeanBlockSourceImpl(cache, createBeanBlockOverrideSource(cache), configuration);

        // Check case insensitivity while we are at it.
        Block actual = source.getEditBlock("MyData");

        assertSame(actual, block);

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BeanBlockSource

        expect(overrideSource.getEditBlock(datatype)).andReturn(block);

        replay();

        BeanBlockSource source = new BeanBlockSourceImpl(cache, overrideSource, EMPTY_CONFIGURATION);

        Block actual = source.getEditBlock(datatype);

        assertSame(actual, block);

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.BeanBlockSource

    public void no_editor_block_available()
    {
        PropertyModel model = mockPropertyModel();
        PropertyOverrides overrides = mockPropertyOverrides();
        ComponentResources resources = mockComponentResources();
        BeanBlockSource source = newMock(BeanBlockSource.class);
        RuntimeException exception = new RuntimeException("Simulated failure.");
        Messages messages = mockMessages();
        Location l = mockLocation();

        String propertyId = "foo";
        String dataType = "unk";
        String propertyName = "fooProp";
        Object object = "[OBJECT]";
        String formattedMessage = "formatted-message";

        expect(model.getId()).andReturn(propertyId);

        train_getOverrideBlock(overrides, propertyId, null);

        expect(model.getDataType()).andReturn(dataType);

        expect(source.getEditBlock(dataType)).andThrow(exception);
        expect(model.getPropertyName()).andReturn(propertyName);

        train_getLocation(resources, l);

        expect(messages.format("block-error", propertyName, dataType, object, exception))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.