ryos-io / Rhino

Rhino: Dockerized Distributed Load and Performance Testing Framework
http://ryos.io
Apache License 2.0
18 stars 3 forks source link

@Prepare and @Cleanup annotations on public static context. #99

Closed reevik closed 5 years ago

reevik commented 5 years ago

@Prepare and @CleanUp annotations are to be used on static methods.

Rationale Prepare and CleanUp methods are executed for every user and user session respectively, before simulations are run by the framework. The instance on which the reflection methods are executed, created and initialised every time scenarios are executed so the isolation level between scenario executions / or a set of scenario executions if multiple scenarios defined, is to be brought to its highest degree. However, the prepare and clean up methods are run only once before the simulation is started, while the object instance is not fully initialised, so prepare and cleanup methods can not be bound to object's state which is used by scenario execution:

prepare run (static scope)

while (simulation is active):
  create object state o1
  initialize state on o1
  run scenario1 on o1
  run scenario2 on o1
  reset state on o1

cleanup run (static scope)