Package com.tngtech.archunit.junit
Enum CacheMode
- java.lang.Object
-
- java.lang.Enum<CacheMode>
-
- com.tngtech.archunit.junit.CacheMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CacheMode>
public enum CacheMode extends java.lang.Enum<CacheMode>
Determines how the JUnit test support caches classes.
The test support can cache imported classes according to their location between several runs of different test classes, i.e. ifATest
analysesfile:///some/path
andBTest
analyses the same classes, the classes imported forATest
will be reused forBTest
. If this is not desired, theCacheMode
.PER_CLASS
can be used to completely deactivate caching between different test classes.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CacheMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CacheMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PER_CLASS
@PublicAPI(usage=ACCESS) public static final CacheMode PER_CLASS
Signals that imported Java classes should be cached for the current test class only, and discarded afterwards.
-
FOREVER
@PublicAPI(usage=ACCESS) public static final CacheMode FOREVER
Signals that imported Java classes should be cached by location (i.e. the combination of URLs used to import these classes). The cache usesSoftReferences
, i.e. the heap will be freed, once it is needed, but this might cause a noticeable delay, once the garbage collector starts removing all those references at the last possible moment.
-
-
Method Detail
-
values
public static CacheMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CacheMode c : CacheMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CacheMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-