Guest User

Untitled

a guest
Apr 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. object ScenarioHelpers {
  2. val identifierList = (1 to Scenarios.numberOfScenarios).toArray
  3. val concurrentIdentifierQueue = new ConcurrentLinkedQueue[Int](identifierList.toSeq)
  4. }
  5.  
  6. abstract class AbstractScenario {
  7. val identifier = ScenarioHelpers.concurrentIdentifierQueue.poll()
  8. }
  9.  
  10. object Test1 extends AbstractScenario {
  11. val scenario1 = scenario("test scenario 1").exec(/..steps../)
  12. }
  13.  
  14. object Test2 extends AbstractScenario {
  15. val scenario2 = scenario("test scenario 2").exec(/..steps../)
  16. }
  17.  
  18. object Scenarios {
  19. val scenarios = List(Test1.scenario1, Test2.scenario2)
  20. val numberOfScenarios = scenarios.length
  21. }
  22.  
  23. object TestPreparation {
  24. val feeder = ScenarioHelpers.identifierList.map(n => Map("counter" -> n))
  25. val prepScenario = scenario("test preparation")
  26. .feed(feeder)
  27. .exec(/..steps../)
  28. }
Add Comment
Please, Sign In to add comment