KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > junit > ui > RerunAction


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 package org.eclipse.jdt.internal.junit.ui;
12
13 import org.eclipse.ui.PlatformUI;
14
15 import org.eclipse.jface.action.Action;
16
17 /**
18  * Requests to rerun a test.
19  */

20 public class RerunAction extends Action {
21     private String JavaDoc fTestId;
22     private String JavaDoc fClassName;
23     private String JavaDoc fTestName;
24     private TestRunnerViewPart fTestRunner;
25     private String JavaDoc fLaunchMode;
26     
27     /**
28      * Constructor for RerunAction.
29      */

30     public RerunAction(String JavaDoc actionName, TestRunnerViewPart runner, String JavaDoc testId, String JavaDoc className, String JavaDoc testName,
31             String JavaDoc launchMode) {
32         super(actionName);
33         PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJUnitHelpContextIds.RERUN_ACTION);
34         fTestRunner= runner;
35         fTestId= testId;
36         fClassName= className;
37         fTestName= testName;
38         fLaunchMode= launchMode;
39     }
40
41     /*
42      * @see IAction#run()
43      */

44     public void run() {
45         fTestRunner.rerunTest(fTestId, fClassName, fTestName, fLaunchMode);
46     }
47 }
48
Popular Tags