Class MaxHistory

  • All Implemented Interfaces:
    java.io.Serializable

    public class MaxHistory
    extends java.lang.Object
    implements java.io.Serializable
    Stores a subset of the history of each test:
    • Last failure timestamp
    • Duration of last execution
    See Also:
    Serialized Form
    • Field Detail

      • fDurations

        private final java.util.Map<java.lang.String,​java.lang.Long> fDurations
      • fFailureTimestamps

        private final java.util.Map<java.lang.String,​java.lang.Long> fFailureTimestamps
      • fHistoryStore

        private final java.io.File fHistoryStore
    • Constructor Detail

      • MaxHistory

        private MaxHistory​(java.io.File storedResults)
    • Method Detail

      • forFolder

        public static MaxHistory forFolder​(java.io.File file)
        Loads a MaxHistory from file, or generates a new one that will be saved to file.
      • save

        private void save()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getFailureTimestamp

        java.lang.Long getFailureTimestamp​(Description key)
      • putTestFailureTimestamp

        void putTestFailureTimestamp​(Description key,
                                     long end)
      • getTestDuration

        java.lang.Long getTestDuration​(Description key)
      • putTestDuration

        void putTestDuration​(Description description,
                             long duration)
      • listener

        public RunListener listener()
        Returns:
        a listener that will update this history based on the test results reported.
      • testComparator

        public java.util.Comparator<Description> testComparator()
        Returns:
        a comparator that ranks tests based on the JUnit Max sorting rules, as described in the MaxCore class comment.