Enum CacheMode

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

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. 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.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    FOREVER
    Signals that imported Java classes should be cached by location (i.e.
    PER_CLASS
    Signals that imported Java classes should be cached for the current test class only, and discarded afterwards.
  • Method Summary

    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.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 type, in the order they are declared.
      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 name
      java.lang.NullPointerException - if the argument is null