Jakarta Interceptors Specification TCK Coverage

2.0

Contents

Chapter Summary
Section Summary
Coverage Detail
Unmatched Tests
Unversioned Tests
Test Group Summary

Coverage Distribution

 
 
 
 
 
 
 
 
 
 

Chapter Summary

Chapter Assertions Testable Total Tested Total Tests Tested
(problematic)
Tested
(working)
Coverage %
1 Overview000000
2 Interceptor Programming Contract997200000.00%
3 Associating Interceptors with Classes and Methods using Interceptor Bindings393100000.00%
4 Associating Interceptors with Classes and Methods using the Interceptors Annotation7400000.00%
5 Interceptor Ordering191000000.00%
Total16411700000.00%

Section Summary

SectionAssertionsTestableTotal TestedTested
(problematic)
Tested
(working)
Coverage %
1 Overview [overview]00000
2 Interceptor Programming Contract [int_programming_contract]00000
2.1 Terminology [terminology]00000
2.2 Definition of Interceptor Classes and Interceptor Methods [def_of_interceptor_classes_and_interceptor_methods]1560000.00%
2.3 Interceptor Life Cycle [interceptor_lifecycle]1260000.00%
2.3.1 Interceptor Environment [interceptor_environment]440000.00%
2.4 InvocationContext [invocationcontext]19160000.00%
2.5 Exceptions [exceptions]540000.00%
2.6 Business Method Interceptor Methods [business_method_interceptor_methods]1090000.00%
2.7 Interceptor Methods for Lifecycle Event Callbacks [int_methods_for_lifecycle_event_callbacks]16130000.00%
2.7.1 Exceptions [lic_exceptions]330000.00%
2.8 Timeout Method Interceptor Methods [timeout_method_int_methods]860000.00%
2.9 Constructor- and Method-level Interceptors [constructor_and_method_level_int]650000.00%
2.10 Default Interceptors [default_interceptors]10000
3 Associating Interceptors with Classes and Methods using Interceptor Bindings [associating_int_using_int_bindings]10000
3.1 Interceptor Binding Types [int_binding_types]220000.00%
3.1.1 Interceptor binding types with additional interceptor bindings [int_binding_types_with_additional_int_bindings]320000.00%
3.1.2 Other sources of interceptor bindings [other_sources_of_int_bindings]110000.00%
3.2 Declaring Interceptor Bindings of an Interceptor [declaring_interceptor_bindings_of_an_interceptor]740000.00%
3.3 Binding an Interceptor to a Component [binding_int_to_component]12100000.00%
3.4 Interceptor Resolution [int_resolution]870000.00%
3.4.1 Interceptors with multiple bindings [int_with_multiple_bindings]110000.00%
3.4.2 Interceptor binding types with members [int_binding_types_with_members]440000.00%
4 Associating Interceptors with Classes and Methods using the Interceptors Annotation [associating_int_using_interceptors_annotation]740000.00%
5 Interceptor Ordering [int_ordering]00000
5.1 Enabling Interceptors [enabling_interceptors]210000.00%
5.2 Interceptor Ordering Rules [int_ordering_rules]1080000.00%
5.2.1 Use of the Priority Annotation in Ordering Interceptors [priority_annotation_in_ordering_int]30000
5.3 Excluding Interceptors [excluding_interceptors]410000.00%

Coverage Detail

Colour Key
Assertion is covered
Assertion is not covered
Assertion test is unimplemented
Assertion is untestable

Section 2.2 - Definition of Interceptor Classes and Interceptor Methods [def_of_interceptor_classes_and_interceptor_methods]

An interceptor method may be declared in the target class, in an interceptor class associated with the target class, or in a superclass of the target class or interceptor class.

aa)

Interceptor method may be defined on an interceptor class associated with the target class.

Coverage

No tests exist for this assertion

ab)

Interceptor method may be defined in the target class.

Coverage

No tests exist for this assertion

ac)

Interceptor method may be defined in a super class of the target class.

Coverage

No tests exist for this assertion

ad)

Interceptor method may be defined in a super class of the interceptor class.

Coverage

No tests exist for this assertion

b)It's not possible to test all the combinations, we only test few basic scenarios.

Any number of interceptor classes may be associated with a target class.

Coverage

No tests exist for this assertion

c)INTERCEPTORS_SPEC-22

An interceptor class must not be abstract and must have a public no-arg constructor.

This specification defines the interceptor method types listed below. Extension specifications may define additional interceptor method types.

ca)

Around-invoke interceptor methods (annotated with the jakarta.interceptor.AroundInvoke annotation). Around-invoke interceptor methods interpose on the invocation of business methods.

cb)

Around-timeout interceptor methods (annotated with the jakarta.interceptor.AroundTimeout annotation). Around-timeout interceptor methods interpose on the invocation of timeout methods, in response to timer events.

cc)Tested in

Post-construct interceptor methods (annotated with the jakarta.annotation.PostConstruct annotation). Post-construct interceptor methods are invoked after dependency injection has been completed on the target instance.

cd)

Pre-destroy interceptor methods (annotated with the jakarta.annotation.PreDestroy annotation). Pre-destroy interceptor methods are invoked before the target instance and all interceptor instances associated with it are destroyed by the container.

ce)

Around-construct interceptor methods (annotated with the jakarta.interceptor.AroundConstruct annotation). Around-construct interceptor methods interpose on the invocation of the constructor of the target instance.

d)

Up to one interceptor method of each interceptor method type may be defined in the same class. More specifically, up to one around-invoke interceptor method, one around-timeout interceptor method, and one lifecycle callback interceptor method for each of the different lifecycle events may be defined in the same class. Only the interceptor methods of the interceptor class that are relevant for the given invocation context are invoked. For example, when a business method is invoked, around-invoke interceptor methods are invoked, but any around-construct, around-timeout, post-construct, or pre-destroy methods are ignored.

Coverage

No tests exist for this assertion

f)Tested in several other sections

Interceptor methods and interceptor classes may be defined for a class by means of metadata annotations or, optionally, by means of a deployment descriptor.

g)Tested in sections 3.3 and 4

Interceptors classes may be associated with the target class using either interceptor binding or the Interceptors annotation. Typically only one interceptor association type is used for any component.

h)The ejb-jar.xml deployment descriptor is tested within the EJB TCK. The beans.xml deployment descriptor is tested within the CDI TCK, section
                9.4 Interceptor enablement and ordering.

An extension specification may use a deployment descriptor to specify the invocation order of interceptors or to override the order specified in metadata annotations. A deployment descriptor can be optionally used to define default interceptors or to associate interceptors with the target class. For example, the EJB specification requires support for the ejb-jar.xml deployment descriptor and the CDI specification requires supports for the beans.xml deployment descriptor.

Section 2.3 - Interceptor Life Cycle [interceptor_lifecycle]

a)Tested within 2.2 ba) and 2.2 bb).

The lifecycle of an interceptor instance is the same as that of the target class instance with which it is associated.

ba)

Except as noted below, when the target instance is created, a corresponding interceptor instance is created for each associated interceptor class.

Coverage

No tests exist for this assertion

bb)Unable to test whether an instance is really destroyed.

These interceptor instances are destroyed if the target instance fails to be created or when it is removed.

c)Tested within 2.2.1 a).

An interceptor instance may be the target of dependency injection. Dependency injection is performed when the interceptor instance is created, using the naming context of the associated target class.

Coverage

No tests exist for this assertion

ca)If the PostConstruct callback is defined on the interceptor class, it is not invoked when the interceptor instance itself is created.

With the exception of around-construct lifecycle callback interceptor methods, no interceptor methods are invoked until after dependency injection has been completed on both the interceptor instances an the target instance.

Coverage

No tests exist for this assertion

cb)Tested in 2.3 e).

Post-construct interceptor methods for the target instance are invoked after dependency injection has been completed on the target instance.

cc)

Pre-destroy interceptor methods are invoked before the target instance and all interceptor instances associated with it are destroyed.

The following rules apply specifically to around-construct lifecycle callback interceptor methods:

da)

Around-construct lifecycle callback interceptor methods are invoked after dependency injection has been completed on the instances of all interceptor classes associated with the target class.

Coverage

No tests exist for this assertion

daz)

Injection of the target component into interceptor instances that are invoked during the AroundConstruct lifecycle callback is not supported.

db)

The target instance is created after the last interceptor method in the around-construct interceptor chain invokes the InvocationContext.proceed method. If the constructor for the target instance supports injection, such constructor injection is performed. If the InvocationContext.proceed method is not invoked by an interceptor method, the target instance will not be created.

Coverage

No tests exist for this assertion

dc)

The AroundConstruct interceptor method can access the constructed instance using the InvocationContext.getTarget method after the InvocationContext.proceed completes.

Coverage

No tests exist for this assertion

dd)INTERCEPTORS_SPEC-26

Dependency injection on the target instance is not completed until after invocation of all interceptor methods in the AroundConstruct interceptor chain complete successfully. Around-construct lifecycle callback interceptor methods should therefore exercise caution when invoking methods of the target instance since dependency injection on the target instance will not have been completed.

Section 2.3.1 - Interceptor Environment [interceptor_environment]

a)

An interceptor class shares the enterprise naming context of its associated target class. Annotations and/or XML deployment descriptor elements for dependency injection or for direct JNDI lookup refer to this shared naming context.

Coverage

No tests exist for this assertion

b)

Around-invoke and around-timeout interceptor methods run in the same Java thread as the associated target method.

Coverage

No tests exist for this assertion

ba)

Around-construct interceptor methods run in the same Java thread as the target constructor.

Coverage

No tests exist for this assertion

c)

It is possible to carry state across multiple interceptor method invocations for a single method invocation or lifecycle callback event in the context data of the InvocationContext object. The InvocationContext object also provides information that enables interceptor methods to control the behavior of the interceptor invocation chain, including whether the next method in the chain is invoked and the values of its parameters and result.

Coverage

No tests exist for this assertion

Section 2.4 - InvocationContext [invocationcontext]

a)Statement of intent

The InvocationContext object provides information that enables interceptor methods to control the behavior of the invocation chain.

ba)

The same InvocationContext instance is passed to each interceptor method for a given target class method or lifecycle event interception. This allows an interceptor to save information in the context data property of the InvocationContext that can be subsequently retrieved in other interceptors as a means to pass contextual data between interceptors. The contextual data is not sharable across separate target class method invocations or lifecycle callback events.

Coverage

No tests exist for this assertion

bb)

If interceptors are invoked as a result of the invocation on a web service endpoint, the map returned by getContextData() will be the JAX-WS MessageContext.

Coverage

No tests exist for this assertion

c)

The getTarget method returns the associated target instance. For the AroundConstruct lifecycle callback interceptor method, getTarget returns null if called before the proceed method returns.

Coverage

No tests exist for this assertion

da)Duplicate of 2.7 f)

The getTimer method returns the timer object associated with a timeout method invocation.

db)

The getTimer method returns null for around-invoke methods and lifecycle callback interceptor methods.

Coverage

No tests exist for this assertion

ea)

The getMethod method returns the method of the target class for which the interceptor was invoked.

Coverage

No tests exist for this assertion

eb)

In a lifecycle callback interceptor for which there is no corresponding lifecycle callback method on the target class or in the AroundConstruct lifecycle callback interceptor method, getMethod returns null.

Coverage

No tests exist for this assertion

f)

The getParameters method returns the parameters of the method or constructor invocation. If the setParameters method has been called, getParameters returns the values to which the parameters have been set.

Coverage

No tests exist for this assertion

The setParameters method modifies the parameters used for the target class method or constructor invocation. Modifying the parameter values does not affect the determination of the method or the constructor that is invoked on the target class. The parameter types must match the types for the target class method or constructor, and the number of parameters supplied must equal the number of parameters on the target class method or constructor, or the IllegalArgumentException is thrown.

ga)

Test setParameters method modifies the parameters used.

Coverage

No tests exist for this assertion

gb)

Test invalid number of parameters.

Coverage

No tests exist for this assertion

gc)

Test invalid parameter types.

Coverage

No tests exist for this assertion

The proceed method causes the invocation of the next interceptor method in the chain, or, when called from the last around-invoke or around-timeout interceptor method, the target class method.

ha)

Test around-invoke interceptor method.

Coverage

No tests exist for this assertion

hb)

Test around-timeout interceptor method.

Coverage

No tests exist for this assertion

i)

For AroundConstruct lifecycle callback interceptor methods, the invocation of the last interceptor method in the chain causes the target instance to be created.

Coverage

No tests exist for this assertion

j)

Interceptor methods must always call the InvocationContext.proceed method or no subsequent interceptor methods, target class method, or lifecycle callback methods will be invoked, or the target instance will not be created.

Coverage

No tests exist for this assertion

k)

If a method is of type void, the invocation of the proceed method returns null.

Coverage

No tests exist for this assertion

l)

For all other lifecycle callback interceptor methods, if there is no callback method defined on the target class, the invocation of proceed in the last interceptor method in the chain is a no-op, and null is returned.

Coverage

No tests exist for this assertion

m)Unclear meaning of validation.

In case of the PostConstruct interceptor, if there is no callback method defined on the target class, the invocation of InvocationContext.proceed method in the last interceptor method in the chain validates the target instance.

Section 2.5 - Exceptions [exceptions]

a)

Interceptor methods are allowed to throw runtime exceptions or any checked exceptions that the associated target method allows within its throws clause.

Coverage

No tests exist for this assertion

Interceptor methods are allowed to catch and suppress exceptions and to recover by calling the InvocationContext.proceed method.

ba)

Interceptor method is allowed to catch and suppress exceptions.

Coverage

No tests exist for this assertion

bb)

Interceptor method is allowed to recover by calling the InvocationContext.proceed method.

Coverage

No tests exist for this assertion

c)

The invocation of the InvocationContext.proceed method will throw the same exception as any thrown by the associated target method unless an interceptor further down the Java call stack has caught it and thrown a different exception.

Coverage

No tests exist for this assertion

d)

Exceptions and initialization and/or cleanup operations should typically be handled in try/catch/finally blocks around the proceed method.

Section 2.6 - Business Method Interceptor Methods [business_method_interceptor_methods]

a)

Interceptor methods that interpose on business method invocations are denoted by the AroundInvoke annotation.

Coverage

No tests exist for this assertion

b)

Around-invoke methods may be defined on interceptor classes and/or the target class and/or superclasses of the target class or the interceptor classes. However, only one around-invoke method may be defined on a given class.

Coverage

No tests exist for this assertion

Around-invoke methods can have public, private, protected, or package level access.

ca)

Test public level access.

Coverage

No tests exist for this assertion

cb)

Test private level access.

Coverage

No tests exist for this assertion

cc)

Test protected level access.

Coverage

No tests exist for this assertion

cd)

Test package level access.

Coverage

No tests exist for this assertion

d)INTERCEPTORS_SPEC-22

An around-invoke method must not be declared as abstract, final or static.

e)

An around-invoke method can invoke any component or resource that the method it is intercepting can invoke.

Coverage

No tests exist for this assertion

In general, an around-invoke method invocation occurs within the same transaction and security context as the method on which it is interposing. However, note that the transaction context may be changed by transactional interceptors in the invocation chain.

fa)

Test transaction context.

Coverage

No tests exist for this assertion

fb)

Test security context.

Coverage

No tests exist for this assertion

Section 2.7 - Interceptor Methods for Lifecycle Event Callbacks [int_methods_for_lifecycle_event_callbacks]

a)

The AroundConstruct annotation denotes lifecycle callback interceptor methods that interpose on invocation of the target instance’s constructor.

Coverage

No tests exist for this assertion

b)

The PostConstruct annotation denotes lifecycle callback interceptor methods that are invoked after the target instance has been constructed and dependency injection on that instance has been completed, but before any business method or other event can be invoked on the target instance.

Coverage

No tests exist for this assertion

c)

The PreDestroy annotation denotes lifecycle callback interceptor methods that interpose on the target instance’s removal.

Coverage

No tests exist for this assertion

d)INTERCEPTORS_SPEC-22

The AroundConstruct interceptor methods may be only defined on interceptor classes and/or superclasses of interceptor classes. The AroundConstruct callback should not be defined on the target class.

All other interceptor methods that interpose on the target instance lifecycle event callbacks can be defined on an interceptor class and/or directly on the target class.

ea)

Test PostConstruct interceptor method.

Coverage

No tests exist for this assertion

eb)

Test PreDestroy interceptor method.

Coverage

No tests exist for this assertion

f)

A single lifecycle callback interceptor method may be used to interpose on multiple callback events.

Coverage

No tests exist for this assertion

g)

Lifecycle callback interceptor methods are invoked in an unspecified security context.

h)

Lifecycle callback interceptor methods are invoked in a transaction context determined by their target class and/or method.

Coverage

No tests exist for this assertion

i)

AroundConstruct lifecycle callback interceptor methods may be defined on superclasses of interceptor classes. All other lifecycle callback interceptor methods may be defined on superclasses of the target class or of interceptor classes. However, a given class may not have more than one lifecycle callback interceptor method for the same lifecycle event. Any subset or combination of lifecycle callback annotations may otherwise be specified on a target class or interceptor class.

Coverage

No tests exist for this assertion

ia)

If a lifecycle callback interceptor method returns a value, it is ignored by the container.

Coverage

No tests exist for this assertion

Lifecycle callback interceptor methods can have public, private, protected, or package level access.

ja)

Test public level access.

Coverage

No tests exist for this assertion

jb)

Test private level access.

Coverage

No tests exist for this assertion

jc)

Test protected level access.

Coverage

No tests exist for this assertion

jd)

Test package level access.

Coverage

No tests exist for this assertion

k)INTERCEPTORS_SPEC-22

A lifecycle callback interceptor method must not be declared as abstract, final or static.

Section 2.7.1 - Exceptions [lic_exceptions]

a)

Lifecycle callback interceptor methods may throw runtime exceptions, but not checked exceptions.

Coverage

No tests exist for this assertion

b)

A lifecycle callback interceptor method (other than a method on the target class or its superclasses) may catch an exception thrown by another lifecycle callback interceptor method in the invocation chain, and clean up before returning.

Coverage

No tests exist for this assertion

c)

The PreDestroy callbacks are not invoked when the target instance and the interceptors are discarded as a result of such exceptions: the lifecycle callback interceptor methods in the chain should perform any necessary clean-up operations as the interceptor chain unwinds.

Coverage

No tests exist for this assertion

Section 2.8 - Timeout Method Interceptor Methods [timeout_method_int_methods]

a)Tested within the CDI TCK, 7.2 Container invocations and interception.

Interceptor methods that interpose on timeout methods are denoted by the AroundTimeout annotation.

Around-timeout methods may be defined on interceptor classes and/or the target class and/or superclasses of the target class or interceptor classes. However, only one around-timeout method may be defined on a given class.

ba)Partially tested within the CDI TCK, 7.2 Container invocations and interception.

Test interceptor classes and/or superclasses.

Coverage

No tests exist for this assertion

bb)

Test target class and/or superclasses.

Coverage

No tests exist for this assertion

c)INTERCEPTORS_SPEC-22

Around-timeout methods can have public, private, protected, or package level access. An around-timeout method must not be declared as abstract, final or static.

d)

An around-timeout method can invoke any component or resource that its corresponding timeout method can invoke.

Coverage

No tests exist for this assertion

An around-timeout method invocation occurs within the same transaction and security context as the timeout method on which it is interposing.

ea)

Test transaction context.

Coverage

No tests exist for this assertion

eb)

Test security context.

Coverage

No tests exist for this assertion

f)

The InvocationContext.getTimer method allows an around-timeout method to retrieve the timer object associated with the timeout.

Coverage

No tests exist for this assertion

Section 2.9 - Constructor- and Method-level Interceptors [constructor_and_method_level_int]

aa)

Method-level interceptors are interceptor classes associated with a specific business or timeout method of the target class.

Coverage

No tests exist for this assertion

ab)

Constructor-level interceptors are interceptor classes associated with a constructor of the target class.

Coverage

No tests exist for this assertion

b)

Only the interceptor methods of the interceptor class that are relevant for the context in which the interceptor is bound are invoked. For example, if the interceptor is bound only to a business method, any AroundConstruct, AroundTimeout, PostConstruct, or PreDestroy methods on the interceptor are not called.

Coverage

No tests exist for this assertion

c)INTERCEPTORS_SPEC-22

Method-level interceptors may not be associated with a lifecycle callback method of the target class.

d)

The same interceptor may be applied to more than one business or timeout method of the target class.

Coverage

No tests exist for this assertion

e)

The applicability of a method-level interceptor to more than one method of an associated target class does not affect the relationship between the interceptor instance and the target class - only a single instance of the interceptor class is created per target class instance.

Coverage

No tests exist for this assertion

Section 2.10 - Default Interceptors [default_interceptors]

a)Should be tested in the EJB TCK.

Default interceptors are interceptors that apply to a set of target classes. If a deployment descriptor is supported, it may be used to define default interceptors and their relative ordering.

Section 3 - Associating Interceptors with Classes and Methods using Interceptor Bindings [associating_int_using_int_bindings]

a)Statement of intent

Interceptor bindings are intermediate annotations that may be used to associate interceptors with any component that is not itself an interceptor.

Section 3.1 - Interceptor Binding Types [int_binding_types]

a)

An interceptor binding type is a Java annotation defined as Retention(RUNTIME). Typically an interceptor binding is defined as Target({TYPE, METHOD, CONSTRUCTOR}) or any subset of valid target types.

Coverage

No tests exist for this assertion

b)

An interceptor binding type may be declared by specifying the InterceptorBinding meta-annotation.

Coverage

No tests exist for this assertion

Section 3.1.1 - Interceptor binding types with additional interceptor bindings [int_binding_types_with_additional_int_bindings]

a)

An interceptor binding type may declare other interceptor bindings.

Coverage

No tests exist for this assertion

b)

Interceptor bindings are transitive - an interceptor binding declared by an interceptor binding type is inherited by all components and other interceptor binding types that declare that interceptor binding type.

Coverage

No tests exist for this assertion

c)INTERCEPTORS_SPEC-21

An interceptor binding type can only be applied to an interceptor binding type defining a superset of it's target types. For example interceptor binding types declared Target(TYPE) may not be applied to interceptor binding types declared Target({TYPE, METHOD}).

Section 3.1.2 - Other sources of interceptor bindings [other_sources_of_int_bindings]

a)

An extension specification may define other sources of interceptor bindings, such as via a CDI stereotype.

Coverage

No tests exist for this assertion

Section 3.2 - Declaring Interceptor Bindings of an Interceptor [declaring_interceptor_bindings_of_an_interceptor]

a)

The interceptor bindings of an interceptor are specified by annotating the interceptor class with the binding types and the Interceptor annotation and are called the set of interceptor bindings for the interceptor.

Coverage

No tests exist for this assertion

b)

An interceptor class may declare multiple interceptor bindings.

Coverage

No tests exist for this assertion

c)

Multiple interceptors may declare the same interceptor bindings.

Coverage

No tests exist for this assertion

d)

An extension specification may define other ways of declaring an interceptor.

e)

If an interceptor does not declare an Interceptor annotation, it could be bound to components using Interceptors annotation or a deployment descriptor file.

Coverage

No tests exist for this assertion

f)Non-portable mode

All interceptors declared using the Interceptor annotation should specify at least one interceptor binding. If an interceptor declared using the Interceptor annotation does not declare any interceptor binding, non-portable behavior results.

g)INTERCEPTORS_SPEC-22

With the exception of AroundConstruct lifecycle callback interceptors, an interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as Target(TYPE).

Section 3.3 - Binding an Interceptor to a Component [binding_int_to_component]

An interceptor may be bound to a component by annotating the component class, a method, or constructor of the component class, with the interceptor binding type.

aa)

Test a component class.

Coverage

No tests exist for this assertion

ab)

Test a method.

Coverage

No tests exist for this assertion

ac)

Test a constructor.

Coverage

No tests exist for this assertion

A component class, method, or constructor of a component class may declare multiple interceptor bindings.

ba)

Test a component class.

Coverage

No tests exist for this assertion

bb)

Test a method.

Coverage

No tests exist for this assertion

bc)

Test a constructor.

Coverage

No tests exist for this assertion

c)

The set of interceptor bindings for a method or constructor are those declared at class level combined with those declared at method or constructor level.

Coverage

No tests exist for this assertion

An interceptor binding declared on a method or constructor replaces an interceptor binding of the same type declared at class level or inherited from a superclass.

da)

Test a constructor.

Coverage

No tests exist for this assertion

db)

Test a method.

Coverage

No tests exist for this assertion

e)

An extension specification may define additional rules for combining interceptor bindings, such as interceptors defined via a CDI stereotype.

Coverage

No tests exist for this assertion

f)Tested within the CDI TCK, 9.3 Binding an interceptor to a bean.

If the component class declares or inherits a class level interceptor binding, it must not be declared final, or have any non-static, non-private, final methods. If a component has a class-level interceptor binding and is declared final or has a non-static, non-private, final method, the container automatically detects the problem and treats it as a definition error.

g)Tested within the CDI TCK, 9.3 Binding an interceptor to a bean.

If a non-static, non-private method of a component class declares a method level interceptor binding, neither the method nor the component class may be declared final. If a non-static, non-private, final method of a component has a method level interceptor binding, the container automatically detects the problem and treats it as a definition error.

Section 3.4 - Interceptor Resolution [int_resolution]

a)Statement of intent

The process of matching interceptors to a certain lifecycle callback method, timeout method, business method or a constructor of a certain component is called interceptor resolution.

b)

For a lifecycle callback, the interceptor bindings include the interceptor bindings declared or inherited by the component at the class level, including, recursively, interceptor bindings declared as meta-annotations of other interceptor bindings.

Coverage

No tests exist for this assertion

For a business method, timeout method, or constructor the interceptor bindings include the interceptor bindings declared or inherited by the component at the class level, including, recursively, interceptor bindings declared as meta-annotations of other interceptor bindings, together with all interceptor bindings declared on the constructor or method, including, recursively, interceptor bindings declared as meta-annotations of other interceptor bindings.

ca)

Test a business method.

Coverage

No tests exist for this assertion

cb)

Test a timeout method.

Coverage

No tests exist for this assertion

cc)

Test a constructor.

Coverage

No tests exist for this assertion

An interceptor is bound to a method or constructor if:

da)

The method or constructor has all the interceptor bindings of the interceptor. A method or constructor has an interceptor binding of an interceptor if it has an interceptor binding with (a) the same type and (b) the same annotation member value for each member. An extension specification may further refine this rule. For example the CDI specification adds the jakarta.enterprise.util.Nonbinding annotation, causing member values to be ignored by the resolution process.

Coverage

No tests exist for this assertion

db)

The interceptor intercepts the given kind of lifecycle callback or business method.

Coverage

No tests exist for this assertion

dc)

The interceptor is enabled.

Coverage

No tests exist for this assertion

Section 3.4.1 - Interceptors with multiple bindings [int_with_multiple_bindings]

a)

An interceptor class may specify multiple interceptor bindings.

Coverage

No tests exist for this assertion

Section 3.4.2 - Interceptor binding types with members [int_binding_types_with_members]

a)

Interceptor binding types may have annotation members.

Coverage

No tests exist for this assertion

b)

Annotation member values are compared using the equals method.

Coverage

No tests exist for this assertion

c)Testing |jakarta.enterprise.util.Nonbinding| annotation.

Array-valued or annotation-valued members of an interceptor binding type are not supported. An extension specification may add support for these member types. For example the CDI specification adds the jakarta.enterprise.util.Nonbinding annotation, allowing array-valued or annotation-valued members to be used on the annotation type, but ignored by the resolution process.

Coverage

No tests exist for this assertion

d)

If the set of interceptor bindings of a component class or interceptor, including bindings inherited from stereotypes and other interceptor bindings, has two instances of a certain interceptor binding type and the instances have different values of some annotation member, the container automatically detects the problem and treats it as a definition error.

Coverage

No tests exist for this assertion

Section 4 - Associating Interceptors with Classes and Methods using the Interceptors Annotation [associating_int_using_interceptors_annotation]

a)

The Interceptors annotation can be used to denote interceptor classes and associate one or more interceptor classes with a target class, and/or one or more of its methods, and/or a constructor of the target class.

Coverage

No tests exist for this assertion

b)

Method-level around-invoke and around-timeout interceptors can be defined by applying the Interceptors annotation to the method for which the interceptors are to be invoked.

Coverage

No tests exist for this assertion

c)

Constructor-level interceptors can be defined by applying the Interceptors annotation to the constructor for which the interceptors are to be invoked.

Coverage

No tests exist for this assertion

ca)Tested in section 5.

Constructor- and method-level interceptors are invoked in addition to any default interceptors and interceptors defined for the target class (and its superclasses).

d)Tested in section 5.

If multiple interceptors are defined for the target class in the Interceptors annotation, they are invoked in the order in which they are specified. See Chapter 5 for the rules on interceptors ordering.

e)

The Interceptor annotation is ignored on interceptor classes bound using the Interceptors annotation.

Coverage

No tests exist for this assertion

f)

An extension specification may support the use of a deployment descriptor to associate interceptor classes with a target class, and/or method or constructor of a target class, and to specify the order of interceptor invocation or override metadata specified by annotations.

Section 5.1 - Enabling Interceptors [enabling_interceptors]

a)

Interceptors declared using the Interceptors annotation are enabled by that annotation. Using the Interceptors annotation to associate interceptor classes with a target class or a method or constructor of a target class enables them for that target class, method, or constructor. The order in which the interceptor classes are specified in the Interceptors annotation controls interceptor ordering (see Section 5.2).

Coverage

No tests exist for this assertion

b)

An extension specification may define alternative mechanisms (e.g., a deployment descriptor such as the CDI beans.xml or the EJB ejb-jar.xml deployment descriptor) to enable and order interceptors, to override the order specified by means of annotations, or to disable interceptors.

Section 5.2 - Interceptor Ordering Rules [int_ordering_rules]

Default interceptors are invoked first.

a)

Default interceptors are invoked in the order defined by the extension specification (e.g., by their order in the deployment descriptor).

b)

If a default interceptor class has superclasses, interceptor methods declared in the interceptor class’s superclasses are invoked before the interceptor method declared in the interceptor class itself, most general superclass first.

Interceptors declared by applying the Interceptors annotation at class-level to the target class are invoked next.

c)

Interceptor methods declared in the interceptor classes listed in the Interceptors annotation are invoked in the same order as the specification of the interceptor classes in that annotation.

Coverage

No tests exist for this assertion

d)

If an interceptor class declared by applying the Interceptors annotation at class-level has superclasses, interceptor methods declared in the interceptor class’s superclasses are invoked before the interceptor method declared in the interceptor class itself, most general superclass first.

Coverage

No tests exist for this assertion

Interceptors declared by applying the Interceptors annotation at method- or constructor-level are invoked next.

e)

Interceptor methods declared in the interceptor classes listed in the Interceptors annotation are invoked in the same order as the specification of the interceptor classes in that annotation.

Coverage

No tests exist for this assertion

f)

If an interceptor class declared by applying the Interceptors annotation at method- or constructor-level has superclasses, interceptor methods declared in the interceptor class’s superclasses are invoked before the interceptor method declared in the interceptor class itself, most general superclass first.

Coverage

No tests exist for this assertion

Interceptors declared using interceptor bindings are invoked next.

g)

All interceptors specified using interceptor binding annotations visible on the target class (e.g., specified on the class or visible on the class because they were declared with the Inherited annotation) are combined with all binding annotations on the target method and sorted by the priorities specified by the Priority annotation; and then the interceptor methods are invoked in order of priority. The Priority annotation is described in Section 5.2.1.

Coverage

No tests exist for this assertion

h)

If an interceptor class declared using interceptor bindings has superclasses, interceptor methods declared in the interceptor class’s superclasses are invoked before the interceptor method declared in the interceptor class itself, most general superclass first.

Coverage

No tests exist for this assertion

Interceptor methods declared in the target class or in any superclass of the target class are invoked last.

i)

If the target class has superclasses, interceptor methods declared in the target class’s superclasses are invoked before an interceptor method declared in the target class itself, most general superclass first.

Coverage

No tests exist for this assertion

j)

If an interceptor method is overridden by another method (regardless whether that method is itself an interceptor method), it will not be invoked.

Coverage

No tests exist for this assertion

Section 5.2.1 - Use of the Priority Annotation in Ordering Interceptors [priority_annotation_in_ordering_int]

)Tested within the CDI TCK, section 9.4 Interceptor enablement and ordering.

The Priority annotation can be used to enable and order interceptors associated with components that use interceptor bindings. The required value element of the Priority annotation determines the ordering. Interceptors with smaller priority values are called first.

b)Undefined behaviour.

If more than one interceptor has the same priority, the relative order of these interceptor is undefined.

c)INTERCEPTORS_SPEC-23

The Priority annotation is ignored on interceptors bound to a component using the Interceptors annotation.

Section 5.3 - Excluding Interceptors [excluding_interceptors]

a)Tested separately in the following assertions

Interceptors may be excluded from execution by means of the ExcludeClassInterceptors annotation and the ExcludeDefaultInterceptors annotation.

b)

The ExcludeClassInterceptors annotation can be used to exclude the invocation of the class-level interceptors defined by means of the Interceptors annotation.

Coverage

No tests exist for this assertion

c)Should be tested in the EJB TCK.

The ExcludeDefaultInterceptors annotation can be used to exclude the invocation of default interceptors for a target class or—when applied to a target class constructor or method—to exclude the invocation of default interceptors for a particular constructor or method.

d)

An extension specification may define other means for excluding interceptors from execution, such as by means of a deployment descriptor.

Unversioned tests

The following 11 test classes either do not have a version specified, or the version is unrecognized:

Test ClassVersion
org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb.EnterpriseInterceptorBindingResolutionTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings.AroundTimeoutOrderInterceptorTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb.SessionBeanAroundInvokeInterceptorTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.ejb.LifecycleCallbackInterceptorTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.AroundTimeoutInterceptorTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.InterceptorEnvironmentTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee.AroundInvokeAccessInterceptorTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb.SessionBeanLifecycleInterceptorDefinitionTest1.2
org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.InterceptorEnvironmentJNDITest1.2
org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb.InterceptorEnvironmentJNDISessionBeanTest1.2
org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb.SessionBeanConstructorInterceptionTest1.2