{  log.trace("Starting testBrowse()");  Connection conn = cf.createConnection(); Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);  MessageProducer mp = sess.createProducer(queue);
{
	   public void testBrowse() throws Exception	   {						log.trace("Starting testBrowse()");										      Connection conn = cf.createConnection();      	      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);	      	      MessageProducer mp = sess.createProducer(queue);		  		  					final int numMessages = 100;		  			for (int i = 0; i < numMessages; i++)			{				Message m = sess.createMessage();				mp.send(m);			}  			log.trace("Sent messages");		  		  			long lStart = System.currentTimeMillis();		  		 		  		   QueueBrowser browser = sess.createBrowser(queue);		  		   assertEquals(browser.getQueue(), queue);		  		   assertNull(browser.getMessageSelector());		  		   Enumeration en = browser.getEnumeration();		  			  		   int count = 0;		   while (en.hasMoreElements())		   {				Message m = (Message)en.nextElement();			 				count++;		   }		  			assertEquals(count, numMessages);						MessageConsumer mc = sess.createConsumer(queue);						conn.start();						for (int i = 0; i < numMessages; i++)			{				Message m = mc.receive();			}						browser = sess.createBrowser(queue);			en = browser.getEnumeration();									count = 0;			while (en.hasMoreElements())			{				Message mess = (Message)en.nextElement();				log.trace("message:" + mess);				count++;			}						log.trace("Received " + count + " messages");			  			conn.close();	   }