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

Assumption that there won't be >1 bean that resolves to @Fires Event<?> might be wrong

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.CR1
    • None
    • None
    • None

      Below test in the Event Test, this fails. Because, there are multiple implicit event beans are registered with the manager with the same types.

      Because some of the test classes have same event firing fields, namely @Fires Event<String>. So the resolution finds more than one bean throwing
      the AmbigiousDependencyException.

      @Test(groups =

      { "events" }

      )
      @SpecAssertion(section = "7.6", id = "p")
      public void testImplicitEventBeanHasDependentScope() throws Exception
      {
      new RunInDependentContext()
      {
      > @Override
      > protected void execute() throws Exception
      >

      { > // Retrieve the implicit event bean from the manager only > // by its API type (uses BlueFacedParrotFinch) > Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new FiresBinding()); > assert eventBeans.size() == 1; > Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next(); > assert eventBean.getScopeType().equals(Dependent.class); > }

      > }.run();
      > }

              pmuiratbleepbleep Pete Muir (Inactive)
              gerdogdu@managecat.com Gurkan Erdogdu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: