01: // Copyright © 2004-2005 ASERT. Released under the Canoo Webtest license.
02: package com.canoo.webtest.boundary;
03:
04: /**
05: * Boundary class for interacting with Packages.
06: *
07: * @author Paul King
08: * @author Denis N. Antonioli
09: */
10: public final class PackageBoundary {
11:
12: private static final Package PACKAGE = PackageBoundary.class
13: .getPackage();
14:
15: private PackageBoundary() {
16: }
17:
18: public static boolean hasVersionInformation() {
19: return PACKAGE != null;
20: }
21:
22: public static String getImplementationTitle() {
23: if (!hasVersionInformation()
24: || PACKAGE.getImplementationTitle() == null) {
25: return "Canoo Webtest";
26: }
27: return PACKAGE.getImplementationTitle();
28: }
29:
30: public static String getImplementationVersion() {
31: if (!hasVersionInformation()
32: || PACKAGE.getImplementationVersion() == null) {
33: return "development";
34: }
35: return PACKAGE.getImplementationVersion();
36: }
37:
38: public static String versionMessage() {
39: if (!hasVersionInformation()) {
40: return "Unknown Webtest version.";
41: }
42: final StringBuffer sb = new StringBuffer();
43: sb.append(getImplementationTitle());
44: sb.append(": ").append(getImplementationVersion());
45: sb.append(".");
46: return sb.toString();
47:
48: }
49: }
|