[ 
https://issues.apache.org/jira/browse/TOMEE-4342?focusedWorklogId=920895&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-920895
 ]

ASF GitHub Bot logged work on TOMEE-4342:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/May/24 07:40
            Start Date: 26/May/24 07:40
    Worklog Time Spent: 10m 
      Work Description: rzo1 commented on PR #1167:
URL: https://github.com/apache/tomee/pull/1167#issuecomment-2132115318

   > Shouldnt it use injector if cdi is disabled and nothing else 
(owbinjector)? Can mean scanning is wrongly configured for tests no?
   
   We don't have a lot of tests with `@Application`and docs are sparse in that 
area, so might not get it correctly.
   
   Adding the actual test class to `@Classes` of the `@Application` will inject 
the `@Resource` into the test otherwise it seems, that` @Resource` is not 
scanned anywhere else (and the fallbacks only inject `@Inject` fields).
   
   Would that be the actual way to solve it with application composer? (If so, 
we just need to update the docs).




Issue Time Tracking
-------------------

    Worklog Id:     (was: 920895)
    Time Spent: 40m  (was: 0.5h)

> ApplicationComposer should inject declared custom resources into tests
> ----------------------------------------------------------------------
>
>                 Key: TOMEE-4342
>                 URL: https://issues.apache.org/jira/browse/TOMEE-4342
>             Project: TomEE
>          Issue Type: Improvement
>    Affects Versions: 10.0.0-M1, 9.1.3
>            Reporter: Martin Wiesner
>            Assignee: Richard Zowalla
>            Priority: Minor
>             Fix For: 10.0.0-M2
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Right now, {{ApplicationComposer}} driven tests (via 
> {{@RunWithApplicationComposer(mode = ExtensionMode.PER_JVM}}) do not inject 
> @Resource beans, declared via Properties in an {{@Application}} App class. 
> Those Resouce instances (carrying custom config values) are, however, 
> injected correctly into EJBs or into the App itself.
> Interestingly, such resources are injected perfectly fine if the Test is run 
> via {{@RunWithEjbContainer}}.
> The improvement will enhance ApplicationComposer to act exactly the same as 
> tests driven by @RunWithEjbContainer, with respect to handling resource 
> injections.
> A reproducer examples is available here: 
> [https://github.com/rzo1/ac-app|https://github.com/rzo1/ac-app]
> It demonstrates the scenario and shows that 10.0-M1 is affected. 
> An enhancement on 10.0-M2-SNAPSHOT  is ready on a local basis to cure the 
> pain. I've assigned @rzo1, as he will provide the patch.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to