Package org.hornetq.utils

Examples of org.hornetq.utils.ReusableLatch.await()


         {
            waiting = true;
            readyLatch.countDown();
            try
            {
               if (!latch.await(1000))
               {
                  ReusableLatchTest.log.error("Latch timed out!", new Exception("trace"));
               }
            }
            catch (Exception e)
View Full Code Here


      Assert.assertEquals(false, t.waiting);

      Assert.assertNull(t.e);

      Assert.assertTrue(latch.await(1000));

      Assert.assertEquals(0, latch.getCount());

      latch.countDown();
View Full Code Here

      ReusableLatch latch = new ReusableLatch();

      latch.countUp();

      long start = System.currentTimeMillis();
      Assert.assertFalse(latch.await(1000));
      long end = System.currentTimeMillis();

      Assert.assertTrue("Timeout didn't work correctly", end - start >= 1000 && end - start < 2000);
   }
}
View Full Code Here

      }

      consumer.setMessageListener(new MessageAckEven());

      assertTrue(latch.await(5000));

      session.close();

      session = conn.createSession(false, HornetQJMSConstants.INDIVIDUAL_ACKNOWLEDGE);
View Full Code Here

   {
      ReusableLatch latch = new ReusableLatch(1000);

      latch.countDown(5000);

      assertTrue(latch.await(1000));


      assertEquals(0, latch.getCount());
   }
View Full Code Here

         Assert.assertEquals(i, latch.getCount());
         latch.countDown();
         Assert.assertEquals(i - 1, latch.getCount());
      }

      latch.await();
   }

   /**
    *
    * This test will open numberOfThreads threads, and add numberOfAdds on the
View Full Code Here

         @Override
         public void run()
         {
            try
            {
               if (!latch.await(5000))
               {
                  ReusableLatchTest.log.error("Latch timed out");
               }
            }
            catch (Exception e)
View Full Code Here

         {
            waiting = true;
            readyLatch.countDown();
            try
            {
               if (!latch.await(1000))
               {
                  ReusableLatchTest.log.error("Latch timed out!", new Exception("trace"));
               }
            }
            catch (Exception e)
View Full Code Here

      Assert.assertEquals(false, t.waiting);

      Assert.assertNull(t.e);

      Assert.assertTrue(latch.await(1000));

      Assert.assertEquals(0, latch.getCount());

      latch.countDown();
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.