Interface TestResultCache
-
- All Known Implementing Classes:
HashMapTestResultCache
public interface TestResultCache
A cache for test results to reduce unnecessary execution time if the same test input results are requested multiple times.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addResultFor(IntArrayWrapper testInput, TestResult result)
Adds a result to the cache so it may later be retrieved viagetResultFor(IntArrayWrapper)
.boolean
containsResultFor(IntArrayWrapper testInput)
TestResult
getResultFor(IntArrayWrapper testInput)
-
-
-
Method Detail
-
containsResultFor
boolean containsResultFor(IntArrayWrapper testInput)
- Parameters:
testInput
- for which a result could be needed. Must not benull
- Returns:
- Whether the cache contains the result of the given test input
- Throws:
NullPointerException
- if testInput isnull
-
getResultFor
TestResult getResultFor(IntArrayWrapper testInput)
- Parameters:
testInput
- for which the result is needed. Must not benull
- Returns:
- the result of the given test input. If
containsResultFor(IntArrayWrapper)
returnsfalse
for this test input, the behavior is not defined and depends on the actual implementation - Throws:
NullPointerException
- if testInput isnull
-
addResultFor
void addResultFor(IntArrayWrapper testInput, TestResult result)
Adds a result to the cache so it may later be retrieved viagetResultFor(IntArrayWrapper)
. After a testInput has been added here,containsResultFor(IntArrayWrapper)
should returnedtrue
if called for the same testInput.- Parameters:
testInput
- for which the result should be savedresult
- of the test input
-
-