use of org.apache.tapestry5.PageCallback in project tapestry-5 by apache.
the class PageCallbackTest method callback_with_no_context.
@Test
public void callback_with_no_context() {
PageRenderLinkSource source = mockPageRenderLinkSource();
Link link = mockLink();
expect(source.createPageRenderLinkWithContext("foo")).andReturn(link);
PageCallback pc = new PageCallback("foo");
assertEquals(pc.toString(), "PageCallback[foo]");
replay();
assertSame(pc.toLink(source), link);
verify();
}
use of org.apache.tapestry5.PageCallback in project tapestry-5 by apache.
the class PageCallbackTest method callback_with_context.
@Test
public void callback_with_context() {
EventContext context = new ArrayEventContext(typeCoercer, 1, 2);
PageRenderLinkSource source = mockPageRenderLinkSource();
Link link = mockLink();
expect(source.createPageRenderLinkWithContext("bar", "1", "2")).andReturn(link);
PageCallback pc = new PageCallback("bar", context);
assertEquals(pc.toString(), "PageCallback[bar 1/2]");
replay();
assertSame(pc.toLink(source), link);
verify();
}
Aggregations