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 junit.framework.TestCase;
09:
10: /**
11: * JUnit testcase for ClassPresenceCheck.
12: * @version $Revision: 35839 $ $Date: 2005-05-20 12:25:16 -0700 (Fri, 20 May 2005) $
13: */
14: public class ClassPresenceCheckTest extends TestCase {
15:
16: /**
17: * Test that checking for a present class succeeds.
18: */
19: public void testSuccess() {
20: ClassPresenceCheck check = new ClassPresenceCheck(
21: "java.lang.Class");
22: CheckResult result = check.doCheck();
23: assertTrue(result.isSuccess());
24: }
25:
26: /**
27: * Test that checking for an absent class fails.
28: */
29: public void testFailure() {
30: // check for the presence of a class we know will not exist.
31: ClassPresenceCheck check = new ClassPresenceCheck(
32: "org.jasig.NoExist");
33: CheckResult result = check.doCheck();
34: assertFalse(result.isSuccess());
35: }
36: }
|