Simulation is packaged in a jar file - can the gatling-maven-plugin execute it?

I am looking to publish Simulations in a common component (for example, a jar file) which can then be invoked from a number of different projects. The basic logic is the same, the parameters will vary. I am hoping to execute the Simulations using the gatling-maven-plugin.

I have worked out how to compile the Scala Simulations and package them in a jar. But when I try to execute the Simulation from the gatling-maven-plugin, I see an error that the requested class cannot be found in. I then thought that Gatling is looking for .scala files rather than .class files, so have added the .scala files to the jar, but the same error is shown.

Can this be done? How?

/Cheers

/Martin

Are you sure that the JAR with your simulations is in the test classpath of your project ?

Hi Pierre,

this is probably more of a maven question (which I am a bit ignorant of)

I have reviewed the pom that builds the jar, and now have the following

src/test/scala src/test/resources

This builds a jar ending -tests.jar which contains .scala files (which I have copied from test/scala folder to the test/resources folder) with the right package names, along with bodies and data.

I have reviewed the pom that attempts to execute the test using the gatling-maven-plugin which now contains

.. .. se.skltp.agp agp-test-non-functional 1.3.0-RC2-SNAPSHOT test test-jar

There are no complaints from maven about not finding the jar, and gatling starts, but cannot find the named test

PingForConfiguration se.skltp.agp.testnonfunctional.TP01PingForConfiguration

21 apr 2015 kl. 14:25 skrev Pierre DAL-PRA <dalpra.pierre@gmail.com>:

Are you sure that the JAR with your simulations is in the test classpath of your project ?

Which version of Gatling are you using ?

2.1.4

21 apr 2015 kl. 15:06 skrev Pierre DAL-PRA <dalpra.pierre@gmail.com>:

Which version of Gatling are you using ?

Please upgrade your Gatling Maven Plugin to 2.1.5.
Also, Gatling won’t search for Scala sources in JARs, only compiled classes.

Cheers,

Pierre

Hi Pierre, thanks for the clarification about .scala and .class files

I’m now running with gatling 2.1.5 and galting-maven-plugin 2.1.5. I have manually built a jar file -test.jar containing .class files and the required resources, but still get the same error.

However, now that I know that gatling is looking for .class files in the jars listed in the pom dependencies, this narrows down the problem, so I should be eventually able to crack the problem.

21 apr 2015 kl. 15:15 skrev Pierre DAL-PRA <dalpra.pierre@gmail.com>:

Please upgrade your Gatling Maven Plugin to 2.1.5.
Also, Gatling won’t search for Scala sources in JARs, only compiled classes.

Cheers,

Pierre

Fixed: https://github.com/gatling/gatling/issues/2694