Enum Class CacheMode

java.lang.Object
java.lang.Enum<CacheMode>
com.tngtech.archunit.junit.CacheMode
All Implemented Interfaces:
Serializable, Comparable<CacheMode>, Constable

@PublicAPI(usage=ACCESS) public enum CacheMode extends 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. if ATest analyses file:///some/path and BTest analyses the same classes, the classes imported for ATest will be reused for BTest. If this is not desired, the CacheMode.PER_CLASS can be used to completely deactivate caching between different test classes.
  • Enum Constant Details

    • 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 uses SoftReferences, 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 Details

    • values

      public static CacheMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CacheMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null