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 PathgetAppClassLocation(Class<?> testClass) Resolves the directory or the JAR file containing the application being tested by the test class.static PathgetAppClassLocationForTestLocation(Path testClassLocationPath) Resolves the directory or the JAR file containing the application being tested by a test from the given location.static PathgetProjectBuildDir(Path projectRoot, Path testClassLocation) Returns the build directory of the project given its base dir and the test classes dir.static PathgetResourcesForClassesDirOrNull(Path classesDir, String name) Returns the resources directory that compliments the classes directory.static PathgetTestClassesLocation(Class<?> testClass) Resolves the directory or the JAR file containing the test class.static booleanisTestClass(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:
testClassLocationPath- 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
-