ResSetter

public class ResSetter
Author:Patrick Yip This class is to set the resource(fixture) for the test cases. Especially for the test case that need to simulate the action of file system. Such as test cases for doc processor need to simulate operation of file move. So, before the test cases run. Call the restore method to copy the needed resource to the tmp folder of fixture folder. After the test case finished, delete the temp folder by calling the clean method. The purpose of this restore and clean is to filter the .svn file create by subversion that is not needed for the test cases to run.

Fields

ORG_RES_FOLDER

public static String ORG_RES_FOLDER

RES_TMP_DIR

public static final String RES_TMP_DIR

Constructors

ResSetter

public ResSetter(Class clazz)

Methods

backupRes

public void backupRes()

Restore all of the files in the res folder to the tmp By copying all of the file from fixture for test case to the tmp folder

Throws:

clean

public void clean()

Clean up the directory that related to the test cases in the res folder

Throws:

restore

public void restore()

Restore all of the files in the res folder to the res. By moving the file from the orgResBase to the resBase. The moving operation will not move the CVS related files

Throws:

storeRes

public void storeRes()

Delete all of the file in the fixture base except tmp folder itself and copy back the original fixture from tmp to fixture, then delete the tmp folder

Throws: