final int count = 100;
final int count = 1000;
   public void testStressReceiveOnTopic() throws Exception   {      if (log.isTraceEnabled()) log.trace("testStressReceiveOnTopic");      final int count = 100;      consumerConnection.start();      new Thread(new Runnable()      {         public void run()         {            try            {               // this is needed to make sure the main thread has enough time to block               Thread.sleep(1000);               for (int i = 0; i < count; i++)               {                  Message m = producerSession.createMessage();                  topicProducer.send(m);               }            }            catch(Exception e)            {               log.error(e);            }         }      }, "ProducerTestThread").start();      int received = 0;      while(true)      {         Message m = topicConsumer.receive(1500);         if (m == null)         {            break;         }         //Thread.sleep(1000);         received++;      }      assertEquals(count, received);   }