Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 31692 invoked from network); 17 Jun 2010 21:18:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Jun 2010 21:18:20 -0000 Received: (qmail 81415 invoked by uid 500); 17 Jun 2010 21:18:20 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 81375 invoked by uid 500); 17 Jun 2010 21:18:19 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 81367 invoked by uid 99); 17 Jun 2010 21:18:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jun 2010 21:18:19 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,HK_RANDOM_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jun 2010 21:18:14 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OPMTB-0001nk-Oj for users@activemq.apache.org; Thu, 17 Jun 2010 14:17:53 -0700 Message-ID: <28919788.post@talk.nabble.com> Date: Thu, 17 Jun 2010 14:17:53 -0700 (PDT) From: cmdr To: users@activemq.apache.org Subject: spring jms test MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: spcmdr@yahoo.fr Hi Can someone explain me the reason why this test failed @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:applicationContext.xml" }) public class SenderTest { @Autowired private JmsTemplate jmsTemplate; @Test public void testSend() throws JMSException { jmsTemplate.send ( new MessageCreator() { public Message createMessage(Session session) throws JMSException { return session.createTextMessage("hello"); } } ); Message message = jmsTemplate.receive(); if (message instanceof TextMessage) { TextMessage textMessage = (TextMessage) message; Assert.assertEquals("The message received is not the right one", "hello", textMessage.getText()); } else { Assert.assertNotNull("The message is null", message); Assert.fail("The message is not a text message"); } } } It fail with these activemq configurations vm://localhost?broker.persistent=false vm://localhost?broker.deleteAllMessagesOnStartup=true bu work with this configuration vm://localhost I need a clean queue for my junit test, what is the right what to achieve that Regards -- View this message in context: http://old.nabble.com/spring-jms-test-tp28919788p28919788.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.