/*
 * JBoss, the OpenSource J2EE webOS
 * 
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.test.jca.test;

import javax.resource.cci.Connection;

/**
 * Uncontended pooling stress test.
 * 
 * @author <a href="adrian@jboss.com">Adrian Brock</a>
 * @version $Revision: 1.1.2.4 $
 */
public class RecyclingStickyStressTestCase extends AbstractRecyclingPoolingStressTest
{
   public boolean isSticky()
   {
      return true;
   }

   public void testIt() throws Throwable
   {
      tm.setTransactionTimeout(0);
      RecyclingPoolingRunnable[] runnables = new RecyclingPoolingRunnable[getThreadCount()];
      for (int i = 0; i < runnables.length; ++i)
      {
         runnables[i] = new RecyclingPoolingRunnable()
         {
            public void doRun1() throws Throwable
            {
               Connection c = cf.getConnection();
               c.close();
            }
         };
      }

      runConcurrentTest(runnables, null);
   }
   
   public RecyclingStickyStressTestCase(String name)
   {
      super(name);
   }
}
