KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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.internal.junit.model;
13
14 import org.eclipse.jdt.internal.junit.model.TestElement.Status;
15
16 /**
17  * A listener interface for observing the execution of a test session (initial run and reruns).
18  */

19 public interface ITestSessionListener {
20     /**
21      * A test run has started.
22      */

23     public void sessionStarted();
24     /**
25      * A test run has ended.
26      *
27      * @param elapsedTime the total elapsed time of the test run
28      */

29     public void sessionEnded(long elapsedTime);
30     /**
31      * A test run has been stopped prematurely.
32      *
33      * @param elapsedTime the time elapsed before the test run was stopped
34      */

35     public void sessionStopped(long elapsedTime);
36     /**
37      * The VM instance performing the tests has terminated.
38      */

39     public void sessionTerminated();
40     
41     /**
42      * A test has been added to the plan.
43      *
44      * @param testElement the test
45      */

46     public void testAdded(TestElement testElement);
47     
48     /**
49      * All test have been added and running begins
50      */

51     public void runningBegins();
52     
53     /**
54      * An individual test has started.
55      *
56      * @param testCaseElement the test
57      */

58     public void testStarted(TestCaseElement testCaseElement);
59     /**
60      * An individual test has ended.
61      *
62      * @param testCaseElement the test
63      */

64     public void testEnded(TestCaseElement testCaseElement);
65     /**
66      * An individual test has failed with a stack trace.
67      *
68      * @param testElement the test
69      * @param status the outcome of the test; one of
70      * {@link TestElement.Status#ERROR} or
71      * {@link TestElement.Status#FAILURE}
72      * @param trace the stack trace
73      * @param expected expected value
74      * @param actual actual value
75      */

76     public void testFailed(TestElement testElement, Status status, String JavaDoc trace, String JavaDoc expected, String JavaDoc actual);
77     /**
78      * An individual test has been rerun.
79      *
80      * @param testCaseElement the test
81      * @param status the outcome of the test that was rerun; one of
82      * {@link TestElement.Status#OK}, {@link TestElement.Status#ERROR}, or {@link TestElement.Status#FAILURE}
83      * @param trace the stack trace in the case of abnormal termination,
84      * or the empty string if none
85      * @param expectedResult expected value
86      * @param actualResult actual value
87      */

88     public void testReran(TestCaseElement testCaseElement, Status status, String JavaDoc trace, String JavaDoc expectedResult, String JavaDoc actualResult);
89     
90     /**
91      * @return <code>true</code> if the test run session can be swapped to disk although
92      * this listener is still installed
93      */

94     public boolean acceptsSwapToDisk();
95
96 }
97
Popular Tags