use of org.apache.wicket.MockPage in project wicket by apache.
the class PackageMapperTest method encodeAlias.
/**
* https://issues.apache.org/jira/browse/WICKET-3941
*/
@Test
public void encodeAlias() {
MockPage page = new MockPage(15);
page.setBookmarkable(true);
page.setCreatedBookmarkable(true);
page.setPageStateless(true);
IPageProvider provider = new PageProvider(page);
IRequestHandler handler = new RenderPageRequestHandler(provider);
Url url = aliasEncoder.mapHandler(handler);
assertEquals(MOUNT_PATH + '/' + ALIAS, url.toString());
}
use of org.apache.wicket.MockPage in project wicket by apache.
the class PackageMapperTest method encode8.
/**
*/
@Test
public void encode8() {
MockPage page = new MockPage(15);
page.setBookmarkable(true);
page.setCreatedBookmarkable(true);
page.setPageStateless(true);
IPageProvider provider = new PageProvider(page);
IRequestHandler handler = new RenderPageRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals(MOUNT_PATH + '/' + PAGE_CLASS_NAME, url.toString());
}
use of org.apache.wicket.MockPage 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.MockPage 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());
}
use of org.apache.wicket.MockPage in project wicket by apache.
the class TestMapperContext method newPageInstance.
@Override
public IRequestablePage newPageInstance(Class<? extends IRequestablePage> pageClass, PageParameters pageParameters) {
try {
MockPage page;
page = (MockPage) pageClass.newInstance();
page.setPageId(++idCounter);
page.setBookmarkable(true);
page.setCreatedBookmarkable(true);
if (pageParameters != null) {
page.getPageParameters().overwriteWith(pageParameters);
}
return page;
} catch (Exception e) {
throw new WicketRuntimeException(e);
}
}
Aggregations