use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method decode1A.
/**
*/
@Test
public void decode1A() {
Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference1?en");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ResourceReferenceRequestHandler.class));
ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler) handler;
assertEquals(resource1, h.getResource());
assertEquals(Locale.ENGLISH, h.getLocale());
assertEquals(null, h.getStyle());
assertEquals(null, h.getVariation());
assertEquals(0, h.getPageParameters().getIndexedCount());
assertEquals(0, h.getPageParameters().getNamedKeys().size());
}
use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method decode5.
/**
*/
@Test
public void decode5() {
Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference3?-style");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ResourceReferenceRequestHandler.class));
ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler) handler;
assertEquals(resource3, h.getResource());
assertEquals(null, h.getLocale());
assertEquals("style", h.getStyle());
assertEquals(null, h.getVariation());
assertEquals(0, h.getPageParameters().getIndexedCount());
assertEquals(0, h.getPageParameters().getNamedKeys().size());
}
use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method decode6.
/**
*/
@Test
public void decode6() {
Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference3?-style&p1=v1&p2=v2");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ResourceReferenceRequestHandler.class));
ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler) handler;
assertEquals(resource3, h.getResource());
assertEquals(null, h.getLocale());
assertEquals("style", h.getStyle());
assertEquals(null, h.getVariation());
assertEquals(0, h.getPageParameters().getIndexedCount());
assertEquals("v1", h.getPageParameters().get("p1").toString());
assertEquals("v2", h.getPageParameters().get("p2").toString());
}
use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method encode3.
/**
*/
@Test
public void encode3() {
ResourceReferenceRequestHandler handler = new ResourceReferenceRequestHandler(reference2, null);
Url url = encoder.mapHandler(handler);
assertEquals("wicket/resource/" + CLASS_NAME + "/reference2/name2?en_EN", url.toString());
}
use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method encode8.
/**
*/
@Test
public void encode8() {
PageParameters parameters = new PageParameters();
parameters.set(0, "X");
parameters.add("p1", "v1", INamedParameters.Type.QUERY_STRING);
parameters.add("p2", "v2", INamedParameters.Type.QUERY_STRING);
ResourceReferenceRequestHandler handler = new ResourceReferenceRequestHandler(reference4, parameters);
Url url = encoder.mapHandler(handler);
assertEquals("wicket/resource/" + CLASS_NAME + "/reference4?en-style&p1=v1&p2=v2", url.toString());
}
Aggregations