openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <strub...@yahoo.de>
Subject Re: Fwd: Support of Instance<> in OWB
Date Fri, 27 Dec 2013 16:45:50 GMT


Thanks John, we will investigate!

LieGrue,
strub




>________________________________
> From: John D. Ament <john.d.ament@gmail.com>
>To: user@openwebbeans.apache.org 
>Sent: Friday, 27 December 2013, 15:11
>Subject: Fwd: Support of Instance<> in OWB
> 
>
>Hi all,
>
>I'm cross-posting this from dev@deltaspike to see if anyone has any
>additional thoughts.
>
>
>
>---------- Forwarded message ----------
>From: John D. Ament <john.d.ament@gmail.com>
>Date: Thu, Dec 26, 2013 at 10:36 PM
>Subject: Support of Instance<> in OWB
>To: dev@deltaspike.apache.org
>
>
>Hi all
>
>I added a new test, FileResourceTest.  It fails in OWB, but passes in
>Weld.  AFAIK it's supposed to pass in both.
>
>The one catch I noticed, since it has a similar test
>ClasspathResourceTest, is that I'm using Instances/literals vs
>annotations.  I need to use Instance since the actual file name is
>dynamic at runtime.  In the test right now, I have this:
>
>    @Inject
>    @Any
>    private Instance<InputStream> inputStreamInst;
>
>    @Inject
>    @Any
>    private Instance<Properties> propsInst;
>
>and when I switch to this:
>
>    @Inject
>    @ExternalResource(storage =
>FileSystemStorage.class,location="/tmp/myconfig.properties")
>    private InputStream inputStream;
>
>    @Inject
>    @ExternalResource(storage =
>FileSystemStorage.class,location="/tmp/myconfig.properties")
>    private Properties props;
>
>The test works fine (assuming I create the file).  I don't typically
>play with OWB that much, but this should be the right format for
>Instances, right?  Feedback is much appreciated.
>
>Thanks,
>
>John
>
>
>

Mime
View raw message