Gatling IDE Integration

Hey,

im trying to build and run the script inside eclipse, but unfortunately i got no simulation script found.

i changed IDEPathHelper to have my simulation folder.

import scala.tools.nsc.io.File
import scala.tools.nsc.io.Path.string2path

object IDEPathHelper {

val gatlingConfUrl = getClass.getClassLoader.getResource(“recorder.conf”).getPath
val projectRootDir = File(gatlingConfUrl).parents(2)

val mavenSourcesDirectory = projectRootDir / “simulations”
val mavenResourcesDirectory = projectRootDir
val mavenTargetDirectory = projectRootDir / “target”
val mavenBinariesDirectory = mavenTargetDirectory / “test-classes”

val dataDirectory = mavenResourcesDirectory / “data”
val requestBodiesDirectory = mavenResourcesDirectory / “request-bodies”

val recorderOutputDirectory = mavenSourcesDirectory
val resultsDirectory = mavenTargetDirectory / “results”

val recorderConfigFile = (mavenResourcesDirectory / “recorder.conf”).toFile
}

and changed Engine.scala to pick it up

import io.gatling.app.Gatling
import io.gatling.core.config.GatlingPropertiesBuilder

object Engine extends App {

val props = new GatlingPropertiesBuilder
System.out.println(IDEPathHelper.mavenSourcesDirectory.toString)
props.sourcesDirectory(IDEPathHelper.mavenSourcesDirectory.toString) // by default this line is not there.
props.dataDirectory(IDEPathHelper.dataDirectory.toString)
props.resultsDirectory(IDEPathHelper.resultsDirectory.toString)
props.requestBodiesDirectory(IDEPathHelper.requestBodiesDirectory.toString)
props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)

Gatling.fromMap(props.build)
}

my simulations folder is parallel to src folder (for some reason i cant change that). to run engine.scala, i always got this message: There is no simulation script. Please check that your scripts are in user-files/simulations.

if i put my simulations into /src/test/scala, engine.scala can pick it up.

Any ideas why it can’t use projectRootDir / “simulations” as the simulation folder?

Thanks,

Is your project a Scala project?
This IDE support assumes that your IDE compiles the scala classes for you. Is suspect your simulation folder is not a source one.

if i put the same simulation folder under src, engine.scala could find it and execute it.

not sure what you mean whether my project is a scala project. i created the project by maven → archetype project → mvn clean install. im using scala IDE from here: http://scala-ide.org/

everything works fine if i put simulation folder under src, but parallel to src doesnt work. and use this props.sourcesDirectory(IDEPathHelper.mavenSourcesDirectory.toString) to set source directory doesnt work. so engine.scala can only find recognize simulations under src folder?