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 3B38B11D4B for ; Fri, 4 Apr 2014 02:25:51 +0000 (UTC) Received: (qmail 59719 invoked by uid 500); 4 Apr 2014 02:25:50 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 59679 invoked by uid 500); 4 Apr 2014 02:25:50 -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 Delivered-To: moderator for users@camel.apache.org Received: (qmail 41142 invoked by uid 99); 4 Apr 2014 02:11:07 -0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of gnanagurus@gmail.com does not designate 216.139.236.26 as permitted sender) Date: Thu, 3 Apr 2014 19:10:40 -0700 (PDT) From: Gnanaguru S To: users@camel.apache.org Message-ID: <1396577440852-5749750.post@n5.nabble.com> Subject: Unit testing each route in a large camel context MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Riders, I have a came context like the below one. I am going to do unit testing for each and every route. I am still wondering why no body has asked this question early. ( May be I didnt find it ) How can I do unit testing for each and every route ? Camel context: My current test strategy: 1. I have four different camelcontext xml's under my test resources 2. I have created four different test classes using JUnit ( Supported by camel) 3. If I take one route, I will mock the direct:B to mock:direct:B. 4. Apply assertions to the mock endpoints. Alternative test strategy: 1. Instead of creating four different XML's, I can just keep one camel context xml and add property placeholders. 2. By changing the endpoints in the property placeholers, so that I can logically disable the remaining routes. Because direct endpoints cannot have more than one consumer and mock endpoint cannot have consumer at all. But of all this, Is there any other simplied way to do the testing ? For large projects having large number of routes, Is there a way I can test individual routes from the same camelcontext files ? Instead of having multiple xml's. I will great appreciate your help. Also I am planning to develop an article based on this conversation. Please drop in your ideas and comments. Camel is a wonderful framework with wonderful test endpoint like Mock. Mock is very powerful in terms of asssertions, but wondering what are the other ways to utilize it well in large camel context. Cheers, Guru gnanaguru.com -- View this message in context: http://camel.465427.n5.nabble.com/Unit-testing-each-route-in-a-large-camel-context-tp5749750.html Sent from the Camel - Users mailing list archive at Nabble.com.