changeset 264:4d82fc25b016

PR956: Thermostat GUI client should update the view when a new Java process is found Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-April/001077.html
author Omair Majid <omajid@redhat.com>
date Wed, 25 Apr 2012 11:30:38 -0400
parents 9a1a69250ee2
children 70acf0d10ec2
files client/src/main/java/com/redhat/thermostat/client/MainWindowControllerImpl.java client/src/test/java/com/redhat/thermostat/client/MainWindowControllerImplTest.java
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/main/java/com/redhat/thermostat/client/MainWindowControllerImpl.java	Tue Apr 24 14:15:34 2012 +0200
+++ b/client/src/main/java/com/redhat/thermostat/client/MainWindowControllerImpl.java	Wed Apr 25 11:30:38 2012 -0400
@@ -52,6 +52,7 @@
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.Timer;
+import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.appctx.ApplicationContext;
 import com.redhat.thermostat.common.dao.DAOFactory;
 import com.redhat.thermostat.common.dao.HostInfoDAO;
@@ -127,8 +128,9 @@
             }
         });
         backgroundUpdater.setInitialDelay(0);
-        backgroundUpdater.setDelay(10);
+        backgroundUpdater.setDelay(3);
         backgroundUpdater.setTimeUnit(TimeUnit.SECONDS);
+        backgroundUpdater.setSchedulingType(SchedulingType.FIXED_RATE);
     }
 
     @Override
--- a/client/src/test/java/com/redhat/thermostat/client/MainWindowControllerImplTest.java	Tue Apr 24 14:15:34 2012 +0200
+++ b/client/src/test/java/com/redhat/thermostat/client/MainWindowControllerImplTest.java	Wed Apr 25 11:30:38 2012 -0400
@@ -49,6 +49,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.concurrent.TimeUnit;
 
 import org.junit.After;
 import org.junit.Before;
@@ -60,6 +61,7 @@
 import com.redhat.thermostat.common.ActionEvent;
 import com.redhat.thermostat.common.ActionListener;
 import com.redhat.thermostat.common.Timer;
+import com.redhat.thermostat.common.Timer.SchedulingType;
 import com.redhat.thermostat.common.TimerFactory;
 import com.redhat.thermostat.common.appctx.ApplicationContext;
 import com.redhat.thermostat.common.appctx.ApplicationContextUtil;
@@ -155,6 +157,9 @@
 
     @Test
     public void verifyTimerGetsStartedOnConstruction() {
+        verify(mainWindowTimer).setDelay(3);
+        verify(mainWindowTimer).setTimeUnit(TimeUnit.SECONDS);
+        verify(mainWindowTimer).setSchedulingType(SchedulingType.FIXED_RATE);
         verify(mainWindowTimer).start();
     }