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.Test; |
26 |
| import junit.framework.TestCase; |
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.impl.CachedType; |
31 |
| |
32 |
| |
33 |
| |
34 |
| |
35 |
| |
36 |
| |
37 |
| |
38 |
| public class CachedTypeTest extends TestCase |
39 |
| { |
40 |
| Log log = LogFactory.getLog(CachedTypeTest.class); |
41 |
| |
42 |
8
| public CachedTypeTest(String name)
|
43 |
| { |
44 |
8
| super(name);
|
45 |
| } |
46 |
| |
47 |
8
| protected void setUp() throws Exception
|
48 |
| { |
49 |
8
| super.setUp();
|
50 |
8
| log.info("setUp() ....");
|
51 |
| } |
52 |
| |
53 |
8
| protected void tearDown() throws Exception
|
54 |
| { |
55 |
8
| super.tearDown();
|
56 |
| } |
57 |
| |
58 |
1
| public void testInteger() throws Exception
|
59 |
| { |
60 |
1
| CachedType t = new CachedType(int.class);
|
61 |
1
| assertTrue("Int ", t.isImmediate());
|
62 |
| |
63 |
1
| t = new CachedType(Integer.class);
|
64 |
1
| assertTrue("Int ", t.isImmediate());
|
65 |
| } |
66 |
| |
67 |
1
| public void testShort() throws Exception
|
68 |
| { |
69 |
1
| CachedType t = new CachedType(short.class);
|
70 |
1
| assertTrue("Short ", t.isImmediate());
|
71 |
| |
72 |
1
| t = new CachedType(Short.class);
|
73 |
1
| assertTrue("Short ", t.isImmediate());
|
74 |
| } |
75 |
| |
76 |
1
| public void testString() throws Exception
|
77 |
| { |
78 |
1
| CachedType t = new CachedType(String.class);
|
79 |
1
| assertTrue("String ", t.isImmediate());
|
80 |
| } |
81 |
| |
82 |
1
| public void testDouble() throws Exception
|
83 |
| { |
84 |
1
| CachedType t = new CachedType(double.class);
|
85 |
1
| assertTrue("Double ", t.isImmediate());
|
86 |
| |
87 |
1
| t = new CachedType(Double.class);
|
88 |
1
| assertTrue("Double ", t.isImmediate());
|
89 |
| } |
90 |
| |
91 |
1
| public void testChar() throws Exception
|
92 |
| { |
93 |
1
| CachedType t = new CachedType(Character.class);
|
94 |
1
| assertTrue("Character ", t.isImmediate());
|
95 |
| |
96 |
1
| t = new CachedType(Character.class);
|
97 |
1
| assertTrue("Character ", t.isImmediate());
|
98 |
| } |
99 |
| |
100 |
1
| public void testBoolean() throws Exception
|
101 |
| { |
102 |
1
| CachedType t = new CachedType(boolean.class);
|
103 |
1
| assertTrue("Boolean ", t.isImmediate());
|
104 |
| |
105 |
1
| t = new CachedType(Boolean.class);
|
106 |
1
| assertTrue("Boolean ", t.isImmediate());
|
107 |
| } |
108 |
| |
109 |
1
| public void testLong() throws Exception
|
110 |
| { |
111 |
1
| CachedType t = new CachedType(long.class);
|
112 |
1
| assertTrue("Long ", t.isImmediate());
|
113 |
| |
114 |
1
| t = new CachedType(Long.class);
|
115 |
1
| assertTrue("Long ", t.isImmediate());
|
116 |
| } |
117 |
| |
118 |
1
| public void testByte() throws Exception
|
119 |
| { |
120 |
1
| CachedType t = new CachedType(byte.class);
|
121 |
1
| assertTrue("Byte ", t.isImmediate());
|
122 |
| |
123 |
1
| t = new CachedType(Short.class);
|
124 |
1
| assertTrue("Byte ", t.isImmediate());
|
125 |
| } |
126 |
| |
127 |
1
| public static Test suite() throws Exception
|
128 |
| { |
129 |
1
| return new TestSuite(CachedTypeTest.class);
|
130 |
| } |
131 |
| |
132 |
| |
133 |
0
| public static void main(String[] args) throws Exception
|
134 |
| { |
135 |
0
| junit.textui.TestRunner.run(suite());
|
136 |
| } |
137 |
| |
138 |
| } |