date.setTime(date.getTime() + 500); DateFormat df = new SimpleDateFormat(Whacker.TEST_DATE_FORMAT);
date.setTime(date.getTime()); DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
    public void testWhacker() throws Exception {        // Set the WhackerTask to run very soon so we don't get bored waiting for it        Date date = new Date();        date.setTime(date.getTime() + 500);    // add 1/2 second        DateFormat df = new SimpleDateFormat(Whacker.TEST_DATE_FORMAT);        m_whacker.setTimeOfDay(df.format(date));                // Run the Whacker, simulating app startup        m_whacker.setEnabled(true);            // in case it is disabled via properties file        m_whacker.onApplicationEvent(new ApplicationInitializedEvent(this));                // Wait for a second to make sure the task has run, then verify        Thread.sleep(1000);        try {            m_processControl.verify();        } catch (AssertionFailedError e) {            fail("processContext.manageServices was not called by the TimerTask.  Be aware that this test is timing-dependent, you may need to tweak the TimerTask time or the sleep time for the main thread.");        }    }