ApplicationDef def = cmpDesc.getDef();
Set<ResourceDef> resourceDefs = def.getResourceDefs();
DefDescriptor<ResourceDef> jsResourceDefDesc = Aura.getDefinitionService().getDefDescriptor("js://clientLibraryTest.clientLibraryTest", ResourceDef.class);
ResourceDef jsResourceDef = jsResourceDefDesc.getDef();
DefDescriptor<ResourceDef> cssResourceDefDesc = Aura.getDefinitionService().getDefDescriptor("css://clientLibraryTest.clientLibraryTest", ResourceDef.class);
ResourceDef cssResourceDef = cssResourceDefDesc.getDef();
assertTrue("JS resource should be in component", resourceDefs.contains(jsResourceDef));
assertTrue("CSS resource should be in component", resourceDefs.contains(cssResourceDef));
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
Json json = Json.createJsonStream(baos, false, false, false);
jsResourceDef.serialize(json);
cssResourceDef.serialize(json);
json.close();
assertEquals("ResourceDefs are not serialized.", "", new String(baos.toByteArray(), Charsets.UTF_8));
}