Package org.junit.platform.launcher.core
Class HierarchicalOutputDirectoryCreator
- java.lang.Object
-
- org.junit.platform.launcher.core.HierarchicalOutputDirectoryCreator
-
- All Implemented Interfaces:
OutputDirectoryCreator
class HierarchicalOutputDirectoryCreator extends java.lang.Object implements OutputDirectoryCreator
HierarchicalOutputDirectoryCreatorthat creates directories based on the unique ID segments of aTestDescriptor.- Since:
- 1.12
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternFORBIDDEN_CHARSprivate static java.lang.StringREPLACEMENTprivate java.nio.file.PathrootDirprivate java.util.function.Supplier<java.nio.file.Path>rootDirSupplier
-
Constructor Summary
Constructors Constructor Description HierarchicalOutputDirectoryCreator(java.util.function.Supplier<java.nio.file.Path> rootDirSupplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.file.PathcreateOutputDirectory(TestDescriptor testDescriptor)Create an output directory for the supplied test descriptor.java.nio.file.PathgetRootDirectory(){@return the root directory for all output files; never {@code null}}private static java.lang.StringsanitizeName(java.lang.String value)private static java.nio.file.PathtoSanitizedPath(UniqueId.Segment segment)
-
-
-
Field Detail
-
FORBIDDEN_CHARS
private static final java.util.regex.Pattern FORBIDDEN_CHARS
-
REPLACEMENT
private static final java.lang.String REPLACEMENT
- See Also:
- Constant Field Values
-
rootDirSupplier
private final java.util.function.Supplier<java.nio.file.Path> rootDirSupplier
-
rootDir
private volatile java.nio.file.Path rootDir
-
-
Method Detail
-
createOutputDirectory
public java.nio.file.Path createOutputDirectory(TestDescriptor testDescriptor) throws java.io.IOException
Description copied from interface:OutputDirectoryCreatorCreate an output directory for the supplied test descriptor.- Specified by:
createOutputDirectoryin interfaceOutputDirectoryCreator- Parameters:
testDescriptor- the test descriptor for which to create an output directory; nevernull- Returns:
- the output directory
- Throws:
java.io.IOException- if the output directory could not be created
-
getRootDirectory
public java.nio.file.Path getRootDirectory()
Description copied from interface:OutputDirectoryCreator{@return the root directory for all output files; never {@code null}}- Specified by:
getRootDirectoryin interfaceOutputDirectoryCreator
-
toSanitizedPath
private static java.nio.file.Path toSanitizedPath(UniqueId.Segment segment)
-
sanitizeName
private static java.lang.String sanitizeName(java.lang.String value)
-
-