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

Issue with org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ContainerEventTest

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.1.CR1, 1.1.0.Alpha1
    • 1.0.0.GA
    • Tests
    • None
    • JDK 6 u15, GlassFish v3 b72, CDI TCK 1.0.1 RC1

      org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.TestFilter
      --------------------------------------------------------------------------------------------------------------------
      public class TestFilter implements Filter
      {

      @Inject
      private Sheep sheep;
      private boolean injectionPerformedCorrectly = false;
      private boolean initializerCalled = false;
      private boolean initCalledAfterInitializer = false;

      @Inject
      public void initialize(Sheep sheep) {}

      public void destroy(){}

      public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException{}

      public void init(FilterConfig filterConfig) throws ServletException{}
      }

      AnnotatedType
      -------------------------
      AnnotatedType extends Annotated {
      /**

      • Get the business methods belonging to the class.
        *
      • @return the methods, or an empty set if none are defined
        */
        public Set<AnnotatedMethod<? super X>> getMethods();

      /**

      • Get the fields belonging to the class
        *
      • @return the fields, or an empty set if none are defined
        */
        public Set<AnnotatedField<? super X>> getFields();
        }

      ContainerEventTest.java
      -----------------------------------------

      private void validateFilterAnnotatedType(AnnotatedType<TestFilter> type)

      { assert type.getFields().size() == 2; assert type.getMethods().size() == 3; }
      • The javadoc is not clear what getMethods() and getFields() supposed to return. Do they supposed to return all methods and fields or only with @Inject annotation ? Either way, the number of fields should be 4 or 1. So the assertion doesn't seem correct to me.

      Other testcases affected are:
      testProcessAnnotatedTypeEventFiredForFilter
      testProcessAnnotatedTypeEventFiredForJsfManagedBean
      testProcessAnnotatedTypeEventFiredForServletListener
      testProcessAnnotatedTypeEventFiredForTagLibraryListener

              rhn-engineering-jharting Jozef Hartinger
              jitu_jira Jitendra Kotamraju (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: