Search in sources :

Example 1 with EditBlockContribution

use of org.apache.tapestry5.services.EditBlockContribution in project tapestry-5 by apache.

the class BeanBlockSourceImplTest method found_edit_block.

@Test
public void found_edit_block() {
    Block block = mockBlock();
    RequestPageCache cache = mockRequestPageCache();
    Page page = mockPage();
    BeanBlockContribution contribution = new EditBlockContribution("mydata", "MyPage", "mydisplay");
    Collection<BeanBlockContribution> configuration = newList(contribution);
    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();
}
Also used : BeanBlockSource(org.apache.tapestry5.services.BeanBlockSource) Block(org.apache.tapestry5.Block) Page(org.apache.tapestry5.internal.structure.Page) BeanBlockContribution(org.apache.tapestry5.services.BeanBlockContribution) EditBlockContribution(org.apache.tapestry5.services.EditBlockContribution) Test(org.testng.annotations.Test)

Aggregations

Block (org.apache.tapestry5.Block)1 Page (org.apache.tapestry5.internal.structure.Page)1 BeanBlockContribution (org.apache.tapestry5.services.BeanBlockContribution)1 BeanBlockSource (org.apache.tapestry5.services.BeanBlockSource)1 EditBlockContribution (org.apache.tapestry5.services.EditBlockContribution)1 Test (org.testng.annotations.Test)1