1 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 ; 30 import java.util.Collection ; 31 import java.util.Map ; 32 import java.util.Set ; 33 34 public class ManagerImplTest extends BaseDSOTestCase { 35 36 public void testClassAutolocksIgnored() throws Exception { 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 lock, int lockLevel) { 50 throw new AssertionError ("should not be called"); 51 } 52 53 public void apply(TxnType txType, LockID[] lockIDs, Collection objectChanges, Set lookupObjectIDs, Map newRoots) { 54 throw new ImplementMe(); 55 } 56 57 public void createObject(TCObject source) { 58 throw new ImplementMe(); 59 } 60 61 public void createRoot(String name, ObjectID id) { 62 throw new ImplementMe(); 63 } 64 65 public void fieldChanged(TCObject source, String classname, String fieldname, Object newValue, int index) { 66 throw new ImplementMe(); 67 } 68 69 public void logicalInvoke(TCObject source, int method, String methodName, Object [] parameters) { 70 throw new ImplementMe(); 71 } 72 73 public void wait(WaitInvocation call, Object object) throws UnlockedSharedObjectException { 74 throw new ImplementMe(); 75 } 76 77 public void notify(String lockName, boolean all, Object 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 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 lockName) { 102 throw new ImplementMe(); 103 } 104 105 public void commit(String lockName) throws UnlockedSharedObjectException { 106 throw new AssertionError ("should not be called"); 107 } 108 109 public void wait(String lockName, WaitInvocation call, Object object) throws UnlockedSharedObjectException { 110 throw new ImplementMe(); 111 112 } 113 114 public void lock(String lockName, int lockLevel) { 115 throw new ImplementMe(); 116 } 117 118 public void unlock(String lockName) { 119 throw new ImplementMe(); 120 } 121 122 public int queueLength(String lockName) { 123 throw new ImplementMe(); 124 } 125 126 public int waitLength(String 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 lockName, int lockLevel) { 147 throw new ImplementMe(); 148 } 149 150 public boolean tryBegin(String lock, int lockLevel) { 151 throw new ImplementMe(); 152 } 153 154 public void arrayChanged(TCObject src, int startPos, Object array, int length) { 155 throw new ImplementMe(); 156 } 157 158 public void literalValueChanged(TCObject source, Object newValue, Object 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 getClassFor(String className, String loaderDesc) { 170 throw new ImplementMe(); 171 } 172 173 public boolean isManaged(Object pojo) { 174 return false; 175 } 176 177 public void markReferenced(TCObject tcobj) { 178 throw new ImplementMe(); 179 } 180 181 public boolean isPortableInstance(Object pojo) { 182 throw new ImplementMe(); 183 } 184 185 public boolean isPortableClass(Class clazz) { 186 throw new ImplementMe(); 187 } 188 189 public void checkPortabilityOfField(Object value, String fieldName, Class targetClass) 190 throws TCNonPortableObjectError { 191 throw new ImplementMe(); 192 } 193 194 public void checkPortabilityOfLogicalAction(Object param, String methodName, Class logicalType) 195 throws TCNonPortableObjectError { 196 throw new ImplementMe(); 197 } 198 199 public Object lookupObject(ObjectID id) { 200 throw new ImplementMe(); 201 } 202 203 public TCObject lookupOrCreate(Object obj) { 204 throw new ImplementMe(); 205 } 206 207 public ObjectID lookupExistingObjectID(Object obj) { 208 throw new ImplementMe(); 209 } 210 211 public Object lookupRoot(String name) { 212 throw new ImplementMe(); 213 } 214 215 public Object lookupOrCreateRoot(String name, Object 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 pojo) { 228 return null; 229 } 230 231 public Collection getAllObjectIDsAndClear(Collection 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 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 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 deepCopy(Object source, OptimisticTransactionManager optimisticTxManager) { 276 throw new ImplementMe(); 277 } 278 279 public Object createNewCopyInstance(Object source, Object parent) { 280 throw new ImplementMe(); 281 } 282 283 public Object createParentCopyInstanceIfNecessary(Map visited, Map cloned, Object v) { 284 throw new ImplementMe(); 285 } 286 287 public void replaceRootIDIfNecessary(String rootName, ObjectID newRootID) { 288 throw new ImplementMe(); 289 290 } 291 292 public Object lookupOrCreateRoot(String name, Object obj, boolean dsoFinal) { 293 throw new ImplementMe(); 294 } 295 296 public TCObject lookupOrShare(Object 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 lookupObjectNoDepth(ObjectID id) { 314 throw new ImplementMe(); 315 } 316 317 public Object lookupOrCreateRootNoDepth(String rootName, Object object) { 318 throw new ImplementMe(); 319 } 320 321 public Object createOrReplaceRoot(String rootName, Object root) { 322 throw new ImplementMe(); 323 } 324 } 325 326 } 327 | Popular Tags |