@Test public void should_dump_configuration_as_xml() { when(pmdProfileExporter.exportProfile(PmdConstants.REPOSITORY_KEY, rulesProfile)).thenReturn(PmdTestUtils.getResourceContent("/org/sonar/plugins/pmd/simple.xml")); when(pmdProfileExporter.exportProfile(PmdConstants.TEST_REPOSITORY_KEY, rulesProfile)).thenReturn(PmdTestUtils.getResourceContent("/org/sonar/plugins/pmd/junit.xml")); Report report = pmdExecutor.execute(); verify(pmdConfiguration).dumpXmlReport(report); }
public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } PmdExecutor(FileSystem fileSystem, RulesProfile rulesProfile, PmdProfileExporter pmdProfileExporter,
					   PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Settings settings); }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } PmdExecutor(FileSystem fileSystem, RulesProfile rulesProfile, PmdProfileExporter pmdProfileExporter,
					   PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Settings settings); Report execute(); Iterable<File> javaFiles(Type fileType); Iterable<File> xmlFiles(Type fileType); void executeRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey); void executeXmlRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey); }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } PmdExecutor(FileSystem fileSystem, RulesProfile rulesProfile, PmdProfileExporter pmdProfileExporter,
					   PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Settings settings); Report execute(); Iterable<File> javaFiles(Type fileType); Iterable<File> xmlFiles(Type fileType); void executeRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey); void executeXmlRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey);  }