Hi,
I would like to read the Session Map after a call to a feeder in a Scala function.
Assume here is my code :
class RechercheUSParCriteresIdsMonoValueEvol extends Simulation {
// some Stuff
object consultationService {
def rechercheUS (pTypeUS: String, IdFoncUS: String = “IDENTIFIANT”, nbIdFoncUS: Int = 0) : ChainBuilder = {
return exec { session =>
var pCriteres : String = “”
if (nbIdFoncUS != 0){
pCriteres = pCriteres + generateBuilder(IdFoncUS, nbIdFoncUS)
}
val newsession = session.set(“pCritere”, pCriteres).set(“pTypeUS”, pTypeUS)
newsession
}
.exec(
soapPost(“RECHERCHE_ID_FONC_US”, urlService, “Request_rechercherUnitesStructurellesParCriteres.txt”)
)
.pause(pacingTime)
}
def generateBuilder (tCritere : String, nbTCritere: Int) : String = {
val session: Session = ???
var valeursCriteres : List[String] = List()
for ( x ← 0 to nbTCritere - 1) {
feed(usiFeeder) → must inject data in the session
valeursCriteres = session(“idFonctionnelUs”).as[String] :: valeursCriteres
}
return (new pCriteres(true, tCritere, valeursCriteres)).toString()
}
}
// Some stuff
}
The compilation is OK, but at runtime I got this exception on the line where I declare ( val session: Session = ??? )
Exception in thread “main” scala.NotImplementedError: an implementation is missing
at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225)
at consultationService .RechercheUS.(RecordedSimulation.scala:54)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at io.gatling.core.runner.Runner.run(Runner.scala:41)
at io.gatling.app.Gatling$$anonfun$runSimulationIfNecessary$1.apply(Gatling.scala:126)
at io.gatling.app.Gatling$$anonfun$runSimulationIfNecessary$1.apply(Gatling.scala:111)
at scala.Option.getOrElse(Option.scala:121)
at io.gatling.app.Gatling.runSimulationIfNecessary(Gatling.scala:111)
at io.gatling.app.Gatling.start(Gatling.scala:67)
at io.gatling.app.Gatling$.fromArgs(Gatling.scala:53)
at io.gatling.app.Gatling$.main(Gatling.scala:44)
at io.gatling.app.Gatling.main(Gatling.scala)
Any Idea on what happened ?
Thx