Package org.junit.experimental.max
Class MaxHistory
- java.lang.Object
-
- org.junit.experimental.max.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
MaxHistory.RememberingListener
private class
MaxHistory.TestComparator
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Long>
fDurations
private java.util.Map<java.lang.String,java.lang.Long>
fFailureTimestamps
private java.io.File
fHistoryStore
private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description private
MaxHistory(java.io.File storedResults)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MaxHistory
forFolder(java.io.File file)
(package private) java.lang.Long
getFailureTimestamp(Description key)
(package private) java.lang.Long
getTestDuration(Description key)
(package private) boolean
isNewTest(Description key)
RunListener
listener()
(package private) void
putTestDuration(Description description, long duration)
(package private) void
putTestFailureTimestamp(Description key, long end)
private static MaxHistory
readHistory(java.io.File storedResults)
private void
save()
java.util.Comparator<Description>
testComparator()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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
-
-
Method Detail
-
forFolder
public static MaxHistory forFolder(java.io.File file)
-
readHistory
private static MaxHistory readHistory(java.io.File storedResults) throws CouldNotReadCoreException
- Throws:
CouldNotReadCoreException
-
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)
-
isNewTest
boolean isNewTest(Description key)
-
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.
-
-