use of org.apache.wicket.request.component.IRequestableComponent in project wicket by apache.
the class BookmarkableMapperTest method encode6.
/**
*/
@Test
public void encode6() {
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);
// shouldn't make any difference for BookmarkableListenerRequestHandler,
// as this explicitly says the url must be bookmarkable
page.setCreatedBookmarkable(false);
IRequestableComponent c = page.get("foo:bar");
PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
IRequestHandler handler = new BookmarkableListenerRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals("wicket/bookmarkable/" + PAGE_CLASS_NAME + "/i1/i2?15-0.-foo-bar&a=b&b=c", url.toString());
}
use of org.apache.wicket.request.component.IRequestableComponent in project wicket by apache.
the class MountedMapperTest method encode7.
/**
*/
@Test
public void encode7() {
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.setRenderCount(5);
// shouldn't make any difference for BookmarkableListenerRequestHandler,
// as this explicitly says the url must be bookmarkable
page.setCreatedBookmarkable(false);
IRequestableComponent c = page.get("foo:bar");
PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
IRequestHandler handler = new BookmarkableListenerRequestHandler(provider, 4);
Url url = encoder.mapHandler(handler);
assertEquals("some/mount/path/i1/i2?15-5.4-foo-bar&a=b&b=c", url.toString());
}
use of org.apache.wicket.request.component.IRequestableComponent in project wicket by apache.
the class MountedMapperTest method encode6.
/**
*/
@Test
public void encode6() {
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.setRenderCount(4);
// shouldn't make any difference for BookmarkableListenerRequestHandler,
// as this explicitly says the url must be bookmarkable
page.setCreatedBookmarkable(false);
IRequestableComponent c = page.get("foo:bar");
PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
IRequestHandler handler = new BookmarkableListenerRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals("some/mount/path/i1/i2?15-4.-foo-bar&a=b&b=c", url.toString());
}
use of org.apache.wicket.request.component.IRequestableComponent in project wicket by apache.
the class MountedMapperTest method encode7_1.
/**
* https://issues.apache.org/jira/browse/WICKET-4014
*
* The difference with testEncode7 is that here ListenerRequestHandler is used instead
* of BookmarkableListenerRequestHandler
*/
@Test
public void encode7_1() {
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.setRenderCount(5);
// shouldn't make any difference for ListenerRequestHandler,
// as this explicitly says the url must be bookmarkable
page.setCreatedBookmarkable(false);
IRequestableComponent c = page.get("foo:bar");
PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
IRequestHandler handler = new ListenerRequestHandler(provider, 4);
Url url = encoder.mapHandler(handler);
assertEquals("some/mount/path/i1/i2?15-5.4-foo-bar&a=b&b=c", url.toString());
}
use of org.apache.wicket.request.component.IRequestableComponent in project wicket by apache.
the class MountedMapperTest method encode6_1.
/**
* https://issues.apache.org/jira/browse/WICKET-4014
*
* The difference with testEncode7 is that here ListenerRequestHandler is used instead
* of BookmarkableListenerRequestHandler
*/
@Test
public void encode6_1() {
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);
// WICKET-4038
page.getPageParameters().add(WebRequest.PARAM_AJAX, "true", INamedParameters.Type.QUERY_STRING);
page.getPageParameters().add(WebRequest.PARAM_AJAX_BASE_URL, "some/base/url", INamedParameters.Type.QUERY_STRING);
page.setRenderCount(4);
// shouldn't make any difference for ListenerRequestHandler,
// as this explicitly says the url must be bookmarkable
page.setCreatedBookmarkable(false);
IRequestableComponent c = page.get("foo:bar");
PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
IRequestHandler handler = new ListenerRequestHandler(provider);
Url url = encoder.mapHandler(handler);
assertEquals("some/mount/path/i1/i2?15-4.-foo-bar&a=b&b=c", url.toString());
}
Aggregations