Package org.jboss.tm

Examples of org.jboss.tm.TransactionLocal


      }
   }
  
   public void testSimpleGetWithInitial() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      tm.begin();
      try
      {
         assertEquals("Initial", local.get());
      }
      finally
      {
         tm.commit();
      }
View Full Code Here


      }
   }
  
   public void testGetNoTx() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      assertEquals(null, local.get(null));
   }
View Full Code Here

      assertEquals(null, local.get(null));
   }
  
   public void testGetNoTxInitial() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      assertEquals("Initial", local.get());
   }
View Full Code Here

      assertEquals("Initial", local.get());
   }
  
   public void testSetNoTx() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      try
      {
         local.set("Something");
         fail("Should not be here");
      }
      catch (IllegalStateException expected)
      {
      }
View Full Code Here

      }
   }
  
   public void testSimpleSetGetExplicit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      Transaction tx = tm.suspend();
      try
      {
         local.set(tx, "Simple");
         assertEquals("Simple", local.get(tx));
      }
      finally
      {
         tm.resume(tx);
         tm.commit();
View Full Code Here

      }
   }
  
   public void testSimplePutNullExplicit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      Transaction tx = tm.suspend();
      try
      {
         local.set(tx, null);
      }
      finally
      {
         tm.resume(tx);
         tm.commit();
View Full Code Here

      }
   }
  
   public void testSimpleGetWithNoInitialExplicit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      Transaction tx = tm.suspend();
      try
      {
         assertEquals(null, local.get(tx));
      }
      finally
      {
         tm.resume(tx);
         tm.commit();
View Full Code Here

      }
   }
  
   public void testSimpleGetWithInitialExplicit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      tm.begin();
      Transaction tx = tm.suspend();
      try
      {
         assertEquals("Initial", local.get(tx));
      }
      finally
      {
         tm.resume(tx);
         tm.commit();
View Full Code Here

      }
   }
  
   public void testGetNoTxExplicit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      assertEquals(null, local.get(null));
   }
View Full Code Here

      assertEquals(null, local.get(null));
   }
  
   public void testGetNoTxInitialExplicit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      assertEquals("Initial", local.get(null));
   }
View Full Code Here

TOP

Related Classes of org.jboss.tm.TransactionLocal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.