Examples of ALocalHome


Examples of org.jboss.test.cmp2.ejbselect.ALocalHome

      String id = "a1";

      try
      {
         beginTx();
         ALocalHome ah = AUtil.getLocalHome();
         ALocal a = ah.create(id);
         a.setIntField(1);
         commitTx();
         long lastUpdated = System.currentTimeMillis();

         checkAge(lastUpdated);
         assertValue(id, 1);

         checkAge(lastUpdated);
         jdbcUpdate(id, 2);

         checkAge(lastUpdated);
         assertValue(id, 1);

         sleepUntilEvicted();
         long lastEvicted = cacheListener.lastEvicted;
         assertValue(id, 2);

         // test ejb update
         try
         {
            Thread.sleep(1000);
         }
         catch(InterruptedException e)
         {
            e.printStackTrace();
         }

         beginTx();
         a = ah.findByPrimaryKey(id);
         a.setIntField(3);
         commitTx();

         sleepUntilEvicted();
         assertTrue(cacheListener.lastEvicted - lastEvicted >= maxAgeMs + 1000);
View Full Code Here

Examples of org.jboss.test.cmp2.ejbselect.ALocalHome

   private void assertValue(String id, int value) throws Exception
   {
      beginTx();
      try
      {
         ALocalHome ah = AUtil.getLocalHome();
         ALocal a = ah.findByPrimaryKey(id);
         assertEquals(value, a.getIntField());
      }
      finally
      {
         commitTx();
View Full Code Here

Examples of org.jboss.test.cmp2.ejbselect.ALocalHome

      String id = "a1";

      try
      {
         beginTx();
         ALocalHome ah = AUtil.getLocalHome();
         ALocal a = ah.create(id);
         a.setIntField(1);
         commitTx();
         long lastUpdated = System.currentTimeMillis();

         checkAge(lastUpdated);
         assertValue(id, 1);

         checkAge(lastUpdated);
         jdbcUpdate(id, 2);

         checkAge(lastUpdated);
         assertValue(id, 1);

         sleepUntilEvicted();
         long lastEvicted = cacheListener.lastEvicted;
         assertValue(id, 2);

         // test ejb update
         try
         {
            Thread.sleep(1000);
         }
         catch(InterruptedException e)
         {
            e.printStackTrace();
         }

         beginTx();
         a = ah.findByPrimaryKey(id);
         a.setIntField(3);
         commitTx();

         sleepUntilEvicted();
         assertTrue(cacheListener.lastEvicted - lastEvicted >= maxAgeMs + 1000);
View Full Code Here

Examples of org.jboss.test.cmp2.ejbselect.ALocalHome

   private void assertValue(String id, int value) throws Exception
   {
      beginTx();
      try
      {
         ALocalHome ah = AUtil.getLocalHome();
         ALocal a = ah.findByPrimaryKey(id);
         assertEquals(value, a.getIntField());
      }
      finally
      {
         commitTx();
View Full Code Here

Examples of org.jboss.test.entitydepends.ejb.ALocalHome

   extends ServiceMBeanSupport
   implements MyServiceMBean
{
   public void startService() throws Exception
   {
      ALocalHome ah = (ALocalHome)new InitialContext().lookup("ALocal");
      ah.create(new Long(1), "test");
      ah.remove(new Long(1));
   }
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.