KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > pojo > CachedTypeTest


1 /*
2  * JBoss, Home of Professional Open Source.
3  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
4  * as indicated by the @author tags. See the copyright.txt file in the
5  * distribution for a full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
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 JavaDoc;
36 import java.util.Map JavaDoc;
37 import java.util.HashMap JavaDoc;
38 import java.util.ArrayList JavaDoc;
39 import java.util.Set JavaDoc;
40 import java.util.HashSet JavaDoc;
41
42 /**
43  * Basic CachedType test case.
44  *
45  * @author Ben Wang
46  */

47
48 public class CachedTypeTest extends TestCase
49 {
50    Log log = LogFactory.getLog(CachedTypeTest.class);
51
52    public CachedTypeTest(String JavaDoc name)
53    {
54       super(name);
55    }
56
57    protected void setUp() throws Exception JavaDoc
58    {
59       super.setUp();
60       log.info("setUp() ....");
61    }
62
63    protected void tearDown() throws Exception JavaDoc
64    {
65       super.tearDown();
66    }
67
68    public void testInteger() throws Exception JavaDoc
69    {
70       CachedType t = new CachedType(int.class);
71       assertTrue("Int ", t.isImmediate());
72
73       t = new CachedType(Integer JavaDoc.class);
74       assertTrue("Int ", t.isImmediate());
75    }
76
77    public void testShort() throws Exception JavaDoc
78    {
79       CachedType t = new CachedType(short.class);
80       assertTrue("Short ", t.isImmediate());
81
82       t = new CachedType(Short JavaDoc.class);
83       assertTrue("Short ", t.isImmediate());
84    }
85
86    public void testString() throws Exception JavaDoc
87    {
88       CachedType t = new CachedType(String JavaDoc.class);
89       assertTrue("String ", t.isImmediate());
90    }
91
92    public void testDouble() throws Exception JavaDoc
93    {
94       CachedType t = new CachedType(double.class);
95       assertTrue("Double ", t.isImmediate());
96
97       t = new CachedType(Double JavaDoc.class);
98       assertTrue("Double ", t.isImmediate());
99    }
100
101    public void testChar() throws Exception JavaDoc
102    {
103       CachedType t = new CachedType(Character JavaDoc.class);
104       assertTrue("Character ", t.isImmediate());
105
106       t = new CachedType(Character JavaDoc.class);
107       assertTrue("Character ", t.isImmediate());
108    }
109
110    public void testBoolean() throws Exception JavaDoc
111    {
112       CachedType t = new CachedType(boolean.class);
113       assertTrue("Boolean ", t.isImmediate());
114
115       t = new CachedType(Boolean JavaDoc.class);
116       assertTrue("Boolean ", t.isImmediate());
117    }
118
119    public void testLong() throws Exception JavaDoc
120    {
121       CachedType t = new CachedType(long.class);
122       assertTrue("Long ", t.isImmediate());
123
124       t = new CachedType(Long JavaDoc.class);
125       assertTrue("Long ", t.isImmediate());
126    }
127
128    public void testByte() throws Exception JavaDoc
129    {
130       CachedType t = new CachedType(byte.class);
131       assertTrue("Byte ", t.isImmediate());
132
133       t = new CachedType(Short JavaDoc.class);
134       assertTrue("Byte ", t.isImmediate());
135    }
136
137    public static Test suite() throws Exception JavaDoc
138    {
139       return new TestSuite(CachedTypeTest.class);
140    }
141
142
143    public static void main(String JavaDoc[] args) throws Exception JavaDoc
144    {
145       junit.textui.TestRunner.run(suite());
146    }
147
148 }
149
Popular Tags