01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.object;
06:
07: import com.tc.object.bytecode.MockClassProvider;
08: import com.tc.object.config.DSOClientConfigHelper;
09: import com.tc.object.field.TCFieldFactory;
10:
11: public class TCClassTest extends BaseDSOTestCase {
12: public void tests() throws Exception {
13: // ClientObjectManager manager = new ClientObjectManagerImpl(null, null, null, null);
14:
15: DSOClientConfigHelper config = configHelper();
16: TCFieldFactory fieldFactory = new TCFieldFactory(config);
17: ClientObjectManager objectManager = new TestClientObjectManager();
18: TCClassFactory classFactory = new TCClassFactoryImpl(
19: fieldFactory, config, new MockClassProvider());
20: TCClass tcc1 = new TCClassImpl(fieldFactory, classFactory,
21: objectManager, TCClassTest.class, null, "", null,
22: false, false, null, null, false);
23: assertFalse(tcc1.isIndexed());
24: assertFalse(tcc1.isNonStaticInner());
25: TCClass tcc2 = new TCClassImpl(fieldFactory, classFactory,
26: objectManager, TestClass1.class, null, "", null, false,
27: false, null, null, false);
28: assertFalse(tcc2.isIndexed());
29: assertTrue(tcc2.isNonStaticInner());
30: TCClass tcc3 = new TCClassImpl(fieldFactory, classFactory,
31: objectManager, TestClass2.class, null, "", null, false,
32: false, null, null, false);
33: assertFalse(tcc3.isIndexed());
34: assertFalse(tcc3.isNonStaticInner());
35: TCClass tcc4 = new TCClassImpl(fieldFactory, classFactory,
36: objectManager, TestClass1[].class, null, "", null,
37: true, false, null, null, false);
38: assertTrue(tcc4.isIndexed());
39: assertFalse(tcc4.isNonStaticInner());
40:
41: TCClass tcc5 = new TCClassImpl(fieldFactory, classFactory,
42: objectManager, TestClass1[].class, null, "timmy", null,
43: true, false, null, null, false);
44: assertEquals("timmy", tcc5.getDefiningLoaderDescription());
45: }
46:
47: private class TestClass1 {
48: //
49: }
50:
51: private static class TestClass2 {
52: //
53: }
54: }
|