Package org.jboss.test.hibernate.timers

Examples of org.jboss.test.hibernate.timers.Timers


         bean = home.create();

         int initialCount = bean.listTimers().size();

         TimersID id = new TimersID("testCurrentSession", "*:ejb=None");
         Timers timer = new Timers(id);
         Date now = new Date();
         Long interval = new Long(5*1000);
         Key key = new Key("key2", 123456789);
         Info info = new Info(System.getProperties());
         timer.setInitialDate(now);
         timer.setInstancePK(serialize(key));
         timer.setTimerInterval(interval);
         timer.setInfo(serialize(info));

         bean.persist(timer);
         log.info("Timers created with id = " + id);

         List timers = bean.listTimers();
         assertNotNull(timers);
         assertEquals("Incorrect result size", initialCount + 1, timers.size());

         Timers found = null;
         Iterator itr = timers.iterator();
         while (itr.hasNext())
         {
            Timers t = (Timers) itr.next();
            if (id.equals(t.getId()))
            {
               found = t;
            }
         }
         assertNotNull("Saved timer found in list", found);
View Full Code Here


         bean = home.create();

         int initialCount = bean.listTimers().size();

         TimersID id = new TimersID("testCurrentSession", "*:ejb=None");
         Timers timer = new Timers(id);
         Date now = new Date();
         Long interval = new Long(5*1000);
         Key key = new Key("key2", 123456789);
         Info info = new Info(System.getProperties());
         timer.setInitialDate(now);
         timer.setInstancePK(serialize(key));
         timer.setTimerInterval(interval);
         timer.setInfo(serialize(info));

         bean.persist(timer);
         log.info("Timers created with id = " + id);

         List timers = bean.listTimers();
         assertNotNull(timers);
         assertEquals("Incorrect result size", initialCount + 1, timers.size());

         Timers found = null;
         Iterator itr = timers.iterator();
         while (itr.hasNext())
         {
            Timers t = (Timers) itr.next();
            if (id.equals(t.getId()))
            {
               found = t;
            }
         }
         assertNotNull("Saved timer found in list", found);
View Full Code Here

TOP

Related Classes of org.jboss.test.hibernate.timers.Timers

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.