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 F0C189F7C for ; Mon, 25 Jun 2012 07:39:50 +0000 (UTC) Received: (qmail 11538 invoked by uid 500); 25 Jun 2012 07:39:50 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 11501 invoked by uid 500); 25 Jun 2012 07:39: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 72908 invoked by uid 99); 25 Jun 2012 07:21:46 -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 (athena.apache.org: local policy) Date: Mon, 25 Jun 2012 00:21:19 -0700 (PDT) From: Hilde To: users@camel.apache.org Message-ID: <1340608879272-5715014.post@n5.nabble.com> Subject: Testing routes: Get route definition by id gets null MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello folks! When I test a existing route i prefer to work with AdviceWith. However it is not possible to get the Route Definition over the ID, but also only via the index in the collection. That way however is bad for readability. That doesn't work: @Test public void testMainRoutePass() throws Exception { context.getRouteDefinition("dkflsd").adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() throws Exception { weaveAddLast().to("mock:mainRoute"); } }); ... But that works instead: @Test public void testMainRoutePass() throws Exception { context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() throws Exception { weaveAddLast().to("mock:mainRoute"); } }); ... Here comes the camel-context.xml: ... Could you help me? Cheers Hilde -- View this message in context: http://camel.465427.n5.nabble.com/Testing-routes-Get-route-definition-by-id-gets-null-tp5715014.html Sent from the Camel - Users mailing list archive at Nabble.com.