Return-Path: X-Original-To: apmail-deltaspike-users-archive@www.apache.org Delivered-To: apmail-deltaspike-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 6BDEFF098 for ; Fri, 14 Nov 2014 15:32:44 +0000 (UTC) Received: (qmail 67826 invoked by uid 500); 14 Nov 2014 15:32:44 -0000 Delivered-To: apmail-deltaspike-users-archive@deltaspike.apache.org Received: (qmail 67789 invoked by uid 500); 14 Nov 2014 15:32:44 -0000 Mailing-List: contact users-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@deltaspike.apache.org Delivered-To: mailing list users@deltaspike.apache.org Received: (qmail 67777 invoked by uid 99); 14 Nov 2014 15:32:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2014 15:32:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of deven.phillips@gmail.com designates 209.85.223.181 as permitted sender) Received: from [209.85.223.181] (HELO mail-ie0-f181.google.com) (209.85.223.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2014 15:32:39 +0000 Received: by mail-ie0-f181.google.com with SMTP id rp18so18113274iec.12 for ; Fri, 14 Nov 2014 07:30:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=s0JsE9DFz+SkQXVTACHvmXdme9EnCk0rCf/2NovggOU=; b=ZE1+cLnvcFTSmoTYH6yCuoT1qO17q7ucVZb2QE6NEea7zliUbAf6Jwe3mNAFeZ4Tvj 7i4st4v+O+vSGEFoYhICOlaZ0iME+8pfR0YlxLTbUgYXGc/1FfvEYsvkmtpzRtqtjuNd pMF2VFH1CloZSHysztKDheVCwEgpvG1vSCCbip7iF0wBgum6hzQt4UvtIT9nEXAJGTj7 B/ixISXKghXkWBOrUoNG+b6S54VjVSUoMrp8BsSJyCamLX5TXjU1N34fhXdyo1LsPAa3 C9DKq1vngF8oNZMD9ngDhxrhQNNEsqBHMha+z3JXtKiaplitXczN1YC7qKhiVLg0MGsD WERg== MIME-Version: 1.0 X-Received: by 10.42.64.143 with SMTP id g15mr2579110ici.59.1415979048964; Fri, 14 Nov 2014 07:30:48 -0800 (PST) Received: by 10.107.43.151 with HTTP; Fri, 14 Nov 2014 07:30:48 -0800 (PST) In-Reply-To: References: Date: Fri, 14 Nov 2014 10:30:48 -0500 Message-ID: Subject: Re: Jetty/WebSockets With DeltaSpike From: Deven Phillips To: users@deltaspike.apache.org Content-Type: multipart/alternative; boundary=90e6ba6141c0391ab80507d35012 X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba6141c0391ab80507d35012 Content-Type: text/plain; charset=UTF-8 So, to get to the real meat of the matter: IF I use BeanProvider to inject an instance, how would I mock that instance in my unit tests? For example: AbstractSocketHandler handlerInstance = > BeanProvider.injectFields(HandlerImpl.class.newInstance()); How would I mock that instance so that I can properly unit test without having to build lots of crazy things? Thanks again!! Deven On Fri, Nov 14, 2014 at 9:47 AM, Gerhard Petracek < gerhard.petracek@gmail.com> wrote: > hi deven, > > it depends on details you haven't provided. > however, in any case you can use BeanProvider#injectFields to fill > injection points of any instance which isn't managed by the cdi-container. > > regards, > gerhard > > http://www.irian.at > > Your JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache > MyFaces, DeltaSpike and OpenWebBeans > > > > 2014-11-14 15:32 GMT+01:00 Deven Phillips : > > > Hi all, > > > > New to DeltaSpike (coming from Guice) and I am trying to migrate my > > Jetty websocket implementation to DeltaSpike, but I would like some help > > figuring out how to properly inject my JSR-356 annotated object into the > > WebSocketCreator class. I have created an abstract AbstractSocketHandler > > which both of my implementation inherit from. So, in my project, if I > have > > a class which @Produces an instance of that, does anyone know if the > Jetty > > implementation will inject it into the appropriate places? Or will I have > > to manually use BeanManager to accomplish the injections? > > > > Thanks in advance for any help!! > > > > Deven Phillips > > > --90e6ba6141c0391ab80507d35012--