1 package net.sourceforge.phpeclipse.phpunit;
4 import org.eclipse.swt.SWT;
5 import org.eclipse.swt.widgets.Composite;
6 import org.eclipse.swt.widgets.Label;
7 import org.eclipse.swt.widgets.Text;
8 import org.eclipse.ui.part.ViewPart;
11 * @author Ali Echihabi
13 * To change the template for this generated type comment go to
14 * Window>Preferences>Java>Code Generation>Code and Comments
17 * Created on May 22, 2004
19 * To change the template for this generated file go to
20 * Window>Preferences>Java>Code Generation>Code and Comments
24 * @author Ali Echihabi (ali_echihabi@ieee.org)
26 * Plugin for PHP unit Testing.
29 * This the main view showing the progress and reports.
34 public class PHPUnitView extends ViewPart {
39 * The first level nodes are the test suites.
40 * children are nested test suites.
41 * leafs: test functions.
45 private int numTests; // total number of tests
46 private int numTestsRun; // number of tests run so far
47 private int numFailures; // number of failures so far
48 private int numErrors; // number of errors so far
49 private int numPasses; // number of passes so far (they should add up)
51 Label labelRuns, labelRunsVal; // Runs: 12
52 Label labelErrors, labelErrorsVal;
53 Label labelFailures, labelFailuresVal;
55 Text reportArea; // TODO: replace with Tree display like JUnit
57 public PHPUnitView() {
61 public void createPartControl(Composite parent) {
63 //viewer = new TreeViewer(parent);
64 labelRuns = new Label(parent, SWT.WRAP);
65 labelRuns.setText("Runs: ");
66 labelRunsVal = new Label(parent, SWT.WRAP);
67 labelRunsVal.setText("0 / 0");
69 labelFailures = new Label(parent, SWT.WRAP);
70 labelFailures.setText("Failures: ");
71 labelFailuresVal = new Label(parent, SWT.WRAP);
72 labelFailuresVal.setText("0");
74 labelErrors = new Label(parent, SWT.WRAP);
75 labelErrors.setText("Errors: ");
76 labelErrorsVal = new Label(parent, SWT.WRAP);
77 labelErrorsVal.setText("0");
79 reportArea = new Text(parent, SWT.MULTI | SWT.BORDER |
80 SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY);
86 * @see org.eclipse.ui.IWorkbenchPart#setFocus()
88 public void setFocus() {
89 markTestPass("hello");
93 * mark the given test as passed in the GUI.
97 private void markTestPass(String testID) {
99 // testid, use it in hashmap to retrieve tree item of test and
100 // change icon color, increment pass counter, etc...
104 reportArea.append("test passed");