use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class MountedMapperTest method decode2.
/**
*/
@Test
public void decode2() {
Url url = Url.parse("some/mount/path/indexed1?a=b&b=c");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
PageParameters p = page.getPageParameters();
assertEquals(1, p.getIndexedCount());
assertEquals("indexed1", p.get(0).toString());
assertEquals(2, p.getNamedKeys().size());
assertEquals("b", p.get("a").toString());
assertEquals("c", p.get("b").toString());
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class MountedMapperTest method decode10.
/**
*/
@Test
public void decode10() {
Url url = Url.parse("some/mount/path?15-5.4-foo-bar");
context.setNextPageRenderCount(5);
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ListenerRequestHandler.class));
ListenerRequestHandler h = (ListenerRequestHandler) handler;
IRequestablePage page = h.getPage();
assertEquals(5, page.getRenderCount());
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class MountedMapperTest method decode1CaseInsensitively.
/**
* https://issues.apache.org/jira/browse/WICKET-4994
*/
@Test
public void decode1CaseInsensitively() {
Url url = Url.parse("somE/moUnt/paTh");
IRequestHandler handler = encoder.setCaseSensitiveMatch(false).mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
assertEquals(0, page.getPageParameters().getIndexedCount());
assertTrue(page.getPageParameters().getNamedKeys().isEmpty());
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class MountedMapperTest method decode5.
/**
*/
@Test
public void decode5() {
Url url = Url.parse("some/mount/path?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.component.IRequestablePage in project wicket by apache.
the class MountedMapperTest method decode6.
/**
*/
@Test
public void decode6() {
Url url = Url.parse("some/mount/path/i1/i2?15--foo-bar&a=b&b=c");
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());
PageParameters p = page.getPageParameters();
assertEquals(0, p.getIndexedCount());
assertEquals(0, p.getNamedKeys().size());
}
Aggregations