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 4ABEF18B59 for ; Mon, 8 Feb 2016 15:19:20 +0000 (UTC) Received: (qmail 30813 invoked by uid 500); 8 Feb 2016 15:19:19 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 30765 invoked by uid 500); 8 Feb 2016 15:19:19 -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 30753 invoked by uid 99); 8 Feb 2016 15:19:18 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2016 15:19:18 +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 7108B1A03BA for ; Mon, 8 Feb 2016 15:19:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.593 X-Spam-Level: X-Spam-Status: No, score=0.593 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URI_HEX=1.313] 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-eu-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 HQ69DJ13he0f for ; Mon, 8 Feb 2016 15:19:16 +0000 (UTC) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 8DFFB31AFD for ; Mon, 8 Feb 2016 15:19:15 +0000 (UTC) Received: by mail-ob0-f177.google.com with SMTP id is5so155481461obc.0 for ; Mon, 08 Feb 2016 07:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pronoia-solutions-com.20150623.gappssmtp.com; s=20150623; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=YDISYMgltM/J+WlTxUgCWW8D0kwUkav5EnJ3gs0G1e8=; b=LsA+X7KjTGYtcQEFK/4pHQjeZb0XMU/HMkfzrPTVEN4vlblpZJEvZ4o8tWZ9h448Ll UHguLA7GmjWdazrHx9yvw+ZNNsnnTIBS7QJ/NSJLzyaIZ7jB3hibmgMBmx3y+wdgcbEs v4GwG1EPCnkKQJJLiaZ9mycExN73W3w9txb95wUhw+yLJdFTfSJ2NrliUI6yzw+yWBW2 bw+6Hpc0CTkawVEmbqqkrqSeQodGrwIXjoQGwIOnwZ3/lL9ZOqCZtaPuJrpdWZKpQdmt nQiO9vstPKDM+rCqgLLJ9Zv9wQS9bH2jHlzkWRuglZIW4Rz9A4iZ2F4RIg4j8eMHsKZS WCjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=YDISYMgltM/J+WlTxUgCWW8D0kwUkav5EnJ3gs0G1e8=; b=Xi7EtUVTBjYe40l/hgFAFRP2JtONGR09/1e1ce+CIF4SnaXqQx/tPJ8tMOHKGb6KyS /cYhal5WWFZ0FkPvRLBHcZKzsuLyHAqxFnl/lu91fLhDYRjvp25X1b0xEJHaCci0owAw xeXtqY/EFjAEHWfNIFZK8+bR9vT6+Z0g28y5k7sDlthFyvpOFCWD0/3FYmLXPvqtWASA G4TXKf61jjr1DEUUcHDM+A1TyCrK0HKdFky8/tdgKMvaQGJ1tLLVInVH05gD6qkMijGp cEkXWFdzLHGDaTsmQT3pvks1jLnJh4r0/W0OXLbltg5kqXygHA0hAany8z5jJ0Ac+h57 XsJg== X-Gm-Message-State: AG10YOQ8n02vj7OhbciWnOOOFF437Ps6vTgP7O67I++5op7haQb4mt3fFvW7ywdfcG4ZrA== X-Received: by 10.60.246.37 with SMTP id xt5mr26177988oec.72.1454944754138; Mon, 08 Feb 2016 07:19:14 -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 q8sm17549754oep.2.2016.02.08.07.19.13 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Feb 2016 07:19:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: CamelBlueprintTestSupport No bean could be found in the registry From: Quinn Stevenson In-Reply-To: Date: Mon, 8 Feb 2016 08:19:12 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1454625374017-5777244.post@n5.nabble.com> <1454634897755-5777248.post@n5.nabble.com> <1454690720095-5777297.post@n5.nabble.com> <1454697635261-5777308.post@n5.nabble.com> <66A6C5A2-5090-4470-94D7-E087EC6D0F24@pronoia-solutions.com> <1454711005899-5777315.post@n5.nabble.com> <01C38C2C-22D8-4A8A-BC00-82EAEE01A6B9@pronoia-solutions.com> <1454712801669-5777317.post@n5.nabble.com> To: users@camel.apache.org X-Mailer: Apple Mail (2.3112) I=E2=80=99m a little confused here - asService take the object = implementing the interface and the service property key/values - I=E2=80=99= m not sure how that could even work as an interface instead of the = implementation object. The service interface is provided earlier in the = call ( the key in services.put ), and I like having the string there as = well so I don=E2=80=99t have to add dependencies to my project all the = time (when I=E2=80=99m using OSGi classes that are provided by the = framework). That said, I=E2=80=99m always looking for ways to simplify tests - do = you have an idea on how this could work? Maybe you could do a prototype = that we could see? > On Feb 7, 2016, at 6:43 PM, Brad Johnson = wrote: >=20 > According > to my humble opinion, the asService() method should ideally have = Interface > instead of Implementation argument. >=20 > The asService is there to create a proxy to the actual implementation = class > I believe. What you are actually putting in the registry is a key of = the > value of the full package and class name of the interface. That's = what > blueprint is going to look up the service based upon. The value is = what > you put in as the implementation. >=20 > In a true blueprint environment that implementation will be hidden = behind a > proxy object that exposes the interface. Any bundle wanting to use = that > proxied implementation then just tells it what the package anc class = name > of the interface are. In other words, when that interface is fetched = from > the OSGi registry and handed to the requester, the requester doesn't = know > what concrete implementation it is talking to. It may be a test stub, = it > may be the actual implementation. In fact, if you try to then cast = that to > the concrete implementation of the class it will fail because what it = finds > is a proxy of the interface. This also makes it possible to hot swap > bundles at run time because the proxy stays the same but the = implementation > changes. >=20 > I'm still mystified why your test class wasn't picking up the service = from > your first bundle though. If you have have it exported and referenced = and > listed as a test dependency in your client bundle then it should be > automatically loaded up. One of those pieces sounds as if it is = missing. >=20 > @Override > protected void > addServicesOnStartup(Map> > services) { > services.put( MyServiceInterface.class.getName(), asService(new > StubServiceImplementation(), "implementation", "stub")); > } >=20 >=20 > On Fri, Feb 5, 2016 at 4:53 PM, enigma wrote: >=20 >> Thank you and Have a good weekend! :) >>=20 >>=20 >>=20 >> -- >> View this message in context: >> = http://camel.465427.n5.nabble.com/CamelBlueprintTestSupport-No-bean-could-= be-found-in-the-registry-tp5777228p5777317.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >>=20