KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > junit > model > ITestRunListener2


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 package org.eclipse.jdt.internal.junit.model;
12
13 import org.eclipse.jdt.internal.junit.runner.MessageIds;
14
15
16 public interface ITestRunListener2 {
17
18     /**
19      * Status constant indicating that a test passed (constant value 0).
20      */

21     public static final int STATUS_OK= 0;
22     /**
23      * Status constant indicating that a test had an error an unanticipated
24      * exception (constant value 1).
25      */

26     public static final int STATUS_ERROR= 1;
27     /**
28      * Status constant indicating that a test failed an assertion
29      * (constant value 2).
30      */

31     public static final int STATUS_FAILURE= 2;
32     /**
33      * A test run has started.
34      *
35      * @param testCount the number of individual tests that will be run
36      */

37     public void testRunStarted(int testCount);
38     /**
39      * A test run has ended.
40      *
41      * @param elapsedTime the total elapsed time of the test run
42      */

43     public void testRunEnded(long elapsedTime);
44     /**
45      * A test run has been stopped prematurely.
46      *
47      * @param elapsedTime the time elapsed before the test run was stopped
48      */

49     public void testRunStopped(long elapsedTime);
50     /**
51      * An individual test has started.
52      *
53      * @param testId a unique Id identifying the test
54      * @param testName the name of the test that started
55      */

56     public void testStarted(String JavaDoc testId, String JavaDoc testName);
57     /**
58      * An individual test has ended.
59      *
60      * @param testId a unique Id identifying the test
61      * @param testName the name of the test that ended
62      */

63     public void testEnded(String JavaDoc testId, String JavaDoc testName);
64
65             
66     /**
67      * The VM instance performing the tests has terminated.
68      */

69     public void testRunTerminated();
70         
71     /**
72      * Information about a member of the test suite that is about to be run. The
73      * format of the string is:
74      *
75      * <pre>
76      * testId,testName,isSuite,testcount
77      *
78      * testId: a unique id for the test
79      * testName: the name of the test
80      * isSuite: true or false depending on whether the test is a suite
81      * testCount: an integer indicating the number of tests
82      *
83      * Example: &quot;324968,testPass(junit.tests.MyTest),false,1&quot;
84      * </pre>
85      *
86      * @param description a string describing a tree entry
87      *
88      * @see MessageIds#TEST_TREE
89      */

90     public void testTreeEntry(String JavaDoc description);
91
92     /**
93      * An individual test has failed with a stack trace.
94      *
95      * @param status the outcome of the test; one of
96      * {@link #STATUS_ERROR STATUS_ERROR} or
97      * {@link #STATUS_FAILURE STATUS_FAILURE}
98      * @param testId a unique Id identifying the test
99      * @param testName the name of the test that failed
100      * @param trace the stack trace
101      * @param expected the expected value
102      * @param actual the actual value
103      */

104     public void testFailed(int status, String JavaDoc testId, String JavaDoc testName, String JavaDoc trace, String JavaDoc expected, String JavaDoc actual);
105
106     /**
107      * An individual test has been rerun.
108      *
109      * @param testId a unique Id identifying the test
110      * @param testClass the name of the test class that was rerun
111      * @param testName the name of the test that was rerun
112      * @param status the outcome of the test that was rerun; one of
113      * {@link #STATUS_OK}, {@link #STATUS_ERROR}, or
114      * {@link #STATUS_FAILURE}
115      * @param trace the stack trace in the case of abnormal termination, or the
116      * empty string if none
117      * @param expected the expected value in case of abnormal termination, or
118      * the empty string if none
119      * @param actual the actual value in case of abnormal termination, or the
120      * empty string if none
121      */

122     public void testReran(String JavaDoc testId, String JavaDoc testClass, String JavaDoc testName, int status, String JavaDoc trace, String JavaDoc expected, String JavaDoc actual);
123     
124     
125     
126 }
127
Popular Tags