Thread.sleep(1000);
Thread.sleep(3000);
   public void testPersistentSendToTopic() throws Exception   {      Connection pconn = cf.createConnection();      Connection cconn = cf.createConnection();      try      {         Session ps = pconn.createSession(false, Session.AUTO_ACKNOWLEDGE);         Session cs = cconn.createSession(false, Session.AUTO_ACKNOWLEDGE);         final MessageProducer p = ps.createProducer(topic);         MessageConsumer c = cs.createConsumer(topic);         cconn.start();         final TextMessage m1 = ps.createTextMessage("test");         Thread t = 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);                  p.send(m1);               }               catch(Exception e)               {                  log.error(e);               }            }         }, "Producer Thread");         t.start();         TextMessage m2 = (TextMessage)c.receive(5000);         assertEquals(m2.getJMSMessageID(), m1.getJMSMessageID());         assertEquals("test", m2.getText());         t.join();      }      finally      {         pconn.close();         cconn.close();      }   }