Enum Class RunResultsCache

java.lang.Object
java.lang.Enum<RunResultsCache>
org.concordion.internal.cache.RunResultsCache
All Implemented Interfaces:
Serializable, Comparable<RunResultsCache>, Constable

public enum RunResultsCache extends Enum<RunResultsCache>
A thread-safe class to provide caching of run results.
  • Enum Constant Details

  • Method Details

    • values

      public static RunResultsCache[] 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 RunResultsCache 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
    • getFromCache

      public RunOutput getFromCache(Class<?> fixtureClass, String example)
      Provides a direct method to access the cache
      Parameters:
      fixtureClass - class to retrieve from the cache
      example - the example to get from the cache
      Returns:
      can return null if not in the cache
    • getFromCache

      public RunOutput getFromCache(FixtureType fixtureType, String example)
      Provides a direct method to access the cache
      Parameters:
      fixtureType - class to retrieve from the cache
      example - the example to get from the cache
      Returns:
      can return null if not in the cache
    • startFixtureRun

      public void startFixtureRun(FixtureType fixtureType, String specificationDescription)
      Initialises an entry in the cache for a specification with the given description. Individual examples may then be run, and their results will be added to the fixture total when finishRun(FixtureType, String, ResultSummary, ImplementationStatusChecker) is called.
      Parameters:
      fixtureType - the fixture class that is being started
      specificationDescription - a description of the target specification
    • startRun

      public RunOutput startRun(FixtureType fixtureType, String example)
      Searches for a match in the cache. If there is no match, it marks the test as "in progress". This is done in one method to avoid thread synchronization issues.
      Parameters:
      fixtureType - the fixture class to retrieve
      example - the name of the example that is being started (null OK)
      Returns:
      the result summary from the cache
    • finishRun

      public void finishRun(FixtureType fixtureType, String example, ResultSummary actualResultSummary, ImplementationStatusChecker statusChecker)
      Updates the cache with the results of a run.
      Parameters:
      fixtureType - the fixture class to update
      example - the name of the example that is being finished (null ok)
      actualResultSummary - the results as reported from the spec
      statusChecker - modifier that updates results dependent on ImplementationStatus (ExpectedToFail etc)
    • failRun

      public void failRun(FixtureType fixtureType, String example)
      Run failed. Remove our placeholder value.
      Parameters:
      fixtureType - fixture class that failed
      example - the name of the example that failed
    • removeAllFromCache

      public void removeAllFromCache(FixtureType fixtureType)
      For test purposes only
      Parameters:
      fixtureType - fixture class to remove cache results for