import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
-
/**
* TestData provides a convenient interface for managing test output files.
- *
+ *
* @author Erik Brakkee
*/
public final class TestData {
/**
* Obtain root directory of JUnit tests.
- *
+ *
* @return Directory name.
*/
private static File getTestRootDir(Object aTestcase) {
/**
* Returns a temporary directory.
- *
+ *
* @return Temporary directory.
*/
public File getTmpDir() {
/**
* Recursively copy a directory contents to the test output directory.
- *
+ *
* @param sSrc
* Source directory to copy.
*/
/**
* Copies a classpath resource to a relative path in the test output
* directory.
- *
+ *
* @param aResource
* Resource to copy.
* @param aRelativePath
try {
InputStream is = new ClassPathResource(aResource).getInputStream();
FileOutputStream fos = new FileOutputStream(new File(root,
- aRelativePath));
+ aRelativePath));
FileSystemUtils.copyStream(is, fos);
} catch (IOException e) {
e.printStackTrace();
/**
* Copies a resource to the root directory of the test output.
- *
+ *
* @param aResource
* Resource.
*/
/**
* Deletes a file or directory relative to the test output root.
- *
+ *
* @param aRelative
* Relative path. The testcase will fail if the file or directory
* cannot be removed.
/**
* Deletes a directory including its contents.
- *
+ *
* @param aRelative
* Relative path.
*/
/**
* Deletes a directory recursively.
- *
+ *
* @param aRelative
* Relative path.
*/
/**
* Gets the root of the test output directory.
- *
+ *
* @return Root of the test output.
*/
public File getRoot() {