@Test public void requestRetryIsNotAllowedIfFailedMoreThanGloballyPermitted() { fakeTestCasesAccumulator.thatAlwaysReturnsTestCaseCount(2); overallProgressReporter = new OverallProgressReporter(1, 1, aFakeProgressReporterTrackers().thatAlwaysReturns(mockPoolProgressTracker), fakeTestCasesAccumulator); mockery.checking(new Expectations() {{ never(mockPoolProgressTracker).trackTestEnqueuedAgain(); }}); overallProgressReporter.requestRetry(A_POOL, A_TEST_CASE); }
public boolean requestRetry(Pool pool, TestCaseEvent testCase) { boolean result = retryWatchdog.requestRetry(failedTestCasesAccumulator.getCount(testCase)); if (result && poolProgressTrackers.containsKey(pool)) { poolProgressTrackers.get(pool).trackTestEnqueuedAgain(); } return result; }
OverallProgressReporter implements ProgressReporter { public boolean requestRetry(Pool pool, TestCaseEvent testCase) { boolean result = retryWatchdog.requestRetry(failedTestCasesAccumulator.getCount(testCase)); if (result && poolProgressTrackers.containsKey(pool)) { poolProgressTrackers.get(pool).trackTestEnqueuedAgain(); } return result; } }
OverallProgressReporter implements ProgressReporter { public boolean requestRetry(Pool pool, TestCaseEvent testCase) { boolean result = retryWatchdog.requestRetry(failedTestCasesAccumulator.getCount(testCase)); if (result && poolProgressTrackers.containsKey(pool)) { poolProgressTrackers.get(pool).trackTestEnqueuedAgain(); } return result; } OverallProgressReporter(int totalAllowedRetryQuota,
                                   int retryPerTestCaseQuota,
                                   Map<Pool, PoolProgressTracker> poolProgressTrackers,
                                   PoolTestCaseAccumulator failedTestCasesAccumulator); }
OverallProgressReporter implements ProgressReporter { public boolean requestRetry(Pool pool, TestCaseEvent testCase) { boolean result = retryWatchdog.requestRetry(failedTestCasesAccumulator.getCount(testCase)); if (result && poolProgressTrackers.containsKey(pool)) { poolProgressTrackers.get(pool).trackTestEnqueuedAgain(); } return result; } OverallProgressReporter(int totalAllowedRetryQuota,
                                   int retryPerTestCaseQuota,
                                   Map<Pool, PoolProgressTracker> poolProgressTrackers,
                                   PoolTestCaseAccumulator failedTestCasesAccumulator); @Override void start(); @Override void stop(); @Override void addPoolProgress(Pool pool, PoolProgressTracker poolProgressTracker); @Override PoolProgressTracker getProgressTrackerFor(Pool pool); @Override long millisSinceTestsStarted(); @Override int getTestFailures(); @Override int getTestRunFailures(); @Override float getProgress(); boolean requestRetry(Pool pool, TestCaseEvent testCase); @Override void recordFailedTestCase(Pool pool, TestCaseEvent testCase); @Override int getTestFailuresCount(Pool pool, TestCaseEvent testCase); }
OverallProgressReporter implements ProgressReporter { public boolean requestRetry(Pool pool, TestCaseEvent testCase) { boolean result = retryWatchdog.requestRetry(failedTestCasesAccumulator.getCount(testCase)); if (result && poolProgressTrackers.containsKey(pool)) { poolProgressTrackers.get(pool).trackTestEnqueuedAgain(); } return result; } OverallProgressReporter(int totalAllowedRetryQuota,
                                   int retryPerTestCaseQuota,
                                   Map<Pool, PoolProgressTracker> poolProgressTrackers,
                                   PoolTestCaseAccumulator failedTestCasesAccumulator); @Override void start(); @Override void stop(); @Override void addPoolProgress(Pool pool, PoolProgressTracker poolProgressTracker); @Override PoolProgressTracker getProgressTrackerFor(Pool pool); @Override long millisSinceTestsStarted(); @Override int getTestFailures(); @Override int getTestRunFailures(); @Override float getProgress(); boolean requestRetry(Pool pool, TestCaseEvent testCase); @Override void recordFailedTestCase(Pool pool, TestCaseEvent testCase); @Override int getTestFailuresCount(Pool pool, TestCaseEvent testCase);  }