01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: TestResourceFinderClasspath.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.tools;
09:
10: import com.uwyn.rife.resources.ResourceFinderClasspath;
11: import com.uwyn.rife.resources.exceptions.ResourceFinderErrorException;
12: import junit.framework.TestCase;
13:
14: public class TestResourceFinderClasspath extends TestCase {
15: public TestResourceFinderClasspath(String name) {
16: super (name);
17: }
18:
19: public void testInstantiation() {
20: ResourceFinderClasspath rf = ResourceFinderClasspath
21: .getInstance();
22: assertNotNull(rf);
23: }
24:
25: public void testSingleton() {
26: ResourceFinderClasspath rf1 = ResourceFinderClasspath
27: .getInstance();
28: assertNotNull(rf1);
29: ResourceFinderClasspath rf2 = ResourceFinderClasspath
30: .getInstance();
31: assertNotNull(rf2);
32: assertSame(rf1, rf2);
33: }
34:
35: public void testModificationTime() {
36: ResourceFinderClasspath rf = ResourceFinderClasspath
37: .getInstance();
38: try {
39: assertTrue(rf.getModificationTime("java/lang/Class.class") > 0);
40: } catch (ResourceFinderErrorException e) {
41: assertTrue(ExceptionUtils.getExceptionStackTrace(e), false);
42: }
43: }
44: }
|