Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ds annotation tck] Marker annotations are only tested in a way not recommended by the spec #640

Open
laeubi opened this issue Nov 21, 2023 · 1 comment
Assignees

Comments

@laeubi
Copy link
Contributor

laeubi commented Nov 21, 2023

The ComponentPropertyTypes do not test marker annotations as mentioned by the spec, instead the testcase NameMapping is using a marker annotation on an @Deactivate method (not annotated with @ComponentPropertyType)

private void deactivate(Marker arg) {
System.out.println("Goodbye World!");
}

and then asserts that such a property is added to the component.

Even though it is not really forbidden by the spec to do so it is a quite confusing way to specify such a property and even the spec claim:

Marker annotations can be used to annotate component implementation classes to set a component property to the value Boolean.TRUE. However, since marker annotations have no methods, they are of no use as parameter types in the component's constructor and life cycle methods, or as field types for activation fields.

My suggestion therefore would be to add at least a testcase with the recommended usage of such marker annotation and probably not use discouraged usages in TCKs.

@stbischof
Copy link
Contributor

I am really happy that you looking so deep in this.

would you prepare a fix?

@laeubi laeubi changed the title [ds tck] Marker annotations are only tested in a way not recommended by the spec [ds annotation tck] Marker annotations are only tested in a way not recommended by the spec Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants