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 3FE4B9A31 for ; Fri, 24 May 2013 04:18:57 +0000 (UTC) Received: (qmail 72884 invoked by uid 500); 24 May 2013 04:18:56 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 72585 invoked by uid 500); 24 May 2013 04:18:55 -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 72551 invoked by uid 99); 24 May 2013 04:18:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 04:18:54 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.223.180 as permitted sender) Received: from [209.85.223.180] (HELO mail-ie0-f180.google.com) (209.85.223.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 04:18:49 +0000 Received: by mail-ie0-f180.google.com with SMTP id ar20so11076308iec.11 for ; Thu, 23 May 2013 21:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=3jNWA19BC6B4RlePIfz8jH6zW8C2FGcS6Knm4p4CS5g=; b=1HLt4/zLlq37qo9mfOMBYSbFrbAQOw2OSwTkc17r0Iw3mouOhiFF/tnQ0DKI9MdvPs JxahSQkgAJyntdBzGHlLVhqA1H79WoIb5356OTex06MpBeIksWszJ7slLJPykFgb+xoj 3niZNaTgiCrAwoiw06cxOCWSj+Mj9QAnEfzNsw1LLIoEvcitVtS2D9zC7f2m+fYaNJLh WWKugYNuq1EqbRNdnN8qaMUYESeBEeXRKu8SMNYAONUqTU9mU4mlAa57L8e/OfKRZsFP OJ/RiffCz7hGKt8MC68N0734GcQNmzgU0XplK6oK2s2HFQcdWmvORC7j1qf1cY6wluMS 4uLQ== X-Received: by 10.50.87.71 with SMTP id v7mr6185002igz.29.1369369108238; Thu, 23 May 2013 21:18:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.60.103 with HTTP; Thu, 23 May 2013 21:18:08 -0700 (PDT) In-Reply-To: <1369332920649-5733041.post@n5.nabble.com> References: <1369332920649-5733041.post@n5.nabble.com> From: Claus Ibsen Date: Fri, 24 May 2013 06:18:08 +0200 Message-ID: Subject: Re: Why doesn't the stub component throw exceptions in tests To: "users@camel.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Read the javadoc API on the producer template and the methods you use, eg sendBody vs requestBody. eg its about InOnly vs InOut messaging style. The eips http://camel.apache.org/event-message.html http://camel.apache.org/request-reply.html On Thu, May 23, 2013 at 8:15 PM, dancerjohn wrote: > I am writing a test for my error handling. The route I am testing uses JMS > and therefore has URL properties that are not compatible with the direct > component. The way I have it set up is that I pass the following to the > Route Builder ("jms:queue:myqueue") and then it adds the additional URL > properties. In the test env I would like to be able to pass in something > like "direct:jmsInputChan" but this fails due to the URL properties not > working with direct. > > Then I found stub. I can pass in "stub:blahblah" and get the route set up > and tested no problem. However, if I set a configuration to throw an > exception in the route I don't get the exception out. > > Here is what I mean... I am using ProducerTemplate.sendBody to send in a > message. If this channel is a "direct:xyz" and an exception is thrown the > exception is logged by Camel and then thrown out of sendBody which means I > can catch the exception in my test or have the test fail because of the > exception. > > However, when the route starts with a stub and I cause the exception, Camel > logs the exception but it is NOT thrown out of sendBody. This makes it hard > to verify that the exception was not handled. > > It seems that stub should behave similar to direct in this regard. > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Why-doesn-t-the-stub-component-throw-exceptions-in-tests-tp5733041.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- www.camelone.org: The open source integration conference. Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen