use of org.apache.wicket.request.IRequestHandler in project wicket by apache.
the class PackageMapperTest method decode11.
/**
* https://issues.apache.org/jira/browse/WICKET-5996
*/
@Test
public void decode11() {
Url url = Url.parse(MOUNT_PATH);
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, is(nullValue()));
}
use of org.apache.wicket.request.IRequestHandler 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.request.IRequestHandler in project wicket by apache.
the class PackageMapperTest method decode5.
/**
*/
@Test
public void decode5() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "?15--foo-bar");
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());
assertNull(h.getBehaviorIndex());
}
use of org.apache.wicket.request.IRequestHandler in project wicket by apache.
the class PackageMapperTest method decode7.
/**
*/
@Test
public void decode7() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME + "?15-.4-foo-bar");
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());
assertEquals((Object) 4, h.getBehaviorIndex());
}
use of org.apache.wicket.request.IRequestHandler 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());
}
Aggregations