Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7DD2718E91 for ; Thu, 14 Jan 2016 15:42:20 +0000 (UTC) Received: (qmail 98025 invoked by uid 500); 14 Jan 2016 15:42:20 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 97996 invoked by uid 500); 14 Jan 2016 15:42:20 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 97982 invoked by uid 99); 14 Jan 2016 15:42:19 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2016 15:42:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 46DEE1A0018 for ; Thu, 14 Jan 2016 15:42:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4 X-Spam-Level: **** X-Spam-Status: No, score=4 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=3, KAM_LIVE=1, RCVD_IN_MSPIKE_H2=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=pronoia-solutions-com.20150623.gappssmtp.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id rbf-cPHHrhfO for ; Thu, 14 Jan 2016 15:42:07 +0000 (UTC) Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com [209.85.214.176]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 607D720506 for ; Thu, 14 Jan 2016 15:42:07 +0000 (UTC) Received: by mail-ob0-f176.google.com with SMTP id py5so118343758obc.2 for ; Thu, 14 Jan 2016 07:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pronoia-solutions-com.20150623.gappssmtp.com; s=20150623; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=oQBKum6EL+Dff/7RIEP2m9LjPuIMYCuxnFsaOK0Hy7Q=; b=qSzJv6z0V/nOqBXdsRbr6BeakamgidfSkG6JxkHszRQh0CEY4IM8KBWtHNxcGNfzJ7 c/TYz6sdReUXsyx7cQgfs+zQThiHwxsTLEPbnKR9LF9ji5VplHUJg1ema0Qt4pS13Y0P gmVnmDd6O9iF/HT7VhkhhyNEHnZ7oIwpSvI7maeeBKWXiZ8J4muHZius3qHwt4KxX1d9 nHBCTnJFivQTFZO2BfJyC8oB+gOLR2F9AGDwHmM/u/AwSfZM8PW2KKgOPmoG4x2VcQNq k9yT/KQD2r9lRqtCFo11ygra1p0fBEnQsEfMKZP+1X3Hqu64FsBrZ1IpgyAK/B67Mr3h K6Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:message-id:mime-version :subject:date:references:to:in-reply-to; bh=oQBKum6EL+Dff/7RIEP2m9LjPuIMYCuxnFsaOK0Hy7Q=; b=cCDW2cpmHX0vFukuSbewWAga11hhjF9fjQwsTyrdl6ni8eYCDjLbVLjJa0bDbSTsdC drmd4azBNK8IpBWdmURK0NZRZo66KlIptB34ItMBTD8yVhPoFaJkjCc8kRhtKFB12LVg 4v1DMYUjWXJ48K2LzkcZkalHxRKp+igkP1uxLVoY+lLY6z3qSmMOGwUH0uxD+5jdD+x9 N+WRpzBxQcfPLv+/Ny9CG1uL13GruV6P05AwpVyDWhYbqPMw7YMuyK/ak5OZqHGH+NXr hkhUkKIVs5lj0X/8T15UdFrgb52YsXofqsA8gRKTSelanDW3cUkxHMudQUpp7W2dbKWI IDjg== X-Gm-Message-State: ALoCoQkd0TD/yvpMu6hSnKGqSfaFAOmNwmGxAH2Hk9KiX+Zc13TpAJeO0JcUZvUU5ZE3T8cwWQ1xUub7cnP+NttWIXN7lNAYlg== X-Received: by 10.60.74.100 with SMTP id s4mr3988359oev.36.1452786126472; Thu, 14 Jan 2016 07:42:06 -0800 (PST) Received: from macpro.pronoia.local (c-24-10-239-245.hsd1.ut.comcast.net. [24.10.239.245]) by smtp.gmail.com with ESMTPSA id gi5sm3731359obb.6.2016.01.14.07.42.05 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 07:42:05 -0800 (PST) From: Quinn Stevenson Content-Type: multipart/alternative; boundary="Apple-Mail=_1E4C3594-C991-4A7E-82F1-445141A97EFA" Message-Id: <49D520D7-5580-4480-8C13-DD3DC73F0566@pronoia-solutions.com> Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: Potential Bug in CamelBlueprintTestSupport Date: Thu, 14 Jan 2016 08:42:00 -0700 References: <92F068F3-5964-4446-9F0D-D08980C342EB@pronoia-solutions.com> To: dev@camel.apache.org In-Reply-To: X-Mailer: Apple Mail (2.3112) --Apple-Mail=_1E4C3594-C991-4A7E-82F1-445141A97EFA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Grzegorz - So is this a bug? It seems like it is to me, but I don=E2=80=99t want = to waste anybody=E2=80=99s time with the JIRA if it isn=E2=80=99t and = I=E2=80=99m just doing something stupid. Quinn Stevenson > On Jan 6, 2016, at 3:30 PM, Quinn Stevenson = wrote: >=20 > I just re-ran the test against several versions of Camel and I=E2=80=99v= e updated the POM in the unit test with the results. >=20 > To summarize: > - When the blueprint.xml is in src/test/resources/OSGI-INF/blueprint - > these versions work > - 2.17-SNAPSHOT > - 2.16.1 > - 2.16.0 > - 2.15.5 > - 2.15.4 > and these versions fail > - 2.15.3 > - 2.15.2 > - 2.15.1 > - 2.15.0 > - 2.14.4 > - 2.14.3 > - 2.14.2 > - 2.14.1 > - 2.14.0 > - When the blueprint.xml is in src/main/resources/OSGI-INF/blueprint - > these versions were tested and all failed > - 2.17-SNAPSHOT > - 2.16.1 > - 2.16.0 > - 2.15.5 > - 2.15.4 >=20 > Here is the blueprint I=E2=80=99m using >=20 > " > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance = " > = xmlns:cm=3D"http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 = " > xsi:schemaLocation=3D" > = http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 = = http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd = > http://www.osgi.org/xmlns/blueprint/v1.0.0 = = http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd = "> >=20 > > > > > > > > >=20 > > = > > > >=20 > "> >=20 > > > > > > > >=20 > >=20 > >=20 > And here is the JUnit test >=20 > public class ConfigAdminLoadConfigurationFileAndOverrideTest extends = CamelBlueprintTestSupport { >=20 > @Override > protected String getBlueprintDescriptor() { > // which blueprint XML file to use for this test > // If this file is in src/main/resources/OSGI-INF/blueprint, the = test will fail most of the time > // If this file is in src/test/resources/OSGI-INF/blueprint, the = test passes > return "/OSGI-INF/blueprint/configadmin-loadfileoverride.xml"; > } >=20 > @Override > protected String[] loadConfigAdminConfigurationFile() { > // which .cfg file to use, and the name of the persistence-id > return new String[]{"src/test/resources/etc/stuff.cfg", = "stuff"}; > } >=20 > @Override > protected String useOverridePropertiesWithConfigAdmin(Dictionary = props) throws Exception { > // override / add extra properties > props.put("destination", "mock:extra"); >=20 > // return the persistence-id to use > return "stuff"; > } >=20 > @Test > public void testConfigAdmin() throws Exception { > // mock:original comes from = / > getMockEndpoint("mock:original").setExpectedMessageCount(0); > // mock:result comes from loadConfigAdminConfigurationFile() > getMockEndpoint("mock:result").setExpectedMessageCount(0); > // mock:extra comes from = useOverridePropertiesWithConfigAdmin() > getMockEndpoint("mock:extra").expectedBodiesReceived("Bye = World", "Yay Bye WorldYay Bye World"); >=20 > template.sendBody("direct:start", "World"); >=20 > assertMockEndpointsSatisfied(); > } >=20 > } >=20 >=20 > Quinn Stevenson > quinn@pronoia-solutions.com > (801) 244-7758 >=20 >=20 >=20 >> On Jan 6, 2016, at 2:35 PM, Quinn Stevenson = > = wrote: >>=20 >> Hi Grzegorz - >>=20 >> Thank you for the link - I=E2=80=99ve read through it many times - it = is very very helpful. =46rom what I understand, this should work - the = location of the blueprint file shouldn=E2=80=99t effect the way the test = runs, should it? Maybe I=E2=80=99m missing something simple. >>=20 >> It looks like my unit test attachment didn=E2=80=99t come through. = Sorry - I didn=E2=80=99t think about the mailing list filtering out = attachments. You can get to the test here = https://github.com/hqstevenson/camel-blueprint-test-properties.git = =20 >>=20 >> I've been testing this primary against 2.17-SNAPSHOT, but I=E2=80=99ve = tested against several versions. The POM for the unit test has the = versions listed that I tested, but I was messing with the test a little = so I=E2=80=99m not sure the list is completely accurate. I=E2=80=99ll = verify those and update the POM if needed. >>=20 >> Quinn Stevenson >>=20 >>=20 >>> On Jan 6, 2016, at 12:21 PM, Grzegorz Grzybek > wrote: >>>=20 >>> Hello Quinn >>>=20 >>> What Camel version do you use? I wrote a thorough explanation of >>> CamelTestBlueprint and the changes we've made to how tests are >>> performed and synchronized. >>> Here: = http://ggrzybek.blogspot.com/2015/12/camel-blueprint-test-support.html = >>> You can find there links to JIRA issues describing exactly the same >>> problems you have with `update-strategy=3D"reload"`. >>>=20 >>> best regards >>> Grzegorz Grzybek >>>=20 >>> 2016-01-06 19:16 GMT+01:00 Quinn Stevenson = >: >>>> I=E2=80=99ve encountered an issue, but I=E2=80=99m not sure if this = is a bug or a user error. >>>>=20 >>>> I=E2=80=99m trying to write some tests using = CamelBlueprintTestSupport for bundles where the blueprint file is in = src/main/resources/OSGI-INF/blueprint. However, I=E2=80=99m getting = random failures in the test on startup. >>>>=20 >>>> I=E2=80=99ve narrowed it down to using update-strategy =3D = =E2=80=9Creload=E2=80=9D and overriding properties in the test. The = tests fail (most of the time) when the actual blueprint file is in = src/main/resources/OSGI-INF/blueprint. Even when the test doesn=E2=80=99t= fail, you=E2=80=99ll see multiple camel contexts get created during the = test, while the test this is based on from camel-test-blueprint only = creates two camel contexts. >>>>=20 >>>> However, if I move the blueprint file to = src/test/resources/OSGI-INF/blueprint, the test passes. >>>>=20 >>>> Since I need the blueprint packaged in the bundle in = OSGI-INF/blueprint, I can=E2=80=99t move the blueprint file to the = src/test/=E2=80=A6 area. >>>>=20 >>>> Is there another way I should be testing this sort of thing? >>>>=20 >>>> I=E2=80=99ve created a unit test based on the = ConfigAdminLoadConfigurationFileAndOverrideTest from the = camel-test-blueprint module that demonstrates the issue. >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> Quinn Stevenson >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>=20 >=20 --Apple-Mail=_1E4C3594-C991-4A7E-82F1-445141A97EFA--