use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class PackageMapperTest method decode1CaseInsensitively.
/**
* https://issues.apache.org/jira/browse/WICKET-4994
*/
@Test
public void decode1CaseInsensitively() {
Url url = Url.parse(MOUNT_PATH.replace('o', 'O').replace('p', 'P') + '/' + PAGE_CLASS_NAME);
IRequestHandler handler = encoder.setCaseSensitiveMatch(false).mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
assertEquals(PAGE_CLASS_NAME, page.getClass().getSimpleName());
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 PackageMapperTest method decode3.
/**
* The tests resolves pages by id as if they were existed in the page store.
* These pages have no page parameters (i.e. page.getPageParameters() == null).
*
* The request that the encoder does also has no parameters (neither in the path
* nor in the query string) so the resolved page is assumed to be valid.
*/
@Test
public void decode3() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "?15");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
checkPage(page, 15);
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class PackageMapperTest method decodeInnerClass.
/**
* https://issues.apache.org/jira/browse/WICKET-3838
*/
@Test
public void decodeInnerClass() {
Url url = Url.parse(MOUNT_PATH + '/' + "PackageMapperTest$OuterPage$InnerPage");
IRequestHandler handler = innerClassEncoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
assertEquals("InnerPage", page.getClass().getSimpleName());
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 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());
}
Aggregations