1 /* 2 * Copyright (c) 2007 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.internal.runners.util; 6 7 import org.junit.runner.notification.Failure; 8 import org.junit.runner.notification.RunListener; 9 10 /** 11 * Implementation of JUnit run listener that knows when any of the tests failed 12 */ 13 public class FailureDetector extends RunListener { 14 15 private boolean failed; 16 17 @Override 18 public void testFailure(Failure failure) throws Exception { 19 super.testFailure(failure); 20 failed = true; 21 } 22 23 public boolean isSuccessful() { 24 return !failed; 25 } 26 } 27