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 ContentiousStickyStressTestCase extends AbstractContentiousPoolingStressTest 34 { 35 public boolean isSticky() 36 { 37 return true; 38 } 39 40 public void testContentiousInterleavingStressTestcase() throws Throwable 41 { 42 tm.setTransactionTimeout(0); 43 tm.begin(); 44 final Transaction tx = tm.suspend(); 45 ContentiousPoolingRunnable[] runnables = new ContentiousPoolingRunnable[getThreadCount()]; 46 for (int i = 0; i < runnables.length; ++i) 47 { 48 runnables[i] = new ContentiousPoolingRunnable(tx) 49 { 50 public void doRun() throws Throwable 51 { 52 Connection c = cf.getConnection(); 53 c.close(); 54 } 55 }; 56 } 57 58 runConcurrentTest(runnables, new ConcurrentTestCallback() 59 { 60 public void finished() throws Throwable 61 { 62 tm.resume(tx); 63 tm.commit(); 64 } 65 }); 66 } 67 68 public ContentiousStickyStressTestCase(String name) 69 { 70 super(name); 71 } 72 } 73 | Popular Tags |