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.dna.api.DNA;
009: import com.tc.object.dna.api.DNAException;
010: import com.tc.object.dna.api.DNAWriter;
011:
012: import gnu.trove.TLinkable;
013:
014: /**
015: * This is a plain vanilla mock object with no internal behavior, unlike MockTCObject
016: */
017: public class TestTCObject implements TCObject {
018:
019: private final Object peerObject;
020: private boolean isNew = false;
021: private TCClass tcClass;
022:
023: public TestTCObject(Object myObject) {
024: this .peerObject = myObject;
025: }
026:
027: public void setNext(TLinkable link) {
028: throw new ImplementMe();
029: }
030:
031: public void setPrevious(TLinkable link) {
032: throw new ImplementMe();
033: }
034:
035: public TLinkable getNext() {
036: throw new ImplementMe();
037: }
038:
039: public TLinkable getPrevious() {
040: throw new ImplementMe();
041: }
042:
043: public ObjectID getObjectID() {
044: return null;
045: }
046:
047: public Object getPeerObject() {
048: return peerObject;
049: }
050:
051: public void setTCClass(TCClass clazz) {
052: this .tcClass = clazz;
053: }
054:
055: public TCClass getTCClass() {
056: return this .tcClass;
057: }
058:
059: public int clearReferences(int toClear) {
060: throw new ImplementMe();
061: }
062:
063: public Object getResolveLock() {
064: throw new ImplementMe();
065: }
066:
067: public void objectFieldChanged(String classname, String fieldname,
068: Object newValue, int index) {
069: throw new ImplementMe();
070: }
071:
072: public void booleanFieldChanged(String classname, String fieldname,
073: boolean newValue, int index) {
074: throw new ImplementMe();
075: }
076:
077: public void byteFieldChanged(String classname, String fieldname,
078: byte newValue, int index) {
079: throw new ImplementMe();
080: }
081:
082: public void charFieldChanged(String classname, String fieldname,
083: char newValue, int index) {
084: throw new ImplementMe();
085: }
086:
087: public void doubleFieldChanged(String classname, String fieldname,
088: double newValue, int index) {
089: throw new ImplementMe();
090: }
091:
092: public void floatFieldChanged(String classname, String fieldname,
093: float newValue, int index) {
094: throw new ImplementMe();
095: }
096:
097: public void intFieldChanged(String classname, String fieldname,
098: int newValue, int index) {
099: throw new ImplementMe();
100: }
101:
102: public void longFieldChanged(String classname, String fieldname,
103: long newValue, int index) {
104: throw new ImplementMe();
105: }
106:
107: public void shortFieldChanged(String classname, String fieldname,
108: short newValue, int index) {
109: throw new ImplementMe();
110: }
111:
112: public void logicalInvoke(int method, String methodName,
113: Object[] parameters) {
114: throw new ImplementMe();
115: }
116:
117: public void hydrate(DNA from, boolean force) throws DNAException {
118: throw new ImplementMe();
119: }
120:
121: public void resolveReference(String fieldName) {
122: throw new ImplementMe();
123: }
124:
125: public void resolveArrayReference(int index) {
126: throw new ImplementMe();
127: }
128:
129: public ObjectID setReference(String fieldName, ObjectID id) {
130: throw new ImplementMe();
131: }
132:
133: public void clearReference(String fieldName) {
134: throw new ImplementMe();
135: }
136:
137: public void setValue(String fieldName, Object obj) {
138: throw new ImplementMe();
139:
140: }
141:
142: public long getVersion() {
143: throw new ImplementMe();
144: }
145:
146: public void setVersion(long version) {
147: throw new ImplementMe();
148: }
149:
150: public boolean dehydrateIfNew(DNAWriter writer) throws DNAException {
151: throw new ImplementMe();
152: }
153:
154: public void markAccessed() {
155: throw new ImplementMe();
156: }
157:
158: public void clearAccessed() {
159: throw new ImplementMe();
160: }
161:
162: public boolean recentlyAccessed() {
163: throw new ImplementMe();
164: }
165:
166: public void resolveAllReferences() {
167: throw new ImplementMe();
168: }
169:
170: public void setIsNew() {
171: this .isNew = true;
172: }
173:
174: public boolean isNew() {
175: return this .isNew;
176: }
177:
178: public boolean isShared() {
179: return true;
180: }
181:
182: public void objectFieldChangedByOffset(String classname,
183: long fieldOffset, Object newValue, int index) {
184: throw new ImplementMe();
185: }
186:
187: public void logicalInvoke(Object object, String methodSignature,
188: Object[] params) {
189: throw new ImplementMe();
190: }
191:
192: public void disableAutoLocking() {
193: throw new ImplementMe();
194: }
195:
196: public boolean autoLockingDisabled() {
197: return false;
198: }
199:
200: public String getFieldNameByOffset(long fieldOffset) {
201: throw new ImplementMe();
202: }
203:
204: public boolean canEvict() {
205: throw new ImplementMe();
206: }
207:
208: public void objectArrayChanged(int startPos, Object[] array,
209: int length) {
210: throw new ImplementMe();
211: }
212:
213: public void primitiveArrayChanged(int startPos, Object array,
214: int length) {
215: throw new ImplementMe();
216: }
217:
218: public int accessCount(int factor) {
219: throw new ImplementMe();
220: }
221:
222: public void literalValueChanged(Object newValue, Object oldValue) {
223: throw new ImplementMe();
224: }
225:
226: public void setLiteralValue(Object newValue) {
227: throw new ImplementMe();
228: }
229:
230: public ArrayIndexOutOfBoundsException checkArrayIndex(int index) {
231: throw new ImplementMe();
232: }
233:
234: public void setArrayReference(int index, ObjectID id) {
235: throw new ImplementMe();
236: }
237:
238: public boolean isFieldPortableByOffset(long fieldOffset) {
239: throw new ImplementMe();
240: }
241: }
|