Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] TCK: org.jboss.cdi.tck.tests.definition.bean.types.illegal.BeanTypesWithIllegalTypeTest

Just to help me understand how we view parameterized types that have wildcards.


Which of these producers are valid?

    @Produces
    public Consumer<? extends Number> assignableToNumber() {
        return null;
    }
    
    @Produces
    public Consumer<Number> number() {
        return null;
    }

Which of these observers are valid?

    public void assignableToNumber(@Observes Consumer<? extends Number> assignableToNumber) {

    }

    public void number(@Observes Consumer<Number> number) {

    }

Which of these injection points are valid?

    @Inject
    Consumer<? extends Number> assignableToNumber;

    @Inject
    Consumer<Number> number;


-David

On Feb 28, 2023, at 12:08 AM, Ladislav Thon <lthon@xxxxxxxxxx> wrote:

Hi,

all tests in the TCK should "say what part of the spec" they test using the `@SpecAssertion` annotation. If there's a test without this annotation, that's a bug.

Now, this test _does_ have `@SpecAssertion`s, so you can find which part of the spec they test in the tck-audit-*.xml files. For example, `beanSetOfBeanTypesContainsOnlyLegalTypes` verifies that "The resulting set of bean types for a managed bean consists only of legal bean types, all other types are removed from the set of bean types."

What are legal bean types (and what are illegal bean types) is defined here: https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#legal_bean_types

LT

On Tue, Feb 28, 2023 at 12:53 AM Jean-Louis Monteiro <jlmonteiro@xxxxxxxxxxxxx> wrote:
Hi,

This sounds like a negative test, but it does not say what part of the spec or what it's supposed to do.

Can someone explain to me please?

Best

_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev
_______________________________________________
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