Search in sources :

Example 6 with ComponentSource

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

the class ComponentSourceImplTest method get_page_by_logical_name.

@Test
public void get_page_by_logical_name() {
    RequestPageCache cache = mockRequestPageCache();
    Page page = mockPage();
    Component component = mockComponent();
    ComponentClassResolver resolver = mockComponentClassResolver();
    train_get(cache, PAGE_NAME, page);
    train_getRootComponent(page, component);
    replay();
    ComponentSource source = new ComponentSourceImpl(cache, resolver, null);
    assertSame(source.getPage(PAGE_NAME), component);
    verify();
}
Also used : ComponentSource(org.apache.tapestry5.services.ComponentSource) ComponentClassResolver(org.apache.tapestry5.services.ComponentClassResolver) Page(org.apache.tapestry5.internal.structure.Page) Component(org.apache.tapestry5.runtime.Component) Test(org.testng.annotations.Test)

Aggregations

ComponentSource (org.apache.tapestry5.services.ComponentSource)6 Test (org.testng.annotations.Test)6 Page (org.apache.tapestry5.internal.structure.Page)5 Component (org.apache.tapestry5.runtime.Component)5 ComponentClassResolver (org.apache.tapestry5.services.ComponentClassResolver)5 RequestGlobals (org.apache.tapestry5.http.services.RequestGlobals)2 ComponentPageElement (org.apache.tapestry5.internal.structure.ComponentPageElement)1