Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5935347C6 for ; Tue, 31 May 2011 03:22:28 +0000 (UTC) Received: (qmail 38666 invoked by uid 500); 31 May 2011 03:22:27 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 38600 invoked by uid 500); 31 May 2011 03:22:27 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 38592 invoked by uid 99); 31 May 2011 03:22:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 03:22:25 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 03:22:19 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QRFWo-00070W-0n for users@camel.apache.org; Mon, 30 May 2011 20:21:58 -0700 Date: Mon, 30 May 2011 20:21:58 -0700 (PDT) From: boday To: users@camel.apache.org Message-ID: <1306812118018-4440861.post@n5.nabble.com> In-Reply-To: <1306741897816-4438580.post@n5.nabble.com> References: <1306741897816-4438580.post@n5.nabble.com> Subject: Re: Unit test camel with activeMQ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org take a look at the camel-jms unit tests. they should get you started with setting up AMQ and asserting message flow, etc... here is a good one to start with... https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java hbellat wrote: > > Hello, > > I used Junit for java program but I need some examples to understand how > it works in camel with activeMQ > > I wrote a simple camel.xml as follow : > > > > > > > > > > and MyBean.java is : > > public class MyBean { > > > public void route(Exchange message){ > > String name = message.getIn().getBody(String.class); > > name="test"; > > message.getOut().setBody(name); > } > } > > In my route I send any string like "my unit Test", this string received by > the bean and affecte "test" in my String and route it to activemq:finish. > > How can I write a unit test for that simple code ? > > In my test I was wondring if my activemq must be started ? > > I will appreciate your help. > ----- Ben O'Day IT Consultant -http://benoday.blogspot.com -- View this message in context: http://camel.465427.n5.nabble.com/Unit-test-camel-with-activeMQ-tp4438580p4440861.html Sent from the Camel - Users mailing list archive at Nabble.com.