- java.lang.Object
-
- com.pervasive.datarush.commons.test.TestHelper
-
public final class TestHelper extends Object
A provider of useful services for unit tests.
-
-
Constructor Summary
Constructors Constructor Description TestHelper(Class<?> testClass)Creates a helper for the specified test class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetBaseScratchPath()Return the base scratch path.StringgetResourcePath(String resourceName)Gets the file path to a specified resource.StringgetScratchPath(String fileName)Gets the file path to a specified scratch file.
-
-
-
Constructor Detail
-
TestHelper
public TestHelper(Class<?> testClass)
Creates a helper for the specified test class. Paths produced will be based on the fully qualified path of the class.- Parameters:
testClass- the class object of the test with which the helper is associated
-
-
Method Detail
-
getBaseScratchPath
public static String getBaseScratchPath()
Return the base scratch path.- Returns:
- base scratch path
-
getScratchPath
public String getScratchPath(String fileName)
Gets the file path to a specified scratch file. AfileNameof null will return the path to the scratch directory for this test.- Parameters:
fileName- the scratch file for which to get the path- Returns:
- the file path to the specified scratch file
-
getResourcePath
public String getResourcePath(String resourceName)
Gets the file path to a specified resource. AresourceNameof null will return the path to the directory containing the resources for this test.- Parameters:
resourceName- the resource for which to retrieve the path- Returns:
- the file path to the specified resource
-
-