Created
September 22, 2014 07:15
-
-
Save maiha/bea79ddc4225e2fefd37 to your computer and use it in GitHub Desktop.
FastCharSequence breaks EL (gatling-snapshot)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
class Maiha extends Simulation { | |
val top = | |
exec(http("gatling.io") | |
.get("/") | |
.check(regex("""href="(.*?)"""").saveAs("url")) // should be "/assets/images/favicon.ico" | |
) | |
.exec(http("1st link") | |
.get("/${url}") // this builds "/io.gatling.core.util.FastCharSequence@73a658d1" | |
.check(status.is(200)) | |
) | |
val scn = scenario("once").exec(top) | |
val prt = http.baseURL("http://gatling.io") | |
setUp(scn.inject(atOnceUsers(1))).protocols(prt) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./bin/gatling.sh -nr -s Maiha | |
(snip) | |
Request: | |
1st link: KO status.is(200), but actually found 404 | |
========================= | |
Session: | |
Session(once,3481976182196121905-0,Map(url -> io.gatling.core.util.FastCharSequence@1b9acccd, gatling.http.cache.expireStore -> Map(http://g\ | |
atling.io/ -> 1411369997760), gatling.http.cache.lastModifiedStore -> Map(http://gatling.io/ -> Wed, 17 Sep 2014 06:18:53 GMT), gatling.http\ | |
.referer -> http://gatling.io/io.gatling.core.util.FastCharSequence@1b9acccd, gatling.http.cookies -> CookieJar(Map())),1411369397347,49,KO,\ | |
List(),<function1>) | |
========================= | |
HTTP request: | |
GET http://gatling.io/io.gatling.core.util.FastCharSequence@1b9acccd | |
headers= | |
Referer: http://gatling.io/ | |
Connection: keep-alive | |
Host: gatling.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/gatling-core/src/main/scala/io/gatling/core/util/FastCharSequence.scala b/gatling-core/src/main/scala/io/gatling/core/util/FastC~ | |
index 3ce8ca1..301db87 100644 | |
--- a/gatling-core/src/main/scala/io/gatling/core/util/FastCharSequence.scala | |
+++ b/gatling-core/src/main/scala/io/gatling/core/util/FastCharSequence.scala | |
@@ -32,4 +32,6 @@ class FastCharSequence(chars: Array[Char], offset: Int, count: Int) extends Char | |
def charAt(index: Int): Char = chars(offset + index) | |
def subSequence(start: Int, end: Int): CharSequence = new FastCharSequence(chars, offset + start, end - start) | |
+ | |
+ override def toString: String = String.valueOf(chars, offset, count) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./bin/gatling.sh -nr -s Maiha | |
(snip) | |
========================= | |
HTTP request: | |
GET http://gatling.io//assets/images/favicon.ico | |
headers= | |
(snip) | |
> gatling.io (OK=1 KO=0 ) | |
> 1st link (OK=1 KO=0 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment