Fix tests

This commit is contained in:
Andreas Dangel
2023-05-05 12:57:18 +02:00
parent 6ade09a840
commit bc9c43fb42
4 changed files with 5 additions and 5 deletions

View File

@ -124,7 +124,7 @@ class GlobalListenerTest {
PMDConfiguration config = new PMDConfiguration();
config.setAnalysisCache(new NoopAnalysisCache());
config.setIgnoreIncrementalAnalysis(true);
config.setThreads(1);
config.setThreads(0); // no multithreading for this test
return config;
}

View File

@ -65,8 +65,8 @@ class PmdRunnableTest {
reporter = mock(MessageReporter.class);
configuration.setReporter(reporter);
// exceptions thrown on a worker thread are not thrown by the main thread,
// so this test only makes sense with one thread
configuration.setThreads(1);
// so this test only makes sense without separate threads
configuration.setThreads(0);
}

View File

@ -233,7 +233,7 @@ abstract class BaseParsingHelper<Self : BaseParsingHelper<Self, T>, T : RootNode
suppressMarker = params.suppressMarker
forceLanguageVersion = defaultVersion
isIgnoreIncrementalAnalysis = true
threads = 1
threads = 0 // don't use separate threads for rule execution
}
return PmdAnalysis.create(config).use { pmd ->

View File

@ -226,7 +226,7 @@ public abstract class RuleTst {
PMDConfiguration configuration = new PMDConfiguration();
configuration.setIgnoreIncrementalAnalysis(true);
configuration.setDefaultLanguageVersion(languageVersion);
configuration.setThreads(1);
configuration.setThreads(0); // don't use separate threads
configuration.prependAuxClasspath(".");
try (PmdAnalysis pmd = PmdAnalysis.create(configuration)) {