Search in sources :

Example 1 with JavaScriptPackageResource

use of org.apache.wicket.request.resource.JavaScriptPackageResource in project wicket by apache.

the class PackageResourceTest method javascriptFileWithEncoding.

@Test
public void javascriptFileWithEncoding() {
    final String encoding = "Klingon-8859-42";
    final JavaScriptPackageResource resource = new JavaScriptPackageResource(PackageResourceTest.class, "packaged3.js", null, null, null) {

        private static final long serialVersionUID = 1L;
    };
    resource.setTextEncoding(encoding);
    tester.startResource(resource);
    final String contentType = tester.getLastResponse().getContentType();
    assertEquals("text/javascript; charset=" + encoding, contentType);
}
Also used : JavaScriptPackageResource(org.apache.wicket.request.resource.JavaScriptPackageResource) Test(org.junit.Test)

Aggregations

JavaScriptPackageResource (org.apache.wicket.request.resource.JavaScriptPackageResource)1 Test (org.junit.Test)1