1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| package org.jboss.cache.pojo; |
24 |
| |
25 |
| import junit.framework.TestCase; |
26 |
| import junit.framework.Test; |
27 |
| import junit.framework.TestSuite; |
28 |
| import org.apache.commons.logging.Log; |
29 |
| import org.apache.commons.logging.LogFactory; |
30 |
| import org.jboss.cache.pojo.test.Person; |
31 |
| import org.jboss.cache.pojo.test.Address; |
32 |
| import org.jboss.cache.pojo.test.Student; |
33 |
| import org.jboss.aop.proxy.ClassProxy; |
34 |
| |
35 |
| import java.util.List; |
36 |
| import java.util.Map; |
37 |
| import java.util.HashMap; |
38 |
| import java.util.ArrayList; |
39 |
| import java.util.Set; |
40 |
| import java.util.HashSet; |
41 |
| |
42 |
| |
43 |
| |
44 |
| |
45 |
| |
46 |
| |
47 |
| |
48 |
| public class CachedTypeTest extends TestCase |
49 |
| { |
50 |
| Log log = LogFactory.getLog(CachedTypeTest.class); |
51 |
| |
52 |
16
| public CachedTypeTest(String name)
|
53 |
| { |
54 |
16
| super(name);
|
55 |
| } |
56 |
| |
57 |
16
| protected void setUp() throws Exception
|
58 |
| { |
59 |
16
| super.setUp();
|
60 |
16
| log.info("setUp() ....");
|
61 |
| } |
62 |
| |
63 |
16
| protected void tearDown() throws Exception
|
64 |
| { |
65 |
16
| super.tearDown();
|
66 |
| } |
67 |
| |
68 |
2
| public void testInteger() throws Exception
|
69 |
| { |
70 |
2
| CachedType t = new CachedType(int.class);
|
71 |
2
| assertTrue("Int ", t.isImmediate());
|
72 |
| |
73 |
2
| t = new CachedType(Integer.class);
|
74 |
2
| assertTrue("Int ", t.isImmediate());
|
75 |
| } |
76 |
| |
77 |
2
| public void testShort() throws Exception
|
78 |
| { |
79 |
2
| CachedType t = new CachedType(short.class);
|
80 |
2
| assertTrue("Short ", t.isImmediate());
|
81 |
| |
82 |
2
| t = new CachedType(Short.class);
|
83 |
2
| assertTrue("Short ", t.isImmediate());
|
84 |
| } |
85 |
| |
86 |
2
| public void testString() throws Exception
|
87 |
| { |
88 |
2
| CachedType t = new CachedType(String.class);
|
89 |
2
| assertTrue("String ", t.isImmediate());
|
90 |
| } |
91 |
| |
92 |
2
| public void testDouble() throws Exception
|
93 |
| { |
94 |
2
| CachedType t = new CachedType(double.class);
|
95 |
2
| assertTrue("Double ", t.isImmediate());
|
96 |
| |
97 |
2
| t = new CachedType(Double.class);
|
98 |
2
| assertTrue("Double ", t.isImmediate());
|
99 |
| } |
100 |
| |
101 |
2
| public void testChar() throws Exception
|
102 |
| { |
103 |
2
| CachedType t = new CachedType(Character.class);
|
104 |
2
| assertTrue("Character ", t.isImmediate());
|
105 |
| |
106 |
2
| t = new CachedType(Character.class);
|
107 |
2
| assertTrue("Character ", t.isImmediate());
|
108 |
| } |
109 |
| |
110 |
2
| public void testBoolean() throws Exception
|
111 |
| { |
112 |
2
| CachedType t = new CachedType(boolean.class);
|
113 |
2
| assertTrue("Boolean ", t.isImmediate());
|
114 |
| |
115 |
2
| t = new CachedType(Boolean.class);
|
116 |
2
| assertTrue("Boolean ", t.isImmediate());
|
117 |
| } |
118 |
| |
119 |
2
| public void testLong() throws Exception
|
120 |
| { |
121 |
2
| CachedType t = new CachedType(long.class);
|
122 |
2
| assertTrue("Long ", t.isImmediate());
|
123 |
| |
124 |
2
| t = new CachedType(Long.class);
|
125 |
2
| assertTrue("Long ", t.isImmediate());
|
126 |
| } |
127 |
| |
128 |
2
| public void testByte() throws Exception
|
129 |
| { |
130 |
2
| CachedType t = new CachedType(byte.class);
|
131 |
2
| assertTrue("Byte ", t.isImmediate());
|
132 |
| |
133 |
2
| t = new CachedType(Short.class);
|
134 |
2
| assertTrue("Byte ", t.isImmediate());
|
135 |
| } |
136 |
| |
137 |
2
| public static Test suite() throws Exception
|
138 |
| { |
139 |
2
| return new TestSuite(CachedTypeTest.class);
|
140 |
| } |
141 |
| |
142 |
| |
143 |
0
| public static void main(String[] args) throws Exception
|
144 |
| { |
145 |
0
| junit.textui.TestRunner.run(suite());
|
146 |
| } |
147 |
| |
148 |
| } |