First commit in a looooooong time. I had connectivity problems.
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / ProgressInfoComposite.java
index 7d779e4..3781fde 100644 (file)
@@ -6,6 +6,8 @@
  */
 package net.sourceforge.phpeclipse.phpunit;
 
+import net.sourceforge.phpeclipse.phpunit.testpool.TestPool;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.layout.GridData;
@@ -74,13 +76,21 @@ public class ProgressInfoComposite extends Composite {
                labelErrorsVal.setText("0");            
        }
 
+       public void resetInfo() {
+       
+               labelErrorsVal.setText("0");
+               labelFailuresVal.setText("0");
+               labelRunsVal.setText("0 / 0");
+               progressBar.setSelection(0);    
+       
+       }
+
        public void updateInfo(int numTests, int numTestsRun, int numFailures, int numErrors) {
                
                //update progress bar
                progressBar.setMaximum(numTests);
                progressBar.setSelection(numTestsRun);
-               
-               System.out.println("numTestsRun: " + numTestsRun);
+       
        
                //update labels
                labelRunsVal.setText(numTestsRun + " / " + numTests);
@@ -93,4 +103,26 @@ public class ProgressInfoComposite extends Composite {
                
        }
 
+
+       public void updateInfo(TestPool testPool) {
+               
+               int numTestsOverall = testPool.getNumTestsOverall();
+               int numTestsRun = testPool.getNumTestsRun();
+               
+               //update progress bar
+               progressBar.setMaximum(numTestsOverall);
+               progressBar.setSelection(numTestsRun);
+       
+       
+               //update labels
+               labelRunsVal.setText(numTestsRun + " / " + numTestsOverall);
+               labelFailuresVal.setText("" + testPool.getNumFailures());
+               labelErrorsVal.setText("" + testPool.getNumErrors());
+               
+               //TODO: change Failures label to red if some exist.
+               
+               
+               
+       }
+
 }