Search in sources :

Example 6 with BookmarkablePageRequestHandler

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

the class BookmarkableMapperTest 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("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?a=b&b=c", 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) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 7 with BookmarkablePageRequestHandler

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

the class BookmarkableMapperTest 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("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?a=b&b=c", 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) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 8 with BookmarkablePageRequestHandler

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

the class MountedMapperTest 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("some/mount/path", 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) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 9 with BookmarkablePageRequestHandler

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

the class MountedMapperTest method optionPlaceholderEncode1.

/**
 */
@Test
public void optionPlaceholderEncode1() {
    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("param1", "p1", INamedParameters.Type.PATH);
    parameters.set("param2", "p2", 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/p1/path/p2/i1/i2?a=b&b=c", 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) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Example 10 with BookmarkablePageRequestHandler

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

the class MountedMapperTest method placeholderEncode2.

/**
 */
@Test
public void placeholderEncode2() {
    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("param1", "p1", INamedParameters.Type.PATH);
    parameters.set("param2", "p2", INamedParameters.Type.PATH);
    PageProvider provider = new PageProvider(MockPage.class, parameters);
    provider.setPageSource(context);
    IRequestHandler handler = new BookmarkablePageRequestHandler(provider);
    Url url = placeholderEncoder.mapHandler(handler);
    assertEquals("some/p1/path/p2/i1/i2?a=b&b=c", 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) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Url(org.apache.wicket.request.Url) Test(org.junit.Test)

Aggregations

BookmarkablePageRequestHandler (org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler)18 PageProvider (org.apache.wicket.core.request.handler.PageProvider)17 IPageProvider (org.apache.wicket.core.request.handler.IPageProvider)16 IRequestHandler (org.apache.wicket.request.IRequestHandler)16 Test (org.junit.Test)16 Url (org.apache.wicket.request.Url)15 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)15 MockPageParametersAware (org.apache.wicket.MockPageParametersAware)2 BookmarkableListenerRequestHandler (org.apache.wicket.core.request.handler.BookmarkableListenerRequestHandler)1 RenderPageRequestHandler (org.apache.wicket.core.request.handler.RenderPageRequestHandler)1 CryptoMapper (org.apache.wicket.core.request.mapper.CryptoMapper)1 InnerPage (org.apache.wicket.core.request.mapper.PackageMapperTest.OuterPage.InnerPage)1 WebApplication (org.apache.wicket.protocol.http.WebApplication)1 IRequestHandlerDelegate (org.apache.wicket.request.IRequestHandlerDelegate)1 IRequestParameters (org.apache.wicket.request.IRequestParameters)1 IRequestablePage (org.apache.wicket.request.component.IRequestablePage)1 ComponentInfo (org.apache.wicket.request.mapper.info.ComponentInfo)1 PageComponentInfo (org.apache.wicket.request.mapper.info.PageComponentInfo)1 PageInfo (org.apache.wicket.request.mapper.info.PageInfo)1 StringValue (org.apache.wicket.util.string.StringValue)1