org.unitils.io.annotation
Annotation Type TempDir


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface TempDir

Annotation for creating a temporary directory.

A optional name can be specified for directory. If no name is specified, a default name 'class-name'-'method-name' will be used.

The parent directory for this directory can be specified by setting the DefaultTempServiceFactory.ROOT_TEMP_DIR property. If no root temp dir is specified the default user temp dir will be used.

Watch out: if the directory already exists, it will first be deleted. If the directory was not empty, all files in the directory will be deleted.

By default, the directory will not be removed after the test. You can set the IOModule.CLEANUP_AFTER_TEST property to true if you want unitils to delete the directories automatically after each test.

Since:
3.3
Author:
Jeroen Horemans, Tim Ducheyne, Thomas De Rycke

Optional Element Summary
 String value
           
 

value

public abstract String value
Returns:
The name for the temp dir. If not specified, a default name 'class-name'-'method-name' will be used.
Default:
""


Copyright © 2011. All Rights Reserved.