[arquillian-issues] [JBoss JIRA] (ARQ-2107) ResourceInjectionEnricher doesn't consult the @Resource(lookup = "...") value

Ladislav Thon (JIRA) issues at jboss.org
Wed Dec 6 03:27:00 EST 2017


    [ https://issues.jboss.org/browse/ARQ-2107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497707#comment-13497707 ] 

Ladislav Thon commented on ARQ-2107:
------------------------------------

Just FYI, since this happened in WildFly Swarm, there's now a test in WildFly Swarm, see SWARM-1713.

> ResourceInjectionEnricher doesn't consult the @Resource(lookup = "...") value
> -----------------------------------------------------------------------------
>
>                 Key: ARQ-2107
>                 URL: https://issues.jboss.org/browse/ARQ-2107
>             Project: Arquillian
>          Issue Type: Bug
>          Components: Runtime Enricher SPI
>    Affects Versions: 1.1.13.Final
>            Reporter: Ladislav Thon
>             Fix For: 1.1.14.Final
>
>
> The {{ResourceInjectionEnricher}} supports injecting the test instance fields annotated with {{javax.annotation.Resource}}. However, looking at the {{ResourceInjectionEnricher.getResourceName}} method, it only consults the annotation's {{name}} and {{mappedName}} attributes, falling back to some default afterward. The annotation's {{lookup}} attribute isn't considered at all. This might be because the {{lookup}} attribute was only added in Java EE 6 / Java SE 7, and Arquillian still supports Java 6, but that can be solved with a little bit of reflection.
> I don't know if this omission was intentional or not, but it could have easily gone unnoticed for a long while, because if CDI is present, the {{CDIInjectionEnricher}} will inject such field. However, CDI doesn't necessarily have to be present -- for example with WildFly Swarm.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the arquillian-issues mailing list