use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class BookmarkableMapperTest method decode2.
/**
*/
@Test
public void decode2() {
Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/indexed1?a=b&b=c");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
assertEquals(PAGE_CLASS_NAME, page.getClass().getName());
PageParameters p = page.getPageParameters();
assertEquals(1, p.getIndexedCount());
assertEquals("indexed1", p.get(0).toString());
assertEquals(2, p.getNamedKeys().size());
assertEquals("b", p.get("a").toString());
assertEquals("c", p.get("b").toString());
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class BookmarkableMapperTest method decode8.
/**
*/
@Test
public void decode8() {
Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?15-5.ILinkListener-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.request.component.IRequestablePage in project wicket by apache.
the class BookmarkableMapperTest method decode5.
/**
*/
@Test
public void decode5() {
Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + "?15--foo-bar");
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());
assertNull(h.getBehaviorIndex());
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class BookmarkableMapperTest method decodePageClassWithPathParameters.
/**
* https://issues.apache.org/jira/browse/WICKET-5500
*/
@Test
public void decodePageClassWithPathParameters() {
Url url = Url.parse("wicket/bookmarkable/" + PAGE_CLASS_NAME + ";something=else");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertTrue(handler instanceof RenderPageRequestHandler);
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
assertEquals(PAGE_CLASS_NAME, page.getClass().getName());
assertEquals(0, page.getPageParameters().getIndexedCount());
assertTrue(page.getPageParameters().getNamedKeys().isEmpty());
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class BookmarkableMapperTest method decode6.
/**
*/
@Test
public void decode6() {
Url url = Url.parse("wicket/bookmarkable/" + 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 = page.getPageParameters();
assertEquals(0, p.getIndexedCount());
assertEquals(0, p.getNamedKeys().size());
}
Aggregations