KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > junit > ITestRunListener


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.junit;
13
14 import org.eclipse.jdt.internal.junit.model.ITestRunListener2;
15
16   
17 /**
18  * A listener interface for observing the execution of a test run.
19  * <p>
20  * Clients contributing to the
21  * <code>org.eclipse.jdt.junit.testRunListener</code>
22  * extension point implement this interface.
23  * </p>
24  * @deprecated As of 3.3, replaced by {@link TestRunListener}
25  *
26  * @since 2.1
27  */

28  public interface ITestRunListener {
29     /**
30      * Status constant indicating that a test passed (constant value 0).
31      *
32      * @see #testFailed(int, String, String, String)
33      */

34     public static final int STATUS_OK= ITestRunListener2.STATUS_OK;
35     /**
36      * Status constant indicating that a test had an error an unanticipated
37      * exception (constant value 1).
38      *
39      * @see #testFailed(int, String, String, String)
40      */

41     public static final int STATUS_ERROR= ITestRunListener2.STATUS_ERROR;
42     /**
43      * Status constant indicating that a test failed an assertion
44      * (constant value 2).
45      *
46      * @see #testFailed(int, String, String, String)
47      */

48     public static final int STATUS_FAILURE= ITestRunListener2.STATUS_FAILURE;
49     /**
50      * A test run has started.
51      *
52      * @param testCount the number of individual tests that will be run
53      */

54     public void testRunStarted(int testCount);
55     /**
56      * A test run has ended.
57      *
58      * @param elapsedTime the total elapsed time of the test run
59      */

60     public void testRunEnded(long elapsedTime);
61     /**
62      * A test run has been stopped prematurely.
63      *
64      * @param elapsedTime the time elapsed before the test run was stopped
65      */

66     public void testRunStopped(long elapsedTime);
67     /**
68      * An individual test has started.
69      *
70      * @param testId a unique Id identifying the test
71      * @param testName the name of the test that started
72      */

73     public void testStarted(String JavaDoc testId, String JavaDoc testName);
74     /**
75      * An individual test has ended.
76      *
77      * @param testId a unique Id identifying the test
78      * @param testName the name of the test that ended
79      */

80     public void testEnded(String JavaDoc testId, String JavaDoc testName);
81     /**
82      * An individual test has failed with a stack trace.
83      *
84      * @param status the outcome of the test; one of
85      * {@link #STATUS_ERROR STATUS_ERROR} or
86      * {@link #STATUS_FAILURE STATUS_FAILURE}
87      * @param testId a unique Id identifying the test
88      * @param testName the name of the test that failed
89      * @param trace the stack trace
90      */

91     public void testFailed(int status, String JavaDoc testId, String JavaDoc testName, String JavaDoc trace);
92             
93     /**
94      * The VM instance performing the tests has terminated.
95      */

96     public void testRunTerminated();
97     
98     /**
99      * An individual test has been rerun.
100      *
101      * @param testId a unique Id identifying the test
102      * @param testClass the name of the test class that was rerun
103      * @param testName the name of the test that was rerun
104      * @param status the outcome of the test that was rerun; one of
105      * {@link #STATUS_OK STATUS_OK}, {@link #STATUS_ERROR STATUS_ERROR},
106      * or {@link #STATUS_FAILURE STATUS_FAILURE}
107      * @param trace the stack trace in the case of abnormal termination,
108      * or the empty string if none
109      */

110     public void testReran(String JavaDoc testId, String JavaDoc testClass, String JavaDoc testName, int status, String JavaDoc trace);
111 }
112
113
114
Popular Tags