Package io.quarkus.test.common
Class PathTestHelper
- java.lang.Object
-
- io.quarkus.test.common.PathTestHelper
-
public final class PathTestHelper extends Object
Maps between builder test and application class directories.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Path
getAppClassLocation(Class<?> testClass)
Resolves the directory or the JAR file containing the application being tested by the test class.static Path
getAppClassLocationForTestLocation(String testClassLocation)
Resolves the directory or the JAR file containing the application being tested by a test from the given location.static Path
getProjectBuildDir(Path projectRoot, Path testClassLocation)
Returns the build directory of the project given its base dir and the test classes dir.static Path
getResourcesForClassesDirOrNull(Path classesDir, String name)
Returns the resources directory that compliments the classes directory.static Path
getTestClassesLocation(Class<?> testClass)
Resolves the directory or the JAR file containing the test class.static boolean
isTestClass(String className, ClassLoader classLoader, Path testLocation)
-
-
-
Method Detail
-
getTestClassesLocation
public static Path getTestClassesLocation(Class<?> testClass)
Resolves the directory or the JAR file containing the test class.- Parameters:
testClass
- the test class- Returns:
- directory or JAR containing the test class
-
getAppClassLocation
public static Path getAppClassLocation(Class<?> testClass)
Resolves the directory or the JAR file containing the application being tested by the test class.- Parameters:
testClass
- the test class- Returns:
- directory or JAR containing the application being tested by the test class
-
getAppClassLocationForTestLocation
public static Path getAppClassLocationForTestLocation(String testClassLocation)
Resolves the directory or the JAR file containing the application being tested by a test from the given location.- Parameters:
testClassLocation
- the test class location- Returns:
- directory or JAR containing the application being tested by a test from the given location
-
getResourcesForClassesDirOrNull
public static Path getResourcesForClassesDirOrNull(Path classesDir, String name)
Returns the resources directory that compliments the classes directory. This is relevant in for Gradle where classes and resources have different output locations. The method will return null if classesDir is not a directory.- Parameters:
classesDir
- classes directoryname
- 'test' for test resources or 'main' for the main resources- Returns:
- resources directory if found or null otherwise
-
isTestClass
public static boolean isTestClass(String className, ClassLoader classLoader, Path testLocation)
-
-