Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1954

Arquillian tests don't fail immediately if Test cannot be enriched

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.5.1
    • Fix Version/s: 4.5.1
    • Component/s: arquillian
    • Labels:
      None
    • Environment:
      n/a

      Description

      Injecting ABC -> Test

      Example #1:
      ABC has a field that uses a custom qualifier and the field's values are created/injected via javax.enterprise.inject.spi.Extension and javax.enterprise.inject.spi.Bean#create(CreationalContext<?> ctx). The create() op threw a CreationException (on purpose).

      Actual Results:
      1. Nothing is logged (because exception is swallowed by org.apache.openejb.arquillian.common.enrichment.OpenEJBEnricher)
      2. ABC is null in Test, test runs and later fails due to a NullPointerException when Test accesses ABC

      Expected Results:
      1. Reason for creation failure is logged
      2. Test fails on enrichment because ABC cannot be injected into Test. No tests are executed.

      Example #2:
      There is a RuntimeException in a @PostConstruct on ABC.

      Actual Results:
      1. Error gets logged because of org.apache.webbeans.component.AbstractInjectionTargetBean#postConstructDefault(...)
      2. ABC is null in Test, test runs and later fails due to a NullPointerException when Test accesses ABC

      Expected Results:
      1. Test fails on enrichment because ABC cannot be injected into Test. No tests are executed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              amoebaworks Trevor Baker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: