Search in sources :

Example 6 with IPageProvider

use of org.apache.wicket.core.request.handler.IPageProvider in project wicket by apache.

the class MountedMapperTest method encode4.

/**
 */
@Test
public void encode4() {
    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(true);
    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);
    assertEquals("some/mount/path/i1/i2?15&a=b&b=c", url.toString());
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) RenderPageRequestHandler(org.apache.wicket.core.request.handler.RenderPageRequestHandler) PageProvider(org.apache.wicket.core.request.handler.PageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) MockPage(org.apache.wicket.MockPage) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 7 with IPageProvider

use of org.apache.wicket.core.request.handler.IPageProvider 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());
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) RenderPageRequestHandler(org.apache.wicket.core.request.handler.RenderPageRequestHandler) PageProvider(org.apache.wicket.core.request.handler.PageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) MockPage(org.apache.wicket.MockPage) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 8 with IPageProvider

use of org.apache.wicket.core.request.handler.IPageProvider 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());
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) RenderPageRequestHandler(org.apache.wicket.core.request.handler.RenderPageRequestHandler) PageProvider(org.apache.wicket.core.request.handler.PageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) MockPage(org.apache.wicket.MockPage) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 9 with IPageProvider

use of org.apache.wicket.core.request.handler.IPageProvider 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());
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) PageProvider(org.apache.wicket.core.request.handler.PageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) BookmarkablePageRequestHandler(org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) InnerPage(org.apache.wicket.core.request.mapper.PackageMapperTest.OuterPage.InnerPage) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 10 with IPageProvider

use of org.apache.wicket.core.request.handler.IPageProvider in project wicket by apache.

the class PackageMapperTest method encode4.

/**
 */
@Test
public void encode4() {
    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(true);
    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());
}
Also used : IRequestHandler(org.apache.wicket.request.IRequestHandler) RenderPageRequestHandler(org.apache.wicket.core.request.handler.RenderPageRequestHandler) PageProvider(org.apache.wicket.core.request.handler.PageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) IPageProvider(org.apache.wicket.core.request.handler.IPageProvider) MockPage(org.apache.wicket.MockPage) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Aggregations

IPageProvider (org.apache.wicket.core.request.handler.IPageProvider)16 PageProvider (org.apache.wicket.core.request.handler.PageProvider)16 IRequestHandler (org.apache.wicket.request.IRequestHandler)15 Url (org.apache.wicket.request.Url)15 Test (org.junit.Test)15 RenderPageRequestHandler (org.apache.wicket.core.request.handler.RenderPageRequestHandler)13 MockPage (org.apache.wicket.MockPage)12 BookmarkablePageRequestHandler (org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler)3 MockPageParametersAware (org.apache.wicket.MockPageParametersAware)2 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)2 InnerPage (org.apache.wicket.core.request.mapper.PackageMapperTest.OuterPage.InnerPage)1 IRequestParameters (org.apache.wicket.request.IRequestParameters)1 StringValue (org.apache.wicket.util.string.StringValue)1