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

Issues in testGetStereotypesCalled and testIsNullableCalled


    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0.0.GA
    • Fix Version/s: 1.0.1.CR1, 1.1.0.Alpha1
    • Component/s: Tests
    • Labels:
    • Environment:

      JDK 6 u15, Snow Leopard, GlassFish v3 b72, CDI TCK 1.0.1 RC1


      The following tests in CDI TCK 1.0.1 RC1 are failing on GlassFish v3. the tests seem to be invalid. See below:


      the first one testGetStereotypesCalled is supposed to be set during called to Bean.getStereotypes(), and its never called. Same applies for testIsNullableCalled, which is supposed to return true when Bean.isNullable() is called, but is never called.

      jsr 299 spec in 5.1.1 lays out this requirement for custom beans:

      For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls isAlternative() to determine whether the bean is an alternative, and getBeanClass() and getStereotypes() to determ- ine whether an alternative is selected in a certain bean archive.

      In this test case, isAlternative() returns false, and correctly so because the associated beans.xml does not define any alternative beans or there is no @Alternative in the bean. This is defined in sec 5.1.1 and 11.1.

      According to Bean.isNullable() returns true only if the Bean.create(), here CatBean.create() sometimes return null. In this case it never

      public Cat create(CreationalContext<Cat> creationalContext)

      { return new Cat("kitty"); }

      So in my investigation both these assertions testGetStereotypesCalled() and testIsNullableCalled() are invalid.

        Gliffy Diagrams




              • Assignee:
                jharting Jozef Hartinger
                vivekp Vive Pandey
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: