Package AGEvalSwipl

Examples of AGEvalSwipl.LoopRecoverer$Block


    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        TypeCoercer coercer = mockTypeCoercer();
        Block block = mockBlock();

        Instantiator ins = newInstantiator(component, model);

        replay();
View Full Code Here


    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        TypeCoercer coercer = mockTypeCoercer();
        Block block1 = mockBlock();
        Block block2 = mockBlock();

        Instantiator ins = newInstantiator(component, model);

        replay();
View Full Code Here

     * Invoked from subclasses to do the rendering. The subclass controls the naming convention for locating an
     * overriding Block parameter (it is the name of the property possibly suffixed with a value).
     */
    protected Object renderPropertyValue(MarkupWriter writer, String overrideBlockId)
    {
        Block override = overrides.getBlockParameter(overrideBlockId);

        if (override != null) return override;

        String datatype = model.getDataType();

View Full Code Here

    }


    public Block getBlockForColumn()
    {
        Block override = overrides.getBlockParameter(columnModel.getId() + "Header");

        if (override != null) return override;

        return standardHeader;
    }
View Full Code Here

    }

    @Test
    public void true_test_renders_else_block()
    {
        Block block = mockBlock();

        replay();

        Unless component = new Unless();
View Full Code Here

    @Test
    public void block_found()
    {
        Messages messages = mockMessages();
        ComponentResources resources = mockInternalComponentResources();
        Block block = mockBlock();

        String name = "alfred";

        train_getContainerMessages(resources, messages);
View Full Code Here

    private static final Collection<BeanBlockContribution> EMPTY_CONFIGURATION = Collections.emptyList();

    @Test
    public void found_display_block()
    {
        Block block = mockBlock();
        RequestPageCache cache = mockRequestPageCache();
        Page page = mockPage();
        BeanBlockContribution contribution = new BeanBlockContribution("mydata", "MyPage",
                                                                       "mydisplay", false);
        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.
        assertTrue(source.hasDisplayBlock("MyData"));
        Block actual = source.getDisplayBlock("MyData");

        assertSame(actual, block);

        verify();
    }
View Full Code Here

    }

    @Test
    public void found_display_block_in_override()
    {
        Block block = mockBlock();
        RequestPageCache cache = mockRequestPageCache();
        BeanBlockOverrideSource overrideSource = mockBeanBlockOverrideSource();
        String datatype = "MyData";

        expect(overrideSource.hasDisplayBlock(datatype)).andReturn(true);
        expect(overrideSource.getDisplayBlock(datatype)).andReturn(block);

        replay();

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

        // Check case insensitivity while we are at it.
        assertTrue(source.hasDisplayBlock(datatype));
        Block actual = source.getDisplayBlock(datatype);

        assertSame(actual, block);

        verify();
    }
View Full Code Here

    }

    @Test
    public void found_edit_block()
    {
        Block block = mockBlock();
        RequestPageCache cache = mockRequestPageCache();
        Page page = mockPage();
        BeanBlockContribution contribution = new BeanBlockContribution("mydata", "MyPage",
                                                                       "mydisplay", true);
        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();
    }
View Full Code Here

    }

    @Test
    public void found_edit_block_in_override()
    {
        Block block = mockBlock();
        RequestPageCache cache = mockRequestPageCache();
        BeanBlockOverrideSource overrideSource = mockBeanBlockOverrideSource();
        String datatype = "MyData";

        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

TOP

Related Classes of AGEvalSwipl.LoopRecoverer$Block

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.