Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-4342

ApplicationComposer should inject declared custom resources into tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.0.0-M1, 9.1.3
    • 10.0.0-M2, 10.0.0
    • None
    • None

    Description

      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
      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.

      Attachments

        Issue Links

          Activity

            People

              rzo1 Richard Zowalla
              mawiesne Martin Wiesner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h