Closed
Description
Add tests to verify the behavior of a @Schedule
which was added to the @Asynchronous
annotation in #271
Test Scenarios
- Execution completion: Ensure scheduled tasks are completed after...
- future is completed
- method returns a result (non-null)
- method returns an exception
- Execution overlapping:
- Ensure scheduled execution times that overlap execution that is still running are skipped
- Executions ignore max-async:
- Ensure scheduled execution of tasks are not constrained by max-async
- Multiple schedules:
- Ensure if multiple schedules are supplied that the next execution time is computed to the closest future.
- Schedule once:
- Ensure an empty array of schedules causes a task to be run no more than once.
- Error cases:
- Ensure an asynchronous method with a schedule throws a RejectedExecutionException to the caller when supplied with an invalid JNDI name.
Further clarification
Specification states:
If the asynchronous method return type is `void`
and the asynchronous method does not have a schedule, or if the
asynchronous method implementation raises an error or exception, the
Jakarta EE Product Provider completes this instance upon return from the
asynchronous method implementation.
What is the behavior when an asynchronous method return type is void
AND the asynchronous method does have a schedule?
- Does this mean the asynchronous method will run on the schedule until an error is raised?
- Or should a RejectedExecutionException be thrown to the caller?