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 org.springframework.core.SpringVersion;
09:
10: /**
11: * Test that the spring.jar is available on the classpath.
12: *
13: * @version $Revision: 35833 $ $Date: 2005-05-19 18:51:40 -0700 (Thu, 19 May 2005) $
14: * @since uPortal 2.5
15: */
16: public class SpringPresenceCheck implements ICheck {
17:
18: public CheckResult doCheck() {
19: try {
20: String springVersion = SpringVersion.getVersion();
21: return CheckResult.createSuccess("Spring jar version ["
22: + springVersion + "] successfully found.");
23: } catch (Throwable t) {
24: return CheckResult
25: .createFailure(
26: "Spring jar doesn't appear to be present on runtime classpath as evidenced by inability to get Spring version.",
27: "Include spring.jar in the /lib/ directory of the uPortal webapplication.");
28: }
29: }
30:
31: public String getDescription() {
32: return "Checks that spring.jar is present on runtime classpath by attempting to"
33: + " invoke Spring's static getVersion() facility.";
34: }
35:
36: }
|