ResourceAggregator { public boolean registerResource(IResource resource, String target) { return m_model.registerResource(resource, target); } 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 testRegisterResource() { ResourceModel model = ResourceRuntimeContext.ctx().getModel(); Assert.assertTrue(model.registerSlot("js-slot", "js")); IResource resource = ResourceFactory.createResource("/js/sample/sample.js"); ResourceAggregator aggregator = ResourceRuntimeContext.ctx().getResourceAggregator(); Assert.assertFalse(aggregator.isRegisteredResource(resource)); Assert.assertNull(aggregator.getSlotResources("js-slot", "js")); Assert.assertTrue(aggregator.registerResource("js-slot", resource)); Assert.assertTrue(aggregator.isRegisteredResource(resource)); Assert.assertTrue(aggregator.getActiveSlotIds("js").size() == 1); }