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

627 weergaven
Naar het eerste ongelezen bericht

Martin Flower

ongelezen,
21 apr 2015, 08:19:0221-04-2015
aan 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

ongelezen,
21 apr 2015, 08:25:0521-04-2015
aan 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

ongelezen,
21 apr 2015, 08:58:1021-04-2015
aan 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

ongelezen,
21 apr 2015, 09:06:2721-04-2015
aan gat...@googlegroups.com
Which version of Gatling are you using ?

Martin Flower

ongelezen,
21 apr 2015, 09:10:2921-04-2015
aan gat...@googlegroups.com
2.1.4

Pierre DAL-PRA

ongelezen,
21 apr 2015, 09:15:2121-04-2015
aan 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

ongelezen,
21 apr 2015, 09:48:3721-04-2015
aan 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

ongelezen,
27 apr 2015, 10:54:5827-04-2015
aan gat...@googlegroups.com

Stéphane Landelle
Lead developer

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten