Uploaded image for project: 'CDI TCK'
  1. CDI TCK
  2. CDITCK-203

InvocationContextTest:testGetTarget

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Rejected
    • 1.0.4.CR2
    • None
    • Tests
    • None
    • Compatibility/Configuration

    Description

      This test has a implementation-dependency on how interception is
      implemented (requires proxy implementation), but the proxy
      implementation is not mandated by the spec (and the EJB spec has always
      allowed both implementation methods.)

      The test calls SimpleBean.getId(), which is intercepted by Interceptor1.

      Interceptor1's aroundInvoke calls target.getId(), which is a circular
      reference for extension and only works for proxy-based interception:

      class SimpleBean {
      @Interceptors(Interceptor1.class)
      public int getId()

      { return id; }

      ...
      }

      class Interceptor1 {
      @AroundInvoke
      public Object aroundInvoke(InvocationContext ctx) throws Exception

      { SimpleBean target = (SimpleBean) ctx.getTarget(); int id1 = target.getId(); ... }

      }

      The only change needed to the test is to create a SimpleBean.getBareId()
      which is not an intercepted method.

      (Or, if the spec is re-interpreted to require a proxy implementation,
      there should be an explicit test for it, not an implicit dependency like
      this test.)

      Attachments

        Activity

          People

            rhn-engineering-jharting Jozef Hartinger
            ferg_jira Scott Ferguson (Inactive)
            Archiver:
            rhn-support-abdwived Abhishek Dwivedi (Inactive)

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty