ResourceAggregator { public void setDeferJsSlots(List<String> slotIds) { for (String slotId : slotIds) { Slot slot = m_model.getOrCreateSlot(slotId, ResourceTypeConstants.JS); slot.setDeferred(true); } } ResourceAggregator(ResourceModel model); List<String> getActiveSlotIds(String type); List<IResource> getAfterSlotResources(String slotId, String slotType); List<IResource> getBeforeSlotResources(String slotId, String slotType); ResourceModel getModel(); IResource getResourceOutput(IResource resource); IResource getSlotResources(String slotId, String type); List<IResource> getSlotResourcesWithGroup(String slotId, String type); boolean isRegisteredResource(IResource resource); boolean registerResource(IResource resource, String target); boolean registerResource(String target, IResource resource); void registerResource(String slotId, IResource resource, INSERTION position); boolean registerSlot(String slotId, String slotType); void setDeferJsSlots(List<String> slotIds);  }
@Test public void testSetDeferJsSlots() { ResourceModel model = ResourceRuntimeContext.ctx().getModel(); String slot1 = "js-slot1"; String slot2 = "js-slot2"; Assert.assertTrue(model.registerSlot(slot1, "js")); Assert.assertTrue(model.registerSlot(slot2, "js")); List<String> slots = new ArrayList<String>(); slots.add(slot1); slots.add(slot2); ResourceAggregator aggregator = ResourceRuntimeContext.ctx().getResourceAggregator(); aggregator.setDeferJsSlots(slots); }