Package io.quarkus.test.common
Class PathTestHelper
java.lang.Object
io.quarkus.test.common.PathTestHelper
Maps between builder test and application class directories.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
getTestClassesLocation
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
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
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
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
-
getProjectBuildDir
Returns the build directory of the project given its base dir and the test classes dir.- Parameters:
projectRoot
- project dirtestClassLocation
- test dir- Returns:
- project build dir
-