KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > TCClassTest


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object;
5
6 import com.tc.object.bytecode.MockClassProvider;
7 import com.tc.object.config.DSOClientConfigHelper;
8 import com.tc.object.field.TCFieldFactory;
9
10 /**
11  * TODO Nov 17, 2004: I, steve, am too lazy to write a single sentence describing what this class is for.
12  */

13 public class TCClassTest extends BaseDSOTestCase {
14   public void tests() throws Exception JavaDoc {
15     // ClientObjectManager manager = new ClientObjectManagerImpl(null, null, null, null);
16

17     DSOClientConfigHelper config = configHelper();
18     TCFieldFactory fieldFactory = new TCFieldFactory(config);
19     ClientObjectManager objectManager = new TestClientObjectManager();
20     TCClassFactory classFactory = new TCClassFactoryImpl(fieldFactory, config, new MockClassProvider());
21     TCClass tcc1 = new TCClassImpl(fieldFactory, classFactory, objectManager, TCClassTest.class, null, "", null, false, false, null, null, false);
22     assertFalse(tcc1.isIndexed());
23     assertFalse(tcc1.isNonStaticInner());
24     TCClass tcc2 = new TCClassImpl(fieldFactory, classFactory, objectManager, TestClass1.class, null, "", null, false, false, null, null, false);
25     assertFalse(tcc2.isIndexed());
26     assertTrue(tcc2.isNonStaticInner());
27     TCClass tcc3 = new TCClassImpl(fieldFactory, classFactory, objectManager, TestClass2.class, null, "", null, false, false, null, null, false);
28     assertFalse(tcc3.isIndexed());
29     assertFalse(tcc3.isNonStaticInner());
30     TCClass tcc4 = new TCClassImpl(fieldFactory, classFactory, objectManager, TestClass1[].class, null, "", null, true, false, null, null, false);
31     assertTrue(tcc4.isIndexed());
32     assertFalse(tcc4.isNonStaticInner());
33
34     TCClass tcc5 = new TCClassImpl(fieldFactory, classFactory, objectManager, TestClass1[].class, null, "timmy", null, true, false, null,
35                                    null, false);
36     assertEquals("timmy", tcc5.getDefiningLoaderDescription());
37   }
38
39   private class TestClass1 {
40     //
41
}
42
43   private static class TestClass2 {
44     //
45
}
46 }
Popular Tags