use of org.apache.wicket.core.request.handler.ListenerRequestHandler in project wicket by apache.
the class PackageMapperTest method decode8.
/**
*/
@Test
public void decode8() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "/i1/i2?15-5.-foo-bar&a=b&b=c");
context.setNextPageRenderCount(5);
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ListenerRequestHandler.class));
ListenerRequestHandler h = (ListenerRequestHandler) handler;
IRequestablePage page = h.getPage();
assertEquals(page.getRenderCount(), 5);
}
use of org.apache.wicket.core.request.handler.ListenerRequestHandler in project wicket by apache.
the class PackageMapperTest method decode6.
/**
*/
@Test
public void decode6() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "/i1/i2?15--foo-bar&a=b&b=c");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ListenerRequestHandler.class));
ListenerRequestHandler h = (ListenerRequestHandler) handler;
IRequestablePage page = h.getPage();
checkPage(page, 15);
assertEquals("foo:bar", h.getComponent().getPageRelativePath());
PageParameters p = h.getPageParameters();
assertEquals(2, p.getIndexedCount());
assertEquals(2, p.getNamedKeys().size());
}
use of org.apache.wicket.core.request.handler.ListenerRequestHandler in project wicket by apache.
the class PageInstanceMapperTest method encode2.
/**
*/
@Test
public void encode2() {
MockPage page = new MockPage(15);
page.setRenderCount(5);
IRequestableComponent c = page.get("a:b:c");
PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
IRequestHandler handler = new ListenerRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals("wicket/page?15-5.-a-b-c", url.toString());
}
use of org.apache.wicket.core.request.handler.ListenerRequestHandler in project wicket by apache.
the class PageInstanceMapperTest method decode6.
/**
*/
@Test
public void decode6() {
Url url = Url.parse("wicket/page?4-ILinkListener.5-a-b-c");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ListenerRequestHandler.class));
ListenerRequestHandler h = (ListenerRequestHandler) handler;
checkPage(h.getPage(), 4);
assertEquals(h.getComponent().getPageRelativePath(), "a:b:c");
assertEquals((Object) 5, h.getBehaviorIndex());
}
use of org.apache.wicket.core.request.handler.ListenerRequestHandler in project wicket by apache.
the class Component method createRequestHandler.
/**
* Create a suitable request handler depending whether the page is stateless or bookmarkable.
*/
private IRequestHandler createRequestHandler(PageParameters parameters, Integer id) {
Page page = getPage();
PageAndComponentProvider provider = new PageAndComponentProvider(page, this, parameters);
if (page.isPageStateless() || (page.isBookmarkable() && page.wasCreatedBookmarkable())) {
return new BookmarkableListenerRequestHandler(provider, id);
} else {
return new ListenerRequestHandler(provider, id);
}
}
Aggregations