01: /* Copyright 2005 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.tools.checks;
07:
08: import java.text.DateFormat;
09: import java.util.Date;
10:
11: /**
12: * An example ICheck implementation which is just a diagnostic and not an assertion.
13: * This check cannot fail, but it still exposes useful information, namely when the check
14: * was run. When included in a batch of checks, allows you to see when the batch
15: * was run.
16: *
17: * @version $Revision: 35832 $ $Date: 2005-05-19 18:51:25 -0700 (Thu, 19 May 2005) $
18: * @since uPortal 2.5
19: */
20: public class TimeCheck implements ICheck {
21:
22: public CheckResult doCheck() {
23:
24: String dateTime = DateFormat.getDateTimeInstance().format(
25: new Date());
26: return CheckResult.createSuccess("Check ran at " + dateTime);
27: }
28:
29: public String getDescription() {
30: return "This check reports the date and time at which it is run.";
31: }
32:
33: }
|