use of org.apache.wicket.core.request.handler.RenderPageRequestHandler in project wicket by apache.
the class PackageMapperTest method decode1.
/**
*/
@Test
public void decode1() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME);
IRequestHandler handler = encoder.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.core.request.handler.RenderPageRequestHandler in project wicket by apache.
the class PackageMapperTest method decodePageClassWithPathParameters.
/**
* https://issues.apache.org/jira/browse/WICKET-5500
*/
@Test
public void decodePageClassWithPathParameters() {
Url url = Url.parse(MOUNT_PATH + '/' + 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().getSimpleName());
assertEquals(0, page.getPageParameters().getIndexedCount());
assertTrue(page.getPageParameters().getNamedKeys().isEmpty());
}
use of org.apache.wicket.core.request.handler.RenderPageRequestHandler in project wicket by apache.
the class PackageMapperTest method decodeAlias.
/**
* https://issues.apache.org/jira/browse/WICKET-3941
*/
@Test
public void decodeAlias() {
Url url = Url.parse(MOUNT_PATH + '/' + ALIAS + "?15");
IRequestHandler handler = aliasEncoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
checkPage(page, 15);
assertEquals(PAGE_CLASS_NAME, page.getClass().getSimpleName());
}
use of org.apache.wicket.core.request.handler.RenderPageRequestHandler in project wicket by apache.
the class PackageMapperTest method encode4.
/**
*/
@Test
public void encode4() {
MockPage page = new MockPage(15);
page.getPageParameters().set(0, "i1");
page.getPageParameters().set(1, "i2");
page.getPageParameters().set("a", "b", INamedParameters.Type.QUERY_STRING);
page.getPageParameters().set("b", "c", INamedParameters.Type.QUERY_STRING);
page.setCreatedBookmarkable(true);
IPageProvider provider = new PageProvider(page);
IRequestHandler handler = new RenderPageRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "/i1/i2?15&a=b&b=c", url.toString());
}
use of org.apache.wicket.core.request.handler.RenderPageRequestHandler in project wicket by apache.
the class PageInstanceMapperTest method encode1.
/**
*/
@Test
public void encode1() {
MockPage page = new MockPage(15);
IPageProvider provider = new PageProvider(page);
IRequestHandler handler = new RenderPageRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals("wicket/page?15", url.toString());
}
Aggregations