Examples of ALocal


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

      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.ALocal

   {
      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.ALocal

      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.ALocal

   {
      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.jdbc2pm.ejbstore.ejb.ALocal

   // Tests

   public void testMain() throws Throwable
   {
      ALocal a = getALocalHome().findByPrimaryKey(new Long(1));
      int storeCount = a.getStoreCount().intValue();
      a.setIntField(new Integer(a.getIntField().intValue() + 1));
      assertEquals(storeCount + 1, a.getStoreCount().intValue());     
   }
View Full Code Here

Examples of org.jboss.test.cmp2.jdbc2pm.ejbstore.ejb.ALocal

   }

   public void testCorrectView() throws Throwable
   {
      BLocal b = getBLocalHome().create(new Long(11), "test");
      ALocal a = getALocalHome().findByPrimaryKey(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.