use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class PackageMapperTest method decode1.
/**
*/
@Test
public void decode1() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME);
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
assertEquals(PAGE_CLASS_NAME, page.getClass().getSimpleName());
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 PackageMapperTest method decodePageClassWithPathParameters.
/**
* https://issues.apache.org/jira/browse/WICKET-5500
*/
@Test
public void decodePageClassWithPathParameters() {
Url url = Url.parse(MOUNT_PATH + '/' + PAGE_CLASS_NAME + ";something=else");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertTrue(handler instanceof RenderPageRequestHandler);
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
assertEquals(PAGE_CLASS_NAME, page.getClass().getSimpleName());
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 PackageMapperTest method decodeAlias.
/**
* https://issues.apache.org/jira/browse/WICKET-3941
*/
@Test
public void decodeAlias() {
Url url = Url.parse(MOUNT_PATH + '/' + ALIAS + "?15");
IRequestHandler handler = aliasEncoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(RenderPageRequestHandler.class));
IRequestablePage page = ((RenderPageRequestHandler) handler).getPage();
checkPage(page, 15);
assertEquals(PAGE_CLASS_NAME, page.getClass().getSimpleName());
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class PageInstanceMapperTest method decode10.
@Test
public void decode10() {
final Url url = Url.parse("page?4");
Request request = new Request() {
@Override
public Url getUrl() {
return url;
}
@Override
public Locale getLocale() {
return null;
}
@Override
public Charset getCharset() {
return Charset.forName("UTF-8");
}
@Override
public Url getClientUrl() {
return Url.parse("page");
}
@Override
public Object getContainerRequest() {
return null;
}
};
IRequestHandler handler = encoder.mapRequest(request);
IRequestablePage page = ((IPageRequestHandler) handler).getPage();
checkPage(page, 4);
}
use of org.apache.wicket.request.component.IRequestablePage in project wicket by apache.
the class PageInstanceMapperTest method decode9.
@Test
public void decode9() {
final Url url = Url.parse("page?4");
Request request = new Request() {
@Override
public Url getUrl() {
return url;
}
@Override
public Locale getLocale() {
return null;
}
@Override
public Charset getCharset() {
return Charset.forName("UTF-8");
}
@Override
public Url getClientUrl() {
return Url.parse("wicket/page");
}
@Override
public Object getContainerRequest() {
return null;
}
};
IRequestHandler handler = encoder.mapRequest(request);
IRequestablePage page = ((IPageRequestHandler) handler).getPage();
checkPage(page, 4);
}
Aggregations