This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new af9fd14  Tweak and comment Gatling test
af9fd14 is described below

commit af9fd14884ab97a4d6e1c5fbf01088e5caae283f
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Thu Sep 6 11:17:03 2018 +0200

    Tweak and comment Gatling test
---
 .../test/scala/sling/PostServletSimulation.scala   | 24 +++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git 
a/karate-http-testing/src/test/scala/sling/PostServletSimulation.scala 
b/karate-http-testing/src/test/scala/sling/PostServletSimulation.scala
index 7455e10..979e363 100644
--- a/karate-http-testing/src/test/scala/sling/PostServletSimulation.scala
+++ b/karate-http-testing/src/test/scala/sling/PostServletSimulation.scala
@@ -14,11 +14,23 @@ import scala.concurrent.duration._
  */
 class PostServletSimulation extends Simulation {
 
+  // Declare path patterns used by our Karate tests, to group similar
+  // requests in the Gatling report. Optionally add delays to specific
+  // HTTP request methods.
   val protocol = karateProtocol(
-    "/createContentTest/*" -> pauseFor("post" -> 2, "get" -> 5, "delete" -> 2),
-    "/importContentTest/*" -> pauseFor("post" -> 7, "get" -> 15, "delete" -> 
50),
+    "/createContentTest/{folder}/{testResource}" -> pauseFor("post" -> 0),
+    "/createContentTest/{folder}" -> pauseFor("post" -> 0),
+    "/importContentTest/{folder}/{testResource}" -> pauseFor("post" -> 0),
+    "/importContentTest/{folder}" -> pauseFor("post" -> 0),
+    "/importContentTest/{folder}/{testResource}/{file}" -> pauseFor("get" -> 
0),
+    "/uploadImageTest/{folder}" -> pauseFor("delete" -> 0),
+    "/uploadImageTest/{folder}/*" -> pauseFor("get" -> 0),
+    "/uploadImageTest/{folder}/{file}" -> pauseFor("get" -> 0),
+    "/uploadImageTest/{folder}/{file}/{details}" -> pauseFor("get" -> 0),
+    "/uploadImageTest/{folder}/{file}/file/jcr:data" -> pauseFor("get" -> 0)
   )
 
+  // Which Karate features do we want to test?
   val createContent = scenario("create")
     .exec(
       karateFeature("classpath:sling/postservlet/createContent.feature")
@@ -27,9 +39,15 @@ class PostServletSimulation extends Simulation {
     .exec(
       karateFeature("classpath:sling/postservlet/importContent.feature")
     )
+  val uploadImage = scenario("upload")
+    .exec(
+      karateFeature("classpath:sling/filestorage/uploadImage.feature")
+    )
 
+    // Define Gatling load models
   setUp(
     createContent.inject(rampUsers(75) over (5 seconds)).protocols(protocol),
-    importContent.inject(rampUsers(125) over (3 seconds)).protocols(protocol)
+    importContent.inject(rampUsers(125) over (3 seconds)).protocols(protocol),
+    uploadImage.inject(rampUsers(50) over (1 seconds)).protocols(protocol)
   )
 }
\ No newline at end of file

Reply via email to