diff --git a/src/main/scala-2.11/org/apache/james/gatling/control/UserCreator.scala b/src/main/scala-2.11/org/apache/james/gatling/control/UserCreator.scala index f76924a6..63036ad0 100644 --- a/src/main/scala-2.11/org/apache/james/gatling/control/UserCreator.scala +++ b/src/main/scala-2.11/org/apache/james/gatling/control/UserCreator.scala @@ -11,7 +11,7 @@ import scala.util.Success class UserCreator(val baseJamesWebAdministrationUrl: URL) { private val jamesWebAdministration = new JamesWebAdministration(baseJamesWebAdministrationUrl) - def createUsersWithInboxAndOutbox(userCount: Int): Seq[Future[User]] = + def createUsersWithSystemMailboxes(userCount: Int): Seq[Future[User]] = createUsers(userCount) .map(userFuture => userFuture.andThen { case Success(user) => registerSystemMailboxes(user) diff --git a/src/main/scala-2.11/org/apache/james/gatling/jmap/JmapMailboxes.scala b/src/main/scala-2.11/org/apache/james/gatling/jmap/JmapMailboxes.scala index 4088bcd2..159eff4d 100644 --- a/src/main/scala-2.11/org/apache/james/gatling/jmap/JmapMailboxes.scala +++ b/src/main/scala-2.11/org/apache/james/gatling/jmap/JmapMailboxes.scala @@ -85,6 +85,9 @@ object JmapMailboxes { def getSystemMailboxes = getMailboxes + def getMailboxesWithRetryAuthentication(expectedNumberOfMailboxes: Int) = + execWithRetryAuthentication(getMailboxes, getMailboxesChecks(expectedNumberOfMailboxes)) + def getSystemMailboxesWithRetryAuthentication = execWithRetryAuthentication(getSystemMailboxes, getSystemMailboxesChecks) def getSystemMailboxesWithChecks = getSystemMailboxes.check(getSystemMailboxesChecks: _*) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAllScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAllScenario.scala index d063d5db..685ce0eb 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAllScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAllScenario.scala @@ -11,7 +11,7 @@ import scala.concurrent.duration._ class JmapAllScenario extends Simulation { private val loopVariableName = "any" - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val scn = scenario("JmapAllScenarios") .exec(CommonSteps.provisionSystemMailboxes(users)) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAuthenticationScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAuthenticationScenario.scala index 5bae3713..3e211613 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAuthenticationScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapAuthenticationScenario.scala @@ -9,7 +9,7 @@ import org.apache.james.gatling.jmap.scenari.common.Configuration._ class JmapAuthenticationScenario extends Simulation { val scn = scenario("JmapAuthentication") - .exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount))) + .exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount))) setUp(scn.inject(atOnceUsers(UserCount))).protocols(HttpSettings.httpProtocol) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapBigSetScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapBigSetScenario.scala index 5e86cd31..3d5b430d 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapBigSetScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapBigSetScenario.scala @@ -27,7 +27,7 @@ import org.apache.james.gatling.jmap.Name */ class JmapBigSetScenario extends Simulation { - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val scn = scenario("JMAP scenario on multiple mailboxes containing multiple messages") .exec(CommonSteps.provisionUsersWithMailboxesAndMessages(users, NumberOfMailboxes, NumberOfMessages)) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMailboxesHugeNumberScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMailboxesHugeNumberScenario.scala new file mode 100644 index 00000000..8c8024e0 --- /dev/null +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMailboxesHugeNumberScenario.scala @@ -0,0 +1,24 @@ +package org.apache.james.gatling.jmap.scenari + +import io.gatling.core.Predef._ +import org.apache.james.gatling.control.UserCreator +import org.apache.james.gatling.jmap.JmapMailboxes +import org.apache.james.gatling.jmap.scenari.common.Configuration._ +import org.apache.james.gatling.jmap.scenari.common.{CommonSteps, HttpSettings} + +import scala.concurrent.duration._ + +class JmapGetMailboxesHugeNumberScenario extends Simulation { + val userNumber = 2 + val mailboxesNumber = 2000 + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(userNumber) + + val scn = scenario("JmapGetMailboxesHugeNumber") + .exec(CommonSteps.provisionUsersWithMailboxesAndMessages(users, mailboxesNumber, 1)) + .during(ScenarioDuration) { + JmapMailboxes.getMailboxesWithRetryAuthentication(mailboxesNumber + 3) + .pause(1 second , 2 seconds) + } + + setUp(scn.inject(atOnceUsers(userNumber))).protocols(HttpSettings.httpProtocol) +} diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMailboxesScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMailboxesScenario.scala index 8434145e..0819df3d 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMailboxesScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMailboxesScenario.scala @@ -11,7 +11,7 @@ import scala.concurrent.duration._ class JmapGetMailboxesScenario extends Simulation { val scn = scenario("JmapGetMailboxes") - .exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount))) + .exec(CommonSteps.authentication(new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount))) .during(ScenarioDuration) { JmapMailboxes.getSystemMailboxesWithRetryAuthentication .pause(1 second , 2 seconds) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessageListScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessageListScenario.scala index 41d5fde9..6a00cf90 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessageListScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessageListScenario.scala @@ -11,7 +11,7 @@ import org.apache.james.gatling.utils.RetryAuthentication._ class JmapGetMessageListScenario extends Simulation { - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val scn = scenario("JmapGetMessagesLists") .exec(CommonSteps.provisionUsersWithMessages(users)) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessagesScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessagesScenario.scala index 202e5f98..861e73e0 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessagesScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapGetMessagesScenario.scala @@ -11,7 +11,7 @@ import org.apache.james.gatling.utils.RetryAuthentication._ class JmapGetMessagesScenario extends Simulation { - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val scn = scenario("JmapGetMessages") .exec(CommonSteps.provisionUsersWithMessageList(users)) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapMessageUpdateScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapMessageUpdateScenario.scala index f094df28..74e8c7df 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapMessageUpdateScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapMessageUpdateScenario.scala @@ -10,7 +10,7 @@ import scala.concurrent.duration._ class JmapMessageUpdateScenario extends Simulation { - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val scn = scenario("JmapUpdateMessages") .exec(CommonSteps.provisionUsersWithMessageList(users)) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapQueueBrowseScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapQueueBrowseScenario.scala index be37e36a..e663d14c 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapQueueBrowseScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapQueueBrowseScenario.scala @@ -10,7 +10,7 @@ import scala.concurrent.duration._ class JmapQueueBrowseScenario extends Simulation { - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val webAdmin = new JamesWebAdministrationQuery(BaseJamesWebAdministrationUrl) diff --git a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapSendMessagesScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapSendMessagesScenario.scala index c09cdef0..bdeb5d73 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapSendMessagesScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/jmap/scenari/JmapSendMessagesScenario.scala @@ -10,7 +10,7 @@ import scala.concurrent.duration._ class JmapSendMessagesScenario extends Simulation { - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val scn = scenario("JmapSendMessages") .exec(CommonSteps.provisionSystemMailboxes(users)) diff --git a/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionBigBodyScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionBigBodyScenario.scala index a4997dc4..534f0a16 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionBigBodyScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionBigBodyScenario.scala @@ -15,7 +15,7 @@ class NoAuthenticationNoEncryptionBigBodyScenario extends Simulation { def generateMessage() : String = myRandom.grouped(200).flatMap(_.append(Stream('\r', '\n'))).take(1024 * 1024).mkString - private val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + private val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) private val scn = scenario("SMTP_No_Authentication_No_Encryption_Big_Body") .feed(UserFeeder.createCompletedUserFeederWithInboxAndOutbox(users)) diff --git a/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionScenario.scala b/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionScenario.scala index 46add4bc..9d5074d1 100644 --- a/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionScenario.scala +++ b/src/test/scala-2.11/org/apache/james/gatling/smtp/scenari/NoAuthenticationNoEncryptionScenario.scala @@ -9,7 +9,7 @@ import scala.concurrent.duration._ class NoAuthenticationNoEncryptionScenario extends Simulation { - val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithInboxAndOutbox(UserCount) + val users = new UserCreator(BaseJamesWebAdministrationUrl).createUsersWithSystemMailboxes(UserCount) val scn = scenario("SMTP_No_Authentication_No_Encryption") .feed(UserFeeder.createCompletedUserFeederWithInboxAndOutbox(users))