mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[build] Add UltimateProjectTestsStructureTest#no @PerformanceUnitTest methods in junit5 performance tests test (in intellij.idea.ultimate.build.tests module) to check that no unsupported junit5 performance tests (IJI-3451)
Also adds includeEverything optional parameter in ClassFinder to specify whether all classes should be matched. GitOrigin-RevId: 1596b333da370e81e2667516357f9c5514623cb0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8e086d14f3
commit
d6191d1cad
@@ -22,10 +22,16 @@ public class ClassFinder {
|
||||
private final List<String> classNameList;
|
||||
private final Path classPathRoot;
|
||||
private final boolean includeUnconventionallyNamedTests;
|
||||
private final boolean includeEverything;
|
||||
|
||||
public ClassFinder(final Path classPathRoot, final String rootPackage, boolean includeUnconventionallyNamedTests) {
|
||||
this(classPathRoot, rootPackage, includeUnconventionallyNamedTests, false);
|
||||
}
|
||||
|
||||
public ClassFinder(final Path classPathRoot, final String rootPackage, boolean includeUnconventionallyNamedTests, boolean includeEverything) {
|
||||
this.classPathRoot = classPathRoot;
|
||||
this.includeUnconventionallyNamedTests = includeUnconventionallyNamedTests;
|
||||
this.includeEverything = includeEverything;
|
||||
String directoryOffset = rootPackage.replace(".", classPathRoot.getFileSystem().getSeparator());
|
||||
if (Files.isRegularFile(classPathRoot)) {
|
||||
classNameList = findAndStoreTestClassesFromJar(directoryOffset);
|
||||
@@ -38,6 +44,12 @@ public class ClassFinder {
|
||||
private @Nullable String computeClassName(final @NotNull Path path, final @NotNull Path root) {
|
||||
Path absPath = path.toAbsolutePath();
|
||||
String fileName = absPath.getFileName().toString();
|
||||
if (includeEverything) {
|
||||
if (fileName.endsWith(".class")) {
|
||||
return getClassFQN(absPath, root);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (!includeUnconventionallyNamedTests) {
|
||||
// It's faster and easier to check for `endsWith` rather than `extensionEquals` (see below) which does `endsWith`
|
||||
if (fileName.endsWith("Test.class")) {
|
||||
|
||||
Reference in New Issue
Block a user