Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] Did GlassFish ever pass ContainerEventTest#testProcessInjectionTargetEventFiredForTagHandler

Just for any onlookers, this is being discussed mainly in https://github.com/jakartaee/cdi/issues/623.
So let's keep the bulk of discussion there (unless I am mistaken and the two are different OFC).

> Maybe I'm missing something and that tests or its family were somehow excluded?

They weren't excluded or changed, these tests just moved under the `web` folder as they are by definition CDI Full tests.

> There's no .jsp file in the archive, and there is no .jsp file called. I can probably rebuild some parts of GlassFish to instantiate JSP tags eagerly to pass this test, but I wonder mostly how this could have ever worked and passed before?

I don't know the details of app servers implementing this, but you can register that given type with CDI as an annotated type and it will have the ProcessInjectionTarget fired for it (which is what the test asserts).

Matej

On Fri, Jun 3, 2022 at 8:54 PM arjan tijms <arjan.tijms@xxxxxxxxx> wrote:
Hi,

There's an amount of tests in the CDI TCK quite mysteriously failing for GlassFish (which uses Weld).

Some of them are quite unexpected, as they are a decade olds tests. For instance, consider

org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget.ContainerEventTest#testProcessInjectionTargetEventFiredForTagHandler

This tests whether a JspTag instance is injected. This sounds reasonable, but seemingly a JspTag in GlassFish is never created during boot, but only lazily via generated code in a JSP, i.e. the following:

   out.pushIndent();
        for (String tagHandlerPoolName : tagHandlerPoolNames) {
            out.printin(tagHandlerPoolName);
            out.print(" = org.glassfish.wasp.runtime.TagHandlerPool.getTagHandlerPool(");
            if (ctxt.isTagFile()) {
                out.print("config");
            } else {
                out.print("getServletConfig()");
            }
            out.println(");");
        }

The test creates this deployment:

 @Deployment
    public static WebArchive createTestArchive() {
        return new WebArchiveBuilder().withTestClassPackage(ContainerEventTest.class)
                .withExtension(ProcessInjectionTargetObserver.class)
                .withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml")
                .withWebResource("TestLibrary.tld", "WEB-INF/TestLibrary.tld").build();
    }

And the test is this:

 @Test(groups = INTEGRATION)
    @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aad"), @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abd"),
            @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bf") })
    public void testProcessInjectionTargetEventFiredForTagHandler() {
        assertNotNull(ProcessInjectionTargetObserver.getTagHandlerEvent());
    }

There's no .jsp file in the archive, and there is no .jsp file called. I can probably rebuild some parts of GlassFish to instantiate JSP tags eagerly to pass this test, but I wonder mostly how this could have ever worked and passed before?

Maybe I'm missing something and that tests or its family were somehow excluded?

Thoughts?

Kind regards,
Arjan Tijms



_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev

Back to the top