-
Notifications
You must be signed in to change notification settings - Fork 51
SPI changes in Drone 2
-
Class scoped life cycle
-
Drone will be prepared in the BeforeClass phase and destroyed in the AfterClass phase, resulting in a one instance for all tests.
-
For declaration is used an annotation @ClassLifecycle
-
-
Deployment scoped life cycle
-
Drone will be prepared in the AfterDeploy phase and destroyed in the BeforeUnDeploy phase, resulting in a one instance for all tests belonging to a deployment.
-
For declaration is used an annotation @OperateOnDeployment with a defined name of the deployment
-
-
Method scoped life cycle
-
Drone will be prepared in the Before phase and destroyed in the After phase, resulting in a fresh instance of drone for every test.
-
For declaration is used an annotation @MethodLifecycle
-
-
Default scope
-
For injection point used as a field the Class scope is used as the default scope
-
For injection point used as a method parameter of some test method the Method scope is used as the default scope
-
-
Added an injection point called DronePoint which is a unique description of a Drone in a code
-
Provides:
-
Lifecycle representing a scope the Drone belongs to
-
Qualifiers
-
A Drone type
-
-
The DronePoint is used there in the event calls as a parameter instead of the former two parameters - drone type and list of qualifiers
-
For each DronePoint there is an unique DronePointContext which stores configuration, future instance and metadata.
-
Added a cache CachingCallable for caching a return value of java.util.concurrent.Callable#call() and each next call of the method
-
Added filters to make finding injection points much easier:
-
Classes:
-
Utility classes:
-
DronePointFilter - Utility class used for filtering injection points.
-
FilterableResult - Utility for performing filter operation over a set of drone points.
-
-
Filters:
-
AnnotationFilter - for finding injection points by the qualifier
-
DeploymentFilter - for finding deployment injection points.
-
DroneInstantiatedFilter - for finding all injection points for which drone has been instantiated.
-
InverseFilter - for finding everything that its underlying one do not
-
LifecycleFilter - for finding injection points by the lifecycle.
-
QualifierFilter - for finding injection points by the qualifier.
-
-
-
Introduced a new abstraction of commands
-
They are basically events which when fired they trigger series of events and operations resulting in some complete result
-
Classes:
-
InjectionPointCommand - an abstract parent class
-
PrepareDrone - trigger the preparation of a drone
-
DestroyDrone - trigger the destruction of a drone
-
-
Added new couple of events:
BeforeDroneExtensionConfigured AfterDroneExtensionConfigured
-
They are called before/after the drone extension is being configured
-
-
There has been replaced two couples of events:
BeforeDroneCallableCreated AfterDroneConfigured BeforeDroneConfigured AfterDroneCallableCreated
with one couple of events:
BeforeDronePrepared AfterDronePrepared
-
They are called before/after a Drone configuration and a Drone callable instance are prepared. This ensures that both or none of the objects should be present.
-
-
Event flow: