Would you mind sharing a final implementation of how to use the setUp method with a list as input?
I am doing something similar but get a compilation error when I try to use a List of type PopulationBuilder.
My code looks roughly like this:
class MySimulation extends Simulation {
// httpConf definition with baseURL, headers, etc
// helper methods and values to drive selection logic
// discrete object definitions (each object contains a certain type of re-usable request)
/* example object
object Scenario1 {
val scenario1 = exec( http(“request_3”)
.get(“/computers/6”))
.pause(3)
.exec(http(“request_4”)
.get(“/”))
.pause(2)
}
*/
// group scenarios into formal Scenario groups/collections
val scnReads = scenario(“Reads”).exec( Scenario1.scenario1, Scenario2.scenario2 )
val scnWrites = scenario(“Writes”).exec( Scenario.scenario3 )
val scnMixed = scenario(“Mixed”).exec( Scenario1.scenario1, Scenario2.scenario2, Scenario3.scenario3 )
// function
// purpose = create a list of scenarios to be consumed by the setUp method
def buildLlist() : List[PopulationBuilder] = {
val list = List()
if (// doing writes only) {
// create list with Posts only
}
else if ( // doing reads only) {
// create list with Gets only
}
else {
// create list with Gets and Posts
}
return final list
}
setUp( buildList().inject( atOnceUsers(10)))
.protocols( httpConf )
}
When I run my code, I get an error like this>
`
16:47:09.336 [ERROR] i.g.c.ZincCompiler$ - /Users/infomaven/volumes/libraries/Gatling/gatling-charts-highcharts-bundle-2.1.4/user-files/simulations/Simulation.scala:183: not found: type PopuationBuilder
16:47:09.337 [ERROR] i.g.c.ZincCompiler$ - def buildList() : List[PopuationBuilder] = {
16:47:09.338 [ERROR] i.g.c.ZincCompiler$ - ^
16:47:09.420 [ERROR] i.g.c.ZincCompiler$ - one error found
16:47:09.421 [DEBUG] i.g.c.ZincCompiler$ - Compilation failed (CompilerInterface)
`