public void testPreloadJSDependencies() throws Exception {
ServerService ss = Aura.getServerService();
DefDescriptor<ComponentDef> appDesc = Aura.getDefinitionService()
.getDefDescriptor("clientApiTest:cssStyleTest", ComponentDef.class);
AuraContext context = Aura.getContextService().startContext(AuraContext.Mode.DEV, AuraContext.Format.JS,
AuraContext.Authentication.AUTHENTICATED, appDesc);
final String uid = context.getDefRegistry().getUid(null, appDesc);
context.addLoaded(appDesc, uid);
Set<DefDescriptor<?>> dependencies = context.getDefRegistry().getDependencies(uid);
StringWriter output = new StringWriter();
ss.writeDefinitions(dependencies, output);
String sourceNoWhitespace = output.toString().replaceAll("\\s", "");