use of org.apache.wicket.request.UrlRenderer in project wicket by apache.
the class UrlRendererTest method test7.
/**
*/
@Test
public void test7() {
UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("MyTestPage/indexed1/indexed2/indexed3?10-27.ILinkListener-l2&p1=v1")));
assertEquals("../../../MyTestPage?10", r1.renderUrl(Url.parse("MyTestPage?10")));
}
use of org.apache.wicket.request.UrlRenderer in project wicket by apache.
the class UrlRendererTest method test8.
/**
*/
@Test
public void test8() {
UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("en/first-test-page?16-1.ILinkListener-l1")));
assertEquals("./first-test-page/indexed1/indexed2/indexed3?p1=v1", r1.renderUrl(Url.parse("en/first-test-page/indexed1/indexed2/indexed3?p1=v1")));
}
use of org.apache.wicket.request.UrlRenderer in project wicket by apache.
the class UrlRendererTest method renderFullUrlWithRelativeArgument.
@Test
public void renderFullUrlWithRelativeArgument() {
Url baseUrl = Url.parse("one/two/three");
baseUrl.setProtocol("http");
baseUrl.setHost("www.example.com");
baseUrl.setPort(8888);
UrlRenderer renderer = new UrlRenderer(new MockWebRequest(baseUrl));
// this is needed because MockWebRequest cuts data
renderer.setBaseUrl(baseUrl);
String fullUrl = renderer.renderFullUrl(Url.parse("../four"));
assertEquals("http://www.example.com:8888/one/four", fullUrl);
}
Aggregations