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: TestConstrainedUtils.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.site;
09:
10: import com.uwyn.rife.database.ConstrainedClass;
11: import com.uwyn.rife.database.NotConstrainedClass;
12: import com.uwyn.rife.site.ConstrainedUtils;
13: import com.uwyn.rife.site.Validation;
14: import junit.framework.TestCase;
15:
16: public class TestConstrainedUtils extends TestCase {
17: public TestConstrainedUtils(String name) {
18: super (name);
19: }
20:
21: public void testGetConstrainedInstance() {
22: assertNotNull(ConstrainedUtils
23: .getConstrainedInstance(ConstrainedClass.class));
24: assertNull(ConstrainedUtils
25: .getConstrainedInstance(NotConstrainedClass.class));
26: assertNotNull(ConstrainedUtils
27: .getConstrainedInstance(ConstrainedStaticInnerClass.class));
28: assertNull(ConstrainedUtils
29: .getConstrainedInstance(NotConstrainedStaticInnerClass.class));
30: assertNull(ConstrainedUtils
31: .getConstrainedInstance(ConstrainedInnerClass.class));
32: assertNull(ConstrainedUtils
33: .getConstrainedInstance(NotConstrainedInnerClass.class));
34: }
35:
36: public static class ConstrainedStaticInnerClass extends Validation {
37: }
38:
39: public static class NotConstrainedStaticInnerClass {
40: }
41:
42: public class ConstrainedInnerClass extends Validation {
43: }
44:
45: public class NotConstrainedInnerClass {
46: }
47: }
|