1 22 package org.jboss.test.jca.test; 23 24 import javax.resource.cci.Connection ; 25 import javax.transaction.Transaction ; 26 27 33 public class ContentiousInterleavingStressTestCase extends AbstractContentiousPoolingStressTest 34 { 35 public void testIt() throws Throwable 36 { 37 tm.setTransactionTimeout(0); 38 tm.begin(); 39 final Transaction tx = tm.suspend(); 40 ContentiousPoolingRunnable[] runnables = new ContentiousPoolingRunnable[getThreadCount()]; 41 for (int i = 0; i < runnables.length; ++i) 42 { 43 runnables[i] = new ContentiousPoolingRunnable(tx) 44 { 45 public void doRun() throws Throwable 46 { 47 Connection c = cf.getConnection(); 48 c.close(); 49 } 50 }; 51 } 52 53 runConcurrentTest(runnables, new ConcurrentTestCallback() 54 { 55 public void finished() throws Throwable 56 { 57 tm.resume(tx); 58 tm.commit(); 59 } 60 }); 61 } 62 63 public ContentiousInterleavingStressTestCase(String name) 64 { 65 super(name); 66 } 67 } 68 | Popular Tags |