Examples of TimerEntityHome


Examples of org.jboss.test.timer.interfaces.TimerEntityHome

    * @throws Exception Unexpected Exception indicating an error
    */
   public void testEntityBeanTimer()
      throws Exception
   {
      TimerEntityHome home = (TimerEntityHome) getEJBHome(TimerEntityHome.JNDI_NAME);
      TimerEntity entity = home.create(new Integer(111));
      entity.startTimer(SHORT_PERIOD);
      Thread.sleep(12 * SHORT_PERIOD);
      entity.stopTimer();
      int lCount = entity.getTimeoutCount();
      assertTrue("Timeout was expected to be called at least 10 times but was "
View Full Code Here

Examples of org.jboss.test.timer.interfaces.TimerEntityHome

    * @throws Exception Unexpected Exception indicating an error
    */
   public void testEntityBeanSingleTimer()
      throws Exception
   {
      TimerEntityHome home = (TimerEntityHome) getEJBHome(TimerEntityHome.JNDI_NAME);
      TimerEntity entity = home.create(new Integer(222));
      entity.startSingleTimer(SHORT_PERIOD);
      Thread.sleep(5 * SHORT_PERIOD);
      int lCount = entity.getTimeoutCount();
      assertTrue("Timeout was expected to be called only once but was called: "
         + lCount + " times",
View Full Code Here

Examples of org.jboss.test.timer.interfaces.TimerEntityHome

    */
   public void testSecuredEntityBeanTimer()
      throws Exception
   {
      login();
      TimerEntityHome home = (TimerEntityHome) getEJBHome(TimerEntityHome.SECURED_JNDI_NAME);
      TimerEntity entity = home.create(new Integer(111));
      entity.startTimer(SHORT_PERIOD);
      Thread.sleep(12 * SHORT_PERIOD);
      entity.stopTimer();
      int count = entity.getTimeoutCount();
      assertTrue("Timeout was expected to be called at least 10 times but was "
View Full Code Here

Examples of org.jboss.test.timer.interfaces.TimerEntityHome

    */
   public void testSecuredEntityBeanSingleTimer()
      throws Exception
   {
      login();
      TimerEntityHome home = (TimerEntityHome) getEJBHome(TimerEntityHome.SECURED_JNDI_NAME);
      TimerEntity entity = home.create(new Integer(222));
      entity.startSingleTimer(SHORT_PERIOD);
      Thread.sleep(5 * SHORT_PERIOD);
      int count = entity.getTimeoutCount();
      assertTrue("Timeout was expected to be called only once but was called: "
         + count + " times",
View Full Code Here

Examples of org.jboss.test.timer.interfaces.TimerEntityHome

    * @throws Exception Unexpected Exception indicating an error
    */
   public void testEntityBeanTimer()
      throws Exception
   {
      TimerEntityHome home = (TimerEntityHome) getEJBHome(TimerEntityHome.JNDI_NAME);
      TimerEntity entity = home.create(new Integer(111));
      entity.startTimer(SHORT_PERIOD);
      Thread.sleep(12 * SHORT_PERIOD);
      entity.stopTimer();
      int lCount = entity.getTimeoutCount();
      assertTrue("Timeout was expected to be called at least 10 times but was "
View Full Code Here

Examples of org.jboss.test.timer.interfaces.TimerEntityHome

    * @throws Exception Unexpected Exception indicating an error
    */
   public void testEntityBeanSingleTimer()
      throws Exception
   {
      TimerEntityHome home = (TimerEntityHome) getEJBHome(TimerEntityHome.JNDI_NAME);
      TimerEntity entity = home.create(new Integer(222));
      entity.startSingleTimer(SHORT_PERIOD);
      Thread.sleep(5 * SHORT_PERIOD);
      int lCount = entity.getTimeoutCount();
      assertTrue("Timeout was expected to be called only once but was called: "
         + lCount + " times",
View Full Code Here

Examples of org.jboss.test.txtimer.interfaces.TimerEntityHome

      // check that there are no timers persisted
      List timerHandles = pp.listTimerHandles();
      assertEquals("unexpected handle count", 0, timerHandles.size());

      InitialContext iniCtx = getInitialContext();
      TimerEntityHome home = (TimerEntityHome)iniCtx.lookup(TimerEntityHome.JNDI_NAME);
      TimerEntity entity = home.create(new Integer(1));
      try
      {
         entity.createTimer(500, 0, null);

         timerHandles = pp.listTimerHandles();
View Full Code Here

Examples of org.jboss.test.txtimer.interfaces.TimerEntityHome

      // check that there are no timers persisted
      List timerHandles = pp.listTimerHandles();
      assertEquals("unexpected handle count", 0, timerHandles.size());

      InitialContext iniCtx = getInitialContext();
      TimerEntityHome home = (TimerEntityHome)iniCtx.lookup(TimerEntityHome.JNDI_NAME);
      TimerEntity entity = home.create(new Integer(1));
      try
      {
         // insert a timer into the db
         ObjectName oname = ObjectNameFactory.create("jboss.j2ee:jndiName=test/txtimer/TimerEntity,service=EJB");
         TimedObjectId targetId = new TimedObjectId(oname, new Integer(1));
View Full Code Here

Examples of org.jboss.test.txtimer.interfaces.TimerEntityHome

    * Test that ejbTimeout is called
    */
   public void testSingleEventDuration() throws Exception
   {
      InitialContext iniCtx = getInitialContext();
      TimerEntityHome home = (TimerEntityHome) iniCtx.lookup(TimerEntityHome.JNDI_NAME);
      TimerEntity entity = home.create(new Integer(1));
      try
      {
         entity.createTimer(500, 0, null);
         sleep(1000);
         assertEquals("unexpected call count", 1, entity.getCallCount());
View Full Code Here

Examples of org.jboss.test.txtimer.interfaces.TimerEntityHome

    * Test that ejbTimeout is called once on each instance
    */
   public void testInstanceAsscociation() throws Exception
   {
      InitialContext iniCtx = getInitialContext();
      TimerEntityHome home = (TimerEntityHome) iniCtx.lookup(TimerEntityHome.JNDI_NAME);
      TimerEntity entity1 = home.create(new Integer(1));
      TimerEntity entity2 = home.create(new Integer(2));

      try
      {
         entity1.createTimer(500, 1000, null);
         entity2.createTimer(500, 1000, null);
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.