KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > bytecode > ManagerImplTest


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.bytecode;
5
6 import com.tc.exception.ImplementMe;
7 import com.tc.exception.TCNonPortableObjectError;
8 import com.tc.net.protocol.tcm.ChannelIDProvider;
9 import com.tc.object.BaseDSOTestCase;
10 import com.tc.object.ClientObjectManager;
11 import com.tc.object.ObjectID;
12 import com.tc.object.TCClass;
13 import com.tc.object.TCObject;
14 import com.tc.object.WeakObjectReference;
15 import com.tc.object.dmi.DmiDescriptor;
16 import com.tc.object.dna.api.DNA;
17 import com.tc.object.loaders.StandardClassProvider;
18 import com.tc.object.lockmanager.api.LockID;
19 import com.tc.object.session.SessionID;
20 import com.tc.object.tx.ClientTransaction;
21 import com.tc.object.tx.ClientTransactionManager;
22 import com.tc.object.tx.TransactionID;
23 import com.tc.object.tx.TxnBatchID;
24 import com.tc.object.tx.TxnType;
25 import com.tc.object.tx.UnlockedSharedObjectException;
26 import com.tc.object.tx.WaitInvocation;
27 import com.tc.object.tx.optimistic.OptimisticTransactionManager;
28
29 import java.lang.ref.ReferenceQueue JavaDoc;
30 import java.util.Collection JavaDoc;
31 import java.util.Map JavaDoc;
32 import java.util.Set JavaDoc;
33
34 public class ManagerImplTest extends BaseDSOTestCase {
35
36   public void testClassAutolocksIgnored() throws Exception JavaDoc {
37     ClientObjectManager objMgr = new ObjMgr();
38     ClientTransactionManager txnMgr = new TxnMgr();
39
40     Manager manager = new ManagerImpl(false, objMgr, txnMgr, this.configHelper(), new StandardClassProvider(), null);
41
42     manager.monitorEnter(getClass(), Manager.LOCK_TYPE_WRITE);
43
44     manager.monitorExit(getClass());
45   }
46
47   private static class TxnMgr implements ClientTransactionManager {
48
49     public void begin(String JavaDoc lock, int lockLevel) {
50       throw new AssertionError JavaDoc("should not be called");
51     }
52
53     public void apply(TxnType txType, LockID[] lockIDs, Collection JavaDoc objectChanges, Set JavaDoc lookupObjectIDs, Map JavaDoc newRoots) {
54       throw new ImplementMe();
55     }
56
57     public void createObject(TCObject source) {
58       throw new ImplementMe();
59     }
60
61     public void createRoot(String JavaDoc name, ObjectID id) {
62       throw new ImplementMe();
63     }
64
65     public void fieldChanged(TCObject source, String JavaDoc classname, String JavaDoc fieldname, Object JavaDoc newValue, int index) {
66       throw new ImplementMe();
67     }
68
69     public void logicalInvoke(TCObject source, int method, String JavaDoc methodName, Object JavaDoc[] parameters) {
70       throw new ImplementMe();
71     }
72
73     public void wait(WaitInvocation call, Object JavaDoc object) throws UnlockedSharedObjectException {
74       throw new ImplementMe();
75     }
76
77     public void notify(String JavaDoc lockName, boolean all, Object JavaDoc object) throws UnlockedSharedObjectException {
78       throw new ImplementMe();
79     }
80
81     public void receivedAcknowledgement(SessionID sessionID, TransactionID requestID) {
82       throw new ImplementMe();
83     }
84
85     public void receivedBatchAcknowledgement(TxnBatchID batchID) {
86       throw new ImplementMe();
87     }
88
89     public void checkWriteAccess(Object JavaDoc context) {
90       throw new ImplementMe();
91     }
92
93     public void addReference(TCObject tco) {
94       throw new ImplementMe();
95     }
96
97     public ChannelIDProvider getChannelIDProvider() {
98       throw new ImplementMe();
99     }
100
101     public boolean isLocked(String JavaDoc lockName) {
102       throw new ImplementMe();
103     }
104
105     public void commit(String JavaDoc lockName) throws UnlockedSharedObjectException {
106       throw new AssertionError JavaDoc("should not be called");
107     }
108
109     public void wait(String JavaDoc lockName, WaitInvocation call, Object JavaDoc object) throws UnlockedSharedObjectException {
110       throw new ImplementMe();
111
112     }
113
114     public void lock(String JavaDoc lockName, int lockLevel) {
115       throw new ImplementMe();
116     }
117
118     public void unlock(String JavaDoc lockName) {
119       throw new ImplementMe();
120     }
121
122     public int queueLength(String JavaDoc lockName) {
123       throw new ImplementMe();
124     }
125
126     public int waitLength(String JavaDoc lockName) {
127       throw new ImplementMe();
128     }
129
130     public ClientTransaction getTransaction() {
131       throw new ImplementMe();
132     }
133
134     public void disableTransactionLogging() {
135       throw new ImplementMe();
136     }
137
138     public void enableTransactionLogging() {
139       throw new ImplementMe();
140     }
141
142     public boolean isTransactionLoggingDisabled() {
143       throw new ImplementMe();
144     }
145
146     public boolean isHeldByCurrentThread(String JavaDoc lockName, int lockLevel) {
147       throw new ImplementMe();
148     }
149
150     public boolean tryBegin(String JavaDoc lock, int lockLevel) {
151       throw new ImplementMe();
152     }
153
154     public void arrayChanged(TCObject src, int startPos, Object JavaDoc array, int length) {
155       throw new ImplementMe();
156     }
157
158     public void literalValueChanged(TCObject source, Object JavaDoc newValue, Object JavaDoc oldValue) {
159       throw new ImplementMe();
160     }
161
162     public void addDmiDescriptor(DmiDescriptor d) {
163       throw new ImplementMe();
164     }
165   }
166
167   private static class ObjMgr implements ClientObjectManager {
168
169     public Class JavaDoc getClassFor(String JavaDoc className, String JavaDoc loaderDesc) {
170       throw new ImplementMe();
171     }
172
173     public boolean isManaged(Object JavaDoc pojo) {
174       return false;
175     }
176
177     public void markReferenced(TCObject tcobj) {
178       throw new ImplementMe();
179     }
180
181     public boolean isPortableInstance(Object JavaDoc pojo) {
182       throw new ImplementMe();
183     }
184
185     public boolean isPortableClass(Class JavaDoc clazz) {
186       throw new ImplementMe();
187     }
188
189     public void checkPortabilityOfField(Object JavaDoc value, String JavaDoc fieldName, Class JavaDoc targetClass)
190         throws TCNonPortableObjectError {
191       throw new ImplementMe();
192     }
193
194     public void checkPortabilityOfLogicalAction(Object JavaDoc param, String JavaDoc methodName, Class JavaDoc logicalType)
195         throws TCNonPortableObjectError {
196       throw new ImplementMe();
197     }
198
199     public Object JavaDoc lookupObject(ObjectID id) {
200       throw new ImplementMe();
201     }
202
203     public TCObject lookupOrCreate(Object JavaDoc obj) {
204       throw new ImplementMe();
205     }
206
207     public ObjectID lookupExistingObjectID(Object JavaDoc obj) {
208       throw new ImplementMe();
209     }
210
211     public Object JavaDoc lookupRoot(String JavaDoc name) {
212       throw new ImplementMe();
213     }
214
215     public Object JavaDoc lookupOrCreateRoot(String JavaDoc name, Object JavaDoc obj) {
216       throw new ImplementMe();
217     }
218
219     public TCObject lookupIfLocal(ObjectID id) {
220       throw new ImplementMe();
221     }
222
223     public TCObject lookup(ObjectID id) {
224       throw new ImplementMe();
225     }
226
227     public TCObject lookupExistingOrNull(Object JavaDoc pojo) {
228       return null;
229     }
230
231     public Collection JavaDoc getAllObjectIDsAndClear(Collection JavaDoc c) {
232       throw new ImplementMe();
233     }
234
235     public WeakObjectReference createNewPeer(TCClass clazz, DNA dna) {
236       throw new ImplementMe();
237     }
238
239     public WeakObjectReference createNewPeer(TCClass clazz, int size, ObjectID id, ObjectID parentID) {
240       throw new ImplementMe();
241     }
242
243     public TCClass getOrCreateClass(Class JavaDoc clazz) {
244       throw new ImplementMe();
245     }
246
247     public void setTransactionManager(ClientTransactionManager txManager) {
248       throw new ImplementMe();
249     }
250
251     public ClientTransactionManager getTransactionManager() {
252       throw new ImplementMe();
253     }
254
255     public ReferenceQueue JavaDoc getReferenceQueue() {
256       throw new ImplementMe();
257     }
258
259     public void shutdown() {
260       throw new ImplementMe();
261     }
262
263     public void unpause() {
264       throw new ImplementMe();
265     }
266
267     public void pause() {
268       throw new ImplementMe();
269     }
270
271     public void starting() {
272       throw new ImplementMe();
273     }
274
275     public Object JavaDoc deepCopy(Object JavaDoc source, OptimisticTransactionManager optimisticTxManager) {
276       throw new ImplementMe();
277     }
278
279     public Object JavaDoc createNewCopyInstance(Object JavaDoc source, Object JavaDoc parent) {
280       throw new ImplementMe();
281     }
282
283     public Object JavaDoc createParentCopyInstanceIfNecessary(Map JavaDoc visited, Map JavaDoc cloned, Object JavaDoc v) {
284       throw new ImplementMe();
285     }
286
287     public void replaceRootIDIfNecessary(String JavaDoc rootName, ObjectID newRootID) {
288       throw new ImplementMe();
289
290     }
291
292     public Object JavaDoc lookupOrCreateRoot(String JavaDoc name, Object JavaDoc obj, boolean dsoFinal) {
293       throw new ImplementMe();
294     }
295
296     public TCObject lookupOrShare(Object JavaDoc pojo) {
297       throw new ImplementMe();
298     }
299
300     public boolean isCreationInProgress() {
301       throw new ImplementMe();
302     }
303
304     public void addPendingCreateObjectsToTransaction() {
305       throw new ImplementMe();
306
307     }
308
309     public boolean hasPendingCreateObjects() {
310       throw new ImplementMe();
311     }
312
313     public Object JavaDoc lookupObjectNoDepth(ObjectID id) {
314       throw new ImplementMe();
315     }
316
317     public Object JavaDoc lookupOrCreateRootNoDepth(String JavaDoc rootName, Object JavaDoc object) {
318       throw new ImplementMe();
319     }
320
321     public Object JavaDoc createOrReplaceRoot(String JavaDoc rootName, Object JavaDoc root) {
322       throw new ImplementMe();
323     }
324   }
325
326 }
327
Popular Tags