@Test
public void testDojoLibrary() throws Exception {
try {
createContext();
DojoLibrary library = new DojoLibrary();
// load initialization parameters
LibraryRequestParams params = new LibraryRequestParams();
params.initDefaults();
params.setParameter("debug", "true");
params.setParameter("_js", "false");
params.setRequestUrl("https://localhost:8443/sbt.sample.web/library?lib=dojo&ver=1.4.3&debug=true");
params.setServerUrl("https://localhost:8443");
params.setContextUrl("https://localhost:8443/sbt.sample.web");
params.setServiceUrl("%context_path%/service");
params.setContextPath("/sbt.sample.web");
params.setPathInfo("/init.js");
LibraryRequest request = new LibraryRequest();
request.init(params);
String javascript = library.generateJavaScript(request);
System.out.println(javascript);
Assert.assertNotNull(javascript);
} catch (Exception e) {
e.printStackTrace(System.err);
Assert.fail("Error generating javascript caused by:"+e.getMessage());