use of org.apache.wicket.core.request.handler.PageProvider in project wicket by apache.
the class MountedMapperTest 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("some/mount/path", url.toString());
}
use of org.apache.wicket.core.request.handler.PageProvider in project wicket by apache.
the class MountedMapperTest method encode2.
/**
*/
@Test
public void encode2() {
PageParameters parameters = new PageParameters();
parameters.set(0, "i1");
parameters.set(1, "i2");
parameters.set("a", "b", INamedParameters.Type.QUERY_STRING);
parameters.set("b", "c", INamedParameters.Type.QUERY_STRING);
PageProvider provider = new PageProvider(MockPage.class, parameters);
provider.setPageSource(context);
IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals("some/mount/path/i1/i2?a=b&b=c", url.toString());
}
use of org.apache.wicket.core.request.handler.PageProvider in project wicket by apache.
the class PackageMapperTest method encodeNamedPageParameters.
/**
*/
@Test
public void encodeNamedPageParameters() {
MockPage page = new MockPage(15);
page.setBookmarkable(true);
page.setCreatedBookmarkable(true);
page.setPageStateless(true);
IPageProvider provider = new PageProvider(page);
page.getPageParameters().set("foo", "fooValue", INamedParameters.Type.PATH);
page.getPageParameters().set("bar", "barValue", INamedParameters.Type.PATH);
IRequestHandler handler = new RenderPageRequestHandler(provider);
Url url = namedParametersEncoder.mapHandler(handler);
assertEquals(MOUNT_PATH + "/fooValue/barValue/" + PAGE_CLASS_NAME, url.toString());
}
use of org.apache.wicket.core.request.handler.PageProvider in project wicket by apache.
the class PackageMapperTest method encode5.
/**
*/
@Test
public void encode5() {
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(false);
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.PageProvider in project wicket by apache.
the class PackageMapperTest method encode3.
/**
*/
@Test
public void encode3() {
PageParameters parameters = new PageParameters();
parameters.set(0, "i1");
parameters.set(1, "i2");
parameters.set("a", "b", INamedParameters.Type.QUERY_STRING);
parameters.set("b", "c", INamedParameters.Type.QUERY_STRING);
PageProvider provider = new PageProvider(MockPage.class, parameters);
provider.setPageSource(context);
IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "/i1/i2?a=b&b=c", url.toString());
}
Aggregations