@Before public void init() throws ScmException { when(moduleFileSystem.baseDir()).thenReturn(projectBaseDir); when(changeLog.getChangeLog()).thenReturn(changeLogSet); when(changeLogSet.getChangeSets()).thenReturn(changeSets); when(scmFacade.getChangeLog(projectBaseDir, datefrom.toDate(), dateTo.toDate())) .thenReturn(changeLog); when(fileExclusions.sourceExclusions()).thenReturn(new String[0]); when(fileExclusions.sourceInclusions()).thenReturn(new String[0]); }
@Override public void decorate(Resource resource, DecoratorContext context) { if (!ResourceUtils.isPersistable(resource)) { return; } File path = null; if (ResourceUtils.isProject(resource)) { path = fs.baseDir(); } else if (resource.getPath() != null) { path = new File(fs.baseDir(), resource.getPath()); } ResourceNode resourceNode = new ResourceNode(resource, path, fs.sourceCharset()); RESOURCE_BY_KEY.put(resource.getEffectiveKey(), resourceNode); for (DecoratorContext childContext : context.getChildren()) { Resource child = childContext.getResource(); ResourceNode childNode = RESOURCE_BY_KEY.get(child.getEffectiveKey()); if (childNode != null) { resourceNode.addChild(childNode); } } }