use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method encode7.
/**
*/
@Test
public void encode7() {
ResourceReferenceRequestHandler handler = new ResourceReferenceRequestHandler(reference4, null);
Url url = encoder.mapHandler(handler);
assertEquals("wicket/resource/" + CLASS_NAME + "/reference4?en-style", url.toString());
}
use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method encode9.
/**
* Tests request to url encoding when style is null but variation is not
*/
@Test
public void encode9() {
ResourceReferenceRequestHandler handler = new ResourceReferenceRequestHandler(reference5, null);
Url url = encoder.mapHandler(handler);
assertEquals("wicket/resource/" + CLASS_NAME + "/reference5?en--variation", url.toString());
}
use of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler in project wicket by apache.
the class BasicResourceReferenceMapperTest method decode2A.
/**
*/
@Test
public void decode2A() {
Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference1?-style&p1=v1&p2=v2");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ResourceReferenceRequestHandler.class));
ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler) handler;
assertEquals(resource1, 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 decode3A.
/**
*/
@Test
public void decode3A() {
Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference2/name2?en_EN-style");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ResourceReferenceRequestHandler.class));
ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler) handler;
assertEquals(resource2, h.getResource());
assertEquals(new Locale("en", "en"), 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 decode9.
/**
*/
@Test
public void decode9() {
Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference5?en--variation&p1=v1&p2=v2");
IRequestHandler handler = encoder.mapRequest(getRequest(url));
assertThat(handler, instanceOf(ResourceReferenceRequestHandler.class));
ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler) handler;
assertEquals(resource5, h.getResource());
assertEquals(Locale.ENGLISH, h.getLocale());
assertEquals(null, h.getStyle());
assertEquals("variation", h.getVariation());
assertEquals(0, h.getPageParameters().getIndexedCount());
assertEquals("v1", h.getPageParameters().get("p1").toString());
assertEquals("v2", h.getPageParameters().get("p2").toString());
}
Aggregations