Examples of TransactionLocal


Examples of org.jboss.tm.TransactionLocal

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

Examples of org.jboss.tm.TransactionLocal

      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

Examples of org.jboss.tm.TransactionLocal

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

Examples of org.jboss.tm.TransactionLocal

      }
   }
  
   public void testGetAfterCommit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      try
      {
         local.set("Something");
      }
      finally
      {
         tm.commit();
      }
      assertEquals(null, local.get());
   }
View Full Code Here

Examples of org.jboss.tm.TransactionLocal

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

Examples of org.jboss.tm.TransactionLocal

      assertEquals("Initial", local.get());
   }
  
   public void testGetMarkedRolledBack() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      tm.setRollbackOnly();
      try
      {
         assertEquals(null, local.get());
      }
      finally
      {
         tm.rollback();
      }
View Full Code Here

Examples of org.jboss.tm.TransactionLocal

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

Examples of org.jboss.tm.TransactionLocal

      }
   }
  
   public void testSetMarkedRolledBack() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      tm.setRollbackOnly();
      try
      {
         local.set("Something");
         assertEquals("Something", local.get());
      }
      finally
      {
         tm.rollback();
      }
View Full Code Here

Examples of org.jboss.tm.TransactionLocal

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

Examples of org.jboss.tm.TransactionLocal

      tm.suspend();
   }
  
   public void testGetInitialAfterComplete() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      tm.begin();
      Transaction tx = tm.getTransaction();
      try
      {
         local.set("Something");
         assertEquals("Something", local.get());
      }
      finally
      {
         tx.commit();
      }
      assertEquals("Initial", local.get());
      tm.suspend();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.