Migrating to snapshot

I’m currently migrating from 2M3a to snapshot and running into a few problems:

I’m unable to import external libraries, e.g., at import org.apache.commons.lang._ I get the following error: object lang is not a member of package org.apache.commons

I’m also getting not found: value atOnce and the same for constantRate. I’m still calling them the same way as before - will changing from atOnce(x users) to atOnce(x) fix it?

I'm unable to import external libraries, e.g., at import
org.apache.commons.lang._ I get the following error: object lang is not a
member of package org.apache.commons

How do you run Gatling and how did you ship commons-lang (that Gatling
doesn't ship itself)?

I'm also getting not found: value atOnce and the same for constantRate. I'm

still calling them the same way as before - will changing from atOnce(x
users) to atOnce(x) fix it?

https://github.com/excilys/gatling/wiki/Gatling%202#snapshot

I run bin/gatling.sh and use the simulation menu. And I didn’t do anything before other than add the import statements - maybe 2M3a was using it and snapshot doesn’t? Dropped the commons-lang jar into $GATLING_HOME/lib and still having the same problem.

Since the migration documentation is a little brief, full list of new names in injection API, for future reference:


rampUsers(users: Int)
heavisideUsers(users: Int)
atOnceUsers(users: Int)
splitUsers(users: Int)
constantUsersPerSec(rate: Double)
rampUsersPerSec(rate1: Double)
nothingFor(d: FiniteDuration)

maybe 2M3a was using it and snapshot doesn't?

Yes, that's it.

Dropped the commons-lang jar into $GATLING_HOME/lib and still having the
same problem.

Should work.
Maybe you have to touch the Simulation file in order to trigger
recompilation.

Touched all of my source files, lib/ and all of the jars, and checked to make sure CLASSPATH is being set properly. Still thinks there’s no such thing as lang. I’m sure it’s recompiling, because my other compiler errors have disappeared.

That’s weird.
Are you sure that the commons-lang jar you placed in lib is fine (that it’s binaries and not sources and that it’s not corrupted and can properly be decompressed)?

Same problem and solution as here.

Accidentally downloaded commons-lang3 instead of commons-lang 2.6, thanks to both of them being on the “download Apache commons lang” page with no note of the package name changing between versions. That took up way too much of my day. Wouldn’t have caught it if I hadn’t extracted the jar, though - thanks!

Yeah, sometimes when things just don’t make sense, a little perspective can help :slight_smile:
Glad you could solve this mystery.

Shoot, one last (hopefully) error:

check(regex("<input type=“hidden” name=“SAMLResponse” value="([^"]+)"")
.transform(.map(StringEscapeUtils.unescapeHtml()))
.saveAs(“SAMLResponse”)

throws the following:

type mismatch;
found : Char
required: String

transform 2M3 signature was too cumbersome for most use cases.

Now transform is (T1 => T2) and fullTransform is (Option[T1] => Option[T2])

So that’s:
.transform(StringEscapeUtils.unescapeHtml)

or (but in this case I wouldn’t advice so):
.fullTransform(_.map(StringEscapeUtils.unescapeHtml))

Fantastic, looks like everything’s up and running! Thank you so much!

Glad I could help.
have fun!

@Michelle - Thanks for posting this!

No problem! I realized earlier today that it’s not actually complete (I just did a quick copy/paste at the time, apparently without paying attention), though. Here are the full signatures as they’re actually used:

Ah, I was wondering which ones could be used with qualifiers.

What is “heavisideUsers”? Have you tried using that one?

I haven’t used it, but there’s some information on it here.

Thank you very much.