001 package com.mockrunner.ejb; 002 003 import javax.jms.ConnectionFactory; 004 import javax.jms.Destination; 005 006 import org.mockejb.BasicEjbDescriptor; 007 import org.mockejb.TransactionPolicy; 008 009 import com.mockrunner.base.BaseTestCase; 010 011 /** 012 * Delegator for {@link com.mockrunner.ejb.EJBTestModule}. You can 013 * subclass this adapter or use {@link com.mockrunner.ejb.EJBTestModule} 014 * directly (so your test case can use another base class). 015 * This adapter extends {@link com.mockrunner.base.BaseTestCase}. 016 * It can be used if you want to use several modules in conjunction. 017 * <b>This class is generated from the {@link com.mockrunner.ejb.EJBTestModule} 018 * and should not be edited directly</b>. 019 */ 020 public abstract class EJBTestCaseAdapter extends BaseTestCase 021 { 022 private EJBTestModule ejbTestModule; 023 024 public EJBTestCaseAdapter() 025 { 026 027 } 028 029 public EJBTestCaseAdapter(String name) 030 { 031 super(name); 032 } 033 034 protected void tearDown() throws Exception 035 { 036 super.tearDown(); 037 ejbTestModule = null; 038 } 039 040 /** 041 * Creates the {@link com.mockrunner.ejb.EJBTestModule}. If you 042 * overwrite this method, you must call <code>super.setUp()</code>. 043 */ 044 protected void setUp() throws Exception 045 { 046 super.setUp(); 047 ejbTestModule = createEJBTestModule(getEJBMockObjectFactory()); 048 } 049 050 /** 051 * Gets the {@link com.mockrunner.ejb.EJBTestModule}. 052 * @return the {@link com.mockrunner.ejb.EJBTestModule} 053 */ 054 protected EJBTestModule getEJBTestModule() 055 { 056 return ejbTestModule; 057 } 058 059 /** 060 * Sets the {@link com.mockrunner.ejb.EJBTestModule}. 061 * @param ejbTestModule the {@link com.mockrunner.ejb.EJBTestModule} 062 */ 063 protected void setEJBTestModule(EJBTestModule ejbTestModule) 064 { 065 this.ejbTestModule = ejbTestModule; 066 } 067 068 /** 069 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#setImplementationSuffix(String)} 070 */ 071 protected void setImplementationSuffix(String impSuffix) 072 { 073 ejbTestModule.setImplementationSuffix(impSuffix); 074 } 075 076 /** 077 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#setBusinessInterfaceSuffix(String)} 078 */ 079 protected void setBusinessInterfaceSuffix(String businessInterfaceSuffix) 080 { 081 ejbTestModule.setBusinessInterfaceSuffix(businessInterfaceSuffix); 082 } 083 084 /** 085 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#setHomeInterfaceSuffix(String)} 086 */ 087 protected void setHomeInterfaceSuffix(String homeInterfaceSuffix) 088 { 089 ejbTestModule.setHomeInterfaceSuffix(homeInterfaceSuffix); 090 } 091 092 /** 093 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#setInterfacePackage(String)} 094 */ 095 protected void setInterfacePackage(String interfacePackage) 096 { 097 ejbTestModule.setInterfacePackage(interfacePackage); 098 } 099 100 /** 101 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#setHomeInterfacePackage(String)} 102 */ 103 protected void setHomeInterfacePackage(String homeInterfacePackage) 104 { 105 ejbTestModule.setHomeInterfacePackage(homeInterfacePackage); 106 } 107 108 /** 109 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#setBusinessInterfacePackage(String)} 110 */ 111 protected void setBusinessInterfacePackage(String businessInterfacePackage) 112 { 113 ejbTestModule.setBusinessInterfacePackage(businessInterfacePackage); 114 } 115 116 /** 117 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploy(BasicEjbDescriptor)} 118 */ 119 protected void deploy(BasicEjbDescriptor descriptor) 120 { 121 ejbTestModule.deploy(descriptor); 122 } 123 124 /** 125 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploy(BasicEjbDescriptor, TransactionPolicy)} 126 */ 127 protected void deploy(BasicEjbDescriptor descriptor, TransactionPolicy policy) 128 { 129 ejbTestModule.deploy(descriptor, policy); 130 } 131 132 /** 133 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Class, TransactionPolicy)} 134 */ 135 protected void deploySessionBean(String jndiName, Class beanClass, TransactionPolicy policy) 136 { 137 ejbTestModule.deploySessionBean(jndiName, beanClass, policy); 138 } 139 140 /** 141 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Class)} 142 */ 143 protected void deploySessionBean(String jndiName, Class beanClass) 144 { 145 ejbTestModule.deploySessionBean(jndiName, beanClass); 146 } 147 148 /** 149 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Class, boolean)} 150 */ 151 protected void deploySessionBean(String jndiName, Class beanClass, boolean stateful) 152 { 153 ejbTestModule.deploySessionBean(jndiName, beanClass, stateful); 154 } 155 156 /** 157 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Object, TransactionPolicy)} 158 */ 159 protected void deploySessionBean(String jndiName, Object bean, TransactionPolicy policy) 160 { 161 ejbTestModule.deploySessionBean(jndiName, bean, policy); 162 } 163 164 /** 165 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Class, boolean, TransactionPolicy)} 166 */ 167 protected void deploySessionBean(String jndiName, Class beanClass, boolean stateful, TransactionPolicy policy) 168 { 169 ejbTestModule.deploySessionBean(jndiName, beanClass, stateful, policy); 170 } 171 172 /** 173 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Object)} 174 */ 175 protected void deploySessionBean(String jndiName, Object bean) 176 { 177 ejbTestModule.deploySessionBean(jndiName, bean); 178 } 179 180 /** 181 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Object, boolean)} 182 */ 183 protected void deploySessionBean(String jndiName, Object bean, boolean stateful) 184 { 185 ejbTestModule.deploySessionBean(jndiName, bean, stateful); 186 } 187 188 /** 189 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deploySessionBean(String, Object, boolean, TransactionPolicy)} 190 */ 191 protected void deploySessionBean(String jndiName, Object bean, boolean stateful, TransactionPolicy policy) 192 { 193 ejbTestModule.deploySessionBean(jndiName, bean, stateful, policy); 194 } 195 196 /** 197 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deployEntityBean(String, Class, TransactionPolicy)} 198 */ 199 protected void deployEntityBean(String jndiName, Class beanClass, TransactionPolicy policy) 200 { 201 ejbTestModule.deployEntityBean(jndiName, beanClass, policy); 202 } 203 204 /** 205 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deployEntityBean(String, Class)} 206 */ 207 protected void deployEntityBean(String jndiName, Class beanClass) 208 { 209 ejbTestModule.deployEntityBean(jndiName, beanClass); 210 } 211 212 /** 213 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deployMessageBean(String, String, ConnectionFactory, Destination, Object, TransactionPolicy)} 214 */ 215 protected void deployMessageBean(String connectionFactoryJndiName, String destinationJndiName, ConnectionFactory connectionFactory, Destination destination, Object bean, TransactionPolicy policy) 216 { 217 ejbTestModule.deployMessageBean(connectionFactoryJndiName, destinationJndiName, connectionFactory, destination, bean, policy); 218 } 219 220 /** 221 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#deployMessageBean(String, String, ConnectionFactory, Destination, Object)} 222 */ 223 protected void deployMessageBean(String connectionFactoryJndiName, String destinationJndiName, ConnectionFactory connectionFactory, Destination destination, Object bean) 224 { 225 ejbTestModule.deployMessageBean(connectionFactoryJndiName, destinationJndiName, connectionFactory, destination, bean); 226 } 227 228 /** 229 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#bindToContext(String, Object)} 230 */ 231 protected void bindToContext(String name, Object object) 232 { 233 ejbTestModule.bindToContext(name, object); 234 } 235 236 /** 237 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#lookupBean(String)} 238 * @deprecated 239 */ 240 protected Object lookupBean(String name) 241 { 242 return ejbTestModule.lookupBean(name); 243 } 244 245 /** 246 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#lookupBean(String, String, Object[])} 247 * @deprecated 248 */ 249 protected Object lookupBean(String name, String createMethod, Object[] parameters) 250 { 251 return ejbTestModule.lookupBean(name, createMethod, parameters); 252 } 253 254 /** 255 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#lookupBean(String, Object[])} 256 * @deprecated 257 */ 258 protected Object lookupBean(String name, Object[] parameters) 259 { 260 return ejbTestModule.lookupBean(name, parameters); 261 } 262 263 /** 264 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createBean(String)} 265 */ 266 protected Object createBean(String name) 267 { 268 return ejbTestModule.createBean(name); 269 } 270 271 /** 272 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createBean(String, String, Object[])} 273 */ 274 protected Object createBean(String name, String createMethod, Object[] parameters) 275 { 276 return ejbTestModule.createBean(name, createMethod, parameters); 277 } 278 279 /** 280 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createBean(String, String, Object[], Class[])} 281 */ 282 protected Object createBean(String name, String createMethod, Object[] parameters, Class[] parameterTypes) 283 { 284 return ejbTestModule.createBean(name, createMethod, parameters, parameterTypes); 285 } 286 287 /** 288 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createBean(String, Object[])} 289 */ 290 protected Object createBean(String name, Object[] parameters) 291 { 292 return ejbTestModule.createBean(name, parameters); 293 } 294 295 /** 296 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createEntityBean(String, String, Object[], Class[], Object)} 297 */ 298 protected Object createEntityBean(String name, String createMethod, Object[] parameters, Class[] parameterTypes, Object primaryKey) 299 { 300 return ejbTestModule.createEntityBean(name, createMethod, parameters, parameterTypes, primaryKey); 301 } 302 303 /** 304 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createEntityBean(String, String, Object[], Object)} 305 */ 306 protected Object createEntityBean(String name, String createMethod, Object[] parameters, Object primaryKey) 307 { 308 return ejbTestModule.createEntityBean(name, createMethod, parameters, primaryKey); 309 } 310 311 /** 312 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createEntityBean(String, Object)} 313 */ 314 protected Object createEntityBean(String name, Object primaryKey) 315 { 316 return ejbTestModule.createEntityBean(name, primaryKey); 317 } 318 319 /** 320 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#createEntityBean(String, Object[], Object)} 321 */ 322 protected Object createEntityBean(String name, Object[] parameters, Object primaryKey) 323 { 324 return ejbTestModule.createEntityBean(name, parameters, primaryKey); 325 } 326 327 /** 328 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#findByPrimaryKey(String, Object)} 329 */ 330 protected Object findByPrimaryKey(String name, Object primaryKey) 331 { 332 return ejbTestModule.findByPrimaryKey(name, primaryKey); 333 } 334 335 /** 336 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#resetUserTransaction} 337 */ 338 protected void resetUserTransaction() 339 { 340 ejbTestModule.resetUserTransaction(); 341 } 342 343 /** 344 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#verifyCommitted} 345 */ 346 protected void verifyCommitted() 347 { 348 ejbTestModule.verifyCommitted(); 349 } 350 351 /** 352 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#verifyNotCommitted} 353 */ 354 protected void verifyNotCommitted() 355 { 356 ejbTestModule.verifyNotCommitted(); 357 } 358 359 /** 360 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#verifyRolledBack} 361 */ 362 protected void verifyRolledBack() 363 { 364 ejbTestModule.verifyRolledBack(); 365 } 366 367 /** 368 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#verifyNotRolledBack} 369 */ 370 protected void verifyNotRolledBack() 371 { 372 ejbTestModule.verifyNotRolledBack(); 373 } 374 375 /** 376 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#verifyMarkedForRollback} 377 */ 378 protected void verifyMarkedForRollback() 379 { 380 ejbTestModule.verifyMarkedForRollback(); 381 } 382 383 /** 384 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#verifyNotMarkedForRollback} 385 */ 386 protected void verifyNotMarkedForRollback() 387 { 388 ejbTestModule.verifyNotMarkedForRollback(); 389 } 390 391 /** 392 * Delegates to {@link com.mockrunner.ejb.EJBTestModule#lookup(String)} 393 */ 394 protected Object lookup(String name) 395 { 396 return ejbTestModule.lookup(name); 397 } 398 }