KickJava   Java API By Example, From Geeks To Geeks.

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


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
15 import org.eclipse.jdt.internal.junit.ui.JUnitPlugin;
16
17 /**
18  * Class for accessing JUnit support; all functionality is provided by
19  * static methods.
20  * <p>
21  * This class is not intended to be subclassed or instantiated by clients.
22  * </p>
23  *
24  * @since 2.1
25  */

26 public class JUnitCore {
27
28     /**
29      * Adds a listener for test runs.
30      *
31      * @param listener listener to be added
32      * @deprecated As of 3.3, replaced by {@link #addTestRunListener(TestRunListener)}
33      */

34     public static void addTestRunListener(ITestRunListener listener) {
35         JUnitPlugin.getDefault().addTestRunListener(listener);
36     }
37
38     /**
39      * Removes a listener for test runs.
40      *
41      * @param listener listener to be removed
42      * @deprecated As of 3.3, replaced by {@link #removeTestRunListener(TestRunListener)}
43      */

44     public static void removeTestRunListener(ITestRunListener listener) {
45         JUnitPlugin.getDefault().removeTestRunListener(listener);
46     }
47     
48     /**
49      * Adds a listener for test runs.
50      *
51      * @param listener the listener to be added
52      * @since 3.3
53      */

54     public static void addTestRunListener(TestRunListener listener) {
55         JUnitPlugin.getDefault().getNewTestRunListeners().add(listener);
56     }
57
58     /**
59      * Removes a listener for test runs.
60      *
61      * @param listener the listener to be removed
62      * @since 3.3
63      */

64     public static void removeTestRunListener(TestRunListener listener) {
65         JUnitPlugin.getDefault().getNewTestRunListeners().remove(listener);
66     }
67 }
68
Popular Tags