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

627 views
Skip to first unread message

Martin Flower

unread,
Apr 21, 2015, 8:19:02 AM4/21/15
to gat...@googlegroups.com
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

Pierre DAL-PRA

unread,
Apr 21, 2015, 8:25:05 AM4/21/15
to gat...@googlegroups.com
Are you sure that the JAR with your simulations is in the test classpath of your project ?

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Flower

unread,
Apr 21, 2015, 8:58:10 AM4/21/15
to gat...@googlegroups.com
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

<build>
 <testSourceDirectory>src/test/scala</testSourceDirectory>

 <testResources>

  <testResource>
   <directory>src/test/resources</directory>

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

  <dependencies>
.. ..
    <dependency>
      <groupId>se.skltp.agp</groupId>
      <artifactId>agp-test-non-functional</artifactId>
      <version>1.3.0-RC2-SNAPSHOT</version>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>
  </dependencies>


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

<profile>
 <id>PingForConfiguration</id>
 <properties>
   <simulationClass>se.skltp.agp.testnonfunctional.TP01PingForConfiguration</simulationClass>
 </properties>
</profile>




You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/hPQhX3Ptcvc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+u...@googlegroups.com.

Pierre DAL-PRA

unread,
Apr 21, 2015, 9:06:27 AM4/21/15
to gat...@googlegroups.com
Which version of Gatling are you using ?

Martin Flower

unread,
Apr 21, 2015, 9:10:29 AM4/21/15
to gat...@googlegroups.com
2.1.4

Pierre DAL-PRA

unread,
Apr 21, 2015, 9:15:21 AM4/21/15
to gat...@googlegroups.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

Martin Flower

unread,
Apr 21, 2015, 9:48:37 AM4/21/15
to gat...@googlegroups.com
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.

Stéphane LANDELLE

unread,
Apr 27, 2015, 10:54:58 AM4/27/15
to gat...@googlegroups.com

Stéphane Landelle
Lead developer

Reply all
Reply to author
Forward
0 new messages