0 Replies Latest reply on Aug 1, 2013 11:53 AM by Karel Piwko

    Arquillian Drone 1.2.0 Event Model ready for review

    Karel Piwko Master

      After a small addition to Arquillian Drone 1.2.0 series SPI in previous Alpha release (Enhancer for better integration with Graphene 2), I finally made a full SPI model for Arquillian Drone, to be reviewed here:

      https://github.com/arquillian/arquillian-extension-drone/pull/27

       

      In summary, following changes were made:

      • Drone internally stores instances in Callable<?> object before they are first required for injection.
        • This makes easier for other extensions to propare environment needed to actually create the instance (e.g. Selendroid requires a port forwarding at time WebDriver is created, but it does not make sense to create port forwarding in BeforeClass scope
        • This also allow to to avoid deadlock wait if something get's wrong in thirdparty - e.g. webdriver code
      • Exposing events in SPI
        • Adding events of Enhancing/Deenhancing, Configuration creation, Drone Callable Creation and Drone Instance Creation/Destruction
        • Removing DroneReady event from 1.2.0.Alpha series
      • Exposing DroneContext in SPI
        • Allows user to modify what's stored in Drone
      • Exposing InstanceOrCallableInstance in selected events
        • This allows extension creator to modify configuration/callable/drone instance directly from Event Observer without touching DroneContext
      • Correct event propagation
        • Operation flow is not longer hardcoded and hidden in extension, everything is bound to an event, so extension can fire an event to make Drone do the work - e.g. they can fire AfterDroneConfigured after they manually create configuration and such

       

      All SPI changes are additions, already existing contract was kept untouched. This means that impact on currently existing extensions is minimal, in theory it should be zero. It will break extensions that modify behavior of drone-impl though.

       

      Any comments welcomed. This is a model we should stick for longer time now, so it should be sound and complete.

       

      Karel