001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tc.object;
006:
007: import com.tc.exception.ImplementMe;
008: import com.tc.object.applicator.ChangeApplicator;
009: import com.tc.object.dna.api.DNA;
010: import com.tc.object.dna.api.DNAWriter;
011: import com.tc.object.field.TCField;
012: import com.tc.object.tx.optimistic.OptimisticTransactionManager;
013:
014: import java.lang.reflect.Constructor;
015: import java.lang.reflect.Field;
016: import java.util.Map;
017:
018: public class TestClassFactory implements TCClassFactory {
019:
020: public TCClass getOrCreate(Class clazz,
021: ClientObjectManager objectManager) {
022: return new MockTCClass();
023: }
024:
025: public ChangeApplicator createApplicatorFor(TCClass clazz,
026: boolean indexed) {
027: throw new ImplementMe();
028: }
029:
030: public static class MockTCClass implements TCClass {
031:
032: public boolean hasOnLoadExecuteScript() {
033: return false;
034: }
035:
036: public boolean hasOnLoadMethod() {
037: return false;
038: }
039:
040: public String getOnLoadMethod() {
041: return null;
042: }
043:
044: public String getOnLoadExecuteScript() {
045: return null;
046: }
047:
048: public Field getParentField() {
049: return null;
050: }
051:
052: public String getParentFieldName() {
053: return null;
054: }
055:
056: public TCField[] getPortableFields() {
057: return null;
058: }
059:
060: public TraversedReferences getPortableObjects(Object pojo,
061: TraversedReferences addTo) {
062: return addTo;
063: }
064:
065: public Constructor getConstructor() {
066: return null;
067: }
068:
069: public String getName() {
070: return null;
071: }
072:
073: public Class getComponentType() {
074: return null;
075: }
076:
077: public boolean isLogical() {
078: return false;
079: }
080:
081: public TCClass getSuperclass() {
082: return null;
083: }
084:
085: public boolean isNonStaticInner() {
086: return false;
087: }
088:
089: public boolean isPortable() {
090: return false;
091: }
092:
093: public TCField getField(String name) {
094: return null;
095: }
096:
097: public boolean isIndexed() {
098: return false;
099: }
100:
101: public void hydrate(TCObject tcObject, DNA dna, Object pojo,
102: boolean force) {
103: //
104: }
105:
106: public void dehydrate(TCObject tcObject, DNAWriter writer,
107: Object pojo) {
108: //
109: }
110:
111: public String getDefiningLoaderDescription() {
112: return null;
113: }
114:
115: public TCObject createTCObject(ObjectID id, Object peer) {
116: return null;
117: }
118:
119: public boolean isUseNonDefaultConstructor() {
120: return false;
121: }
122:
123: public Object getNewInstanceFromNonDefaultConstructor(DNA dna) {
124: return null;
125: }
126:
127: public Class getPeerClass() {
128: throw new ImplementMe();
129: }
130:
131: public Map connectedCopy(Object source, Object dest,
132: Map visited, OptimisticTransactionManager txManager) {
133: throw new ImplementMe();
134: }
135:
136: public String getFieldNameByOffset(long fieldOffset) {
137: throw new ImplementMe();
138: }
139:
140: public ClientObjectManager getObjectManager() {
141: throw new ImplementMe();
142: }
143:
144: public boolean isProxyClass() {
145: return false;
146: }
147:
148: public String getExtendingClassName() {
149: return getName();
150: }
151:
152: public boolean isEnum() {
153: return false;
154: }
155:
156: public boolean isPortableField(long fieldOffset) {
157: throw new ImplementMe();
158: }
159:
160: }
161: }
|