public final class TestHelper extends Object
Constructor and Description |
---|
TestHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
cleanPathSegment(String toClean)
Removes characters that aren't acceptable in a file path (mostly for windows).
|
static File |
generateTempFile(Class clazz,
String fileName,
String fileNameSuffix)
Creates a
File reference in the path returned from makeTestDataPath(java.lang.Class, java.lang.String) in a subdirectory
called temp . |
static File |
generateTempFileFromResource(Class resourceClass,
String resourceName,
String extension)
Copies a file stored as part of a resource to the file system in the path returned from
makeTestDataPath(java.lang.Class, java.lang.String) in a subdirectory called temp/resources . |
static File |
makeTestDataPath(Class clazz,
String childPath)
Creates a
File reference that points to a directory relative to the supplied class in the
/target directory. |
public static File makeTestDataPath(Class clazz, String childPath)
File
reference that points to a directory relative to the supplied class in the
/target
directory.public static File generateTempFile(Class clazz, String fileName, String fileNameSuffix) throws IOException
File
reference in the path returned from makeTestDataPath(java.lang.Class, java.lang.String)
in a subdirectory
called temp
.IOException
public static File generateTempFileFromResource(Class resourceClass, String resourceName, String extension) throws IOException
makeTestDataPath(java.lang.Class, java.lang.String)
in a subdirectory called temp/resources
.IOException
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.