Package org.jboss.test.timer.interfaces

Examples of org.jboss.test.timer.interfaces.TimerSLSB.stopTimer()


      TimerSLSBHome home = (TimerSLSBHome) getEJBHome(TimerSLSBHome.JNDI_NAME);
      TimerSLSB bean = home.create();
      byte[] handle = bean.startTimer(SHORT_PERIOD);
      Thread.sleep(12 * SHORT_PERIOD + SHORT_PERIOD);
      int count = bean.getTimeoutCount(handle);
      bean.stopTimer(handle);
      assertTrue("Timeout was expected to be called at least 10 times but was "
         + "only called: " + count + " times",
         count >= 10);
      Thread.sleep(5 * SHORT_PERIOD);
      int count2 = bean.getTimeoutCount(handle);
View Full Code Here


      // Wait for 1 SHORT_PERIOD for the first firing
      // Another retryMs for the amount of time it takes for the retry to happen
      // and finally the amount of time that it takes to execute the task and 200ms to be safe.
      Thread.sleep(SHORT_PERIOD  + retryMs + taskTime + 200);
      int count = bean.getTimeoutCount(handle);
      bean.stopTimer(handle);
      assertEquals("Timeout was called too many times. Should have been once for the initial" +
            ", and once for the retry during the time allotted.",2,count);

      bean.remove();
   }
View Full Code Here

      assertTrue("Timeout was expected to be called only once but was called: "
         + lCount + " times",
         lCount == 1);
      try
      {
         bean.stopTimer(handle);
         fail("A single timer should expire after the first event and therefore this "
            + "has to throw an NoSuchObjectLocalException");
      }
      catch (RemoteException re)
      {
View Full Code Here

      assertTrue("Period until next event must be smaller than time until next even because it "
         + "it is called later", lUntilNextEvent > lTimeRemaining);
      assertTrue("Info("+info+") must be 'TimerSLSBean.startTimer'",
         "TimerSLSBean.startTimer".equals(info));
      assertTrue("Must be able to get a handle", handle != null);
      bean.stopTimer(handle);
   }

   /**
    * Test that a session that does not implement TimedObject cannot obtain
    * the TimerService from its EJBContext
View Full Code Here

      TimerSLSBHome home = (TimerSLSBHome) getEJBHome(TimerSLSBHome.JNDI_NAME);
      TimerSLSB bean = home.create();
      byte[] handle = bean.startTimer(SHORT_PERIOD);
      Thread.sleep(12 * SHORT_PERIOD + SHORT_PERIOD);
      int count = bean.getTimeoutCount(handle);
      bean.stopTimer(handle);
      assertTrue("Timeout was expected to be called at least 10 times but was "
         + "only called: " + count + " times",
         count >= 10);
      Thread.sleep(5 * SHORT_PERIOD);
      int count2 = bean.getTimeoutCount(handle);
View Full Code Here

      // Wait for 1 SHORT_PERIOD for the first firing
      // Another retryMs for the amount of time it takes for the retry to happen
      // and finally the amount of time that it takes to execute the task and 200ms to be safe.
      Thread.sleep(SHORT_PERIOD  + retryMs + taskTime + 200);
      int count = bean.getTimeoutCount(handle);
      bean.stopTimer(handle);
      assertEquals("Timeout was called too many times. Should have been once for the initial" +
            ", and once for the retry during the time allotted.",2,count);

      bean.remove();
   }
View Full Code Here

      assertTrue("Timeout was expected to be called only once but was called: "
         + lCount + " times",
         lCount == 1);
      try
      {
         bean.stopTimer(handle);
         fail("A single timer should expire after the first event and therefore this "
            + "has to throw an NoSuchObjectLocalException");
      }
      catch (RemoteException re)
      {
View Full Code Here

      assertTrue("Period until next event must be smaller than time until next even because it "
         + "it is called later", lUntilNextEvent > lTimeRemaining);
      assertTrue("Info("+info+") must be 'TimerSLSBean.startTimer'",
         "TimerSLSBean.startTimer".equals(info));
      assertTrue("Must be able to get a handle", handle != null);
      bean.stopTimer(handle);
   }

   /**
    * Test that a session that does not implement TimedObject cannot obtain
    * the TimerService from its EJBContext
View Full Code Here

      TimerSLSB bean = home.create();
      byte[] handle = bean.startTimer(SHORT_PERIOD);
      // Sleep for 20x the timer interval and expect at least 10 events
      Thread.sleep(20 * SHORT_PERIOD);
      int count = bean.getTimeoutCount(handle);
      bean.stopTimer(handle);
      assertTrue("Timeout was expected to be called at least 10 times but was "
         + "only called: " + count + " times",
         count >= 10);
      Thread.sleep(5 * SHORT_PERIOD);
      int count2 = bean.getTimeoutCount(handle);
View Full Code Here

      assertTrue("Timeout was expected to be called only once but was called: "
         + count + " times",
         count == 1);
      try
      {
         bean.stopTimer(handle);
         fail("A single timer should expire after the first event and therefore this "
            + "has to throw an NoSuchObjectLocalException");
      }
      catch (RemoteException re)
      {
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.