use of org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler in project wicket by apache.
the class MountedMapperTest 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("some/mount/path/i1/i2?a=b&b=c", url.toString());
}
use of org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler in project wicket by apache.
the class MountedMapperTest method optionPlaceholderEncode2.
/**
*/
@Test
public void optionPlaceholderEncode2() {
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);
parameters.set("param2", "p2", INamedParameters.Type.PATH);
parameters.set("param3", "p3", INamedParameters.Type.PATH);
PageProvider provider = new PageProvider(MockPage.class, parameters);
provider.setPageSource(context);
IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
Url url = optionPlaceholderEncoder.mapHandler(handler);
assertEquals("some/path/p2/p3/i1/i2?a=b&b=c", url.toString());
}
use of org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler in project wicket by apache.
the class PackageMapperTest method encodeInnerClass.
/**
* https://issues.apache.org/jira/browse/WICKET-3838
*/
@Test
public void encodeInnerClass() {
InnerPage page = new OuterPage.InnerPage();
IPageProvider provider = new PageProvider(page);
IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
Url url = innerClassEncoder.mapHandler(handler);
assertEquals(MOUNT_PATH + '/' + "PackageMapperTest$OuterPage$InnerPage", url.toString());
}
use of org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler in project wicket by apache.
the class PackageMapperTest method encode1.
/**
*/
@Test
public void encode1() {
PageProvider provider = new PageProvider(MockPage.class, new PageParameters());
provider.setPageSource(context);
IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals(MOUNT_PATH + '/' + PAGE_CLASS_NAME, url.toString());
}
use of org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler in project wicket by apache.
the class PackageMapperTest 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(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "/i1/i2?a=b&b=c", url.toString());
}
Aggregations