1 /* 2 Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2.0, 6 as published by the Free Software Foundation. 7 8 This program is also distributed with certain software (including 9 but not limited to OpenSSL) that is licensed under separate terms, 10 as designated in a particular file or component or in included license 11 documentation. The authors of MySQL hereby grant you an additional 12 permission to link the program and your derivative works with the 13 separately licensed software that they have included with MySQL. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License, version 2.0, for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 */ 24 25 /* 26 * This assortment of classes is a mock http://en.wikipedia.org/wiki/Mock_object 27 * implementation of junit http://en.wikipedia.org/wiki/Junit. It contains annotations, 28 * classes, and interfaces that mock junit for use with test classes 29 * that use a subset of junit functionality. 30 * <p> 31 * In clusterj, test classes can use either the real junit or this mock junit. 32 * The mock can be used stand-alone or invoked by the maven surefire junit plugin. 33 * Other test runners and harnesses might not have been tested and might not work. 34 * <p> 35 * There is no code copied from Junit itself. Only concepts and names of 36 * annotations, interfaces, classes, and methods are copied, which must exactly match 37 * the corresponding items from junit in order to be mocked. 38 */ 39 40 package junit.framework; 41 42 /** This interface is used to monitor the execution of tests and track errors and failures. 43 * It is implemented as part of the test runner framework. 44 */ 45 public interface TestListener { 46 47 /** An error (exception) occurred during the execution of the test. 48 */ addError(Test test, Throwable t)49 public void addError(Test test, Throwable t); 50 51 /** A failure (assertion) occurred during the execution of the test. 52 */ addFailure(Test test, AssertionFailedError t)53 public void addFailure(Test test, AssertionFailedError t); 54 55 /** A test ended. 56 */ endTest(Test test)57 public void endTest(Test test); 58 59 /** A test started. 60 */ startTest(Test test)61 public void startTest(Test test); 62 } 63