usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [20/50] git commit: add additional settings
Date Thu, 06 Nov 2014 00:15:06 GMT
add additional settings


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3bfa4406
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3bfa4406
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3bfa4406

Branch: refs/heads/two-dot-o
Commit: 3bfa44066c0e6ae4d78f2c7c83c7e593b991c94e
Parents: 4082891
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Mon Nov 3 08:17:00 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Mon Nov 3 08:17:00 2014 -0700

----------------------------------------------------------------------
 .../scenarios/OrganizationScenarios.scala       |  4 ++--
 .../org/apache/usergrid/settings/Settings.scala |  2 ++
 .../PushNotificationTargetUserSimulation.scala  | 21 +++++++++++++++-----
 3 files changed, 20 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3bfa4406/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
index 8326d70..8761e18 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
@@ -37,7 +37,7 @@ object OrganizationScenarios {
   val createOrgAndAdmin = exec(http("Create Organization")
     .post(Settings.baseUrl+"/management/organizations")
     .headers(Headers.jsonAnonymous)
-    .body(StringBody("{\"organization\":\"" + Settings.org + "\",\"username\":\"" + Settings.org
+ "\",\"name\":\"${entityName}\",\"email\":\"${entityName}@apigee.com\",\"password\":\"test\"}"))
+    .body(StringBody("{\"organization\":\"" + Settings.org + "\",\"username\":\"" + Settings.admin
+ "\",\"name\":\"${entityName}\",\"email\":\"${entityName}@apigee.com\",\"password\":\""+Settings.password+"\"}"))
     .check(status.in(200 to 400))
   )
 
@@ -45,7 +45,7 @@ object OrganizationScenarios {
     .post(Settings.baseUrl+"/management/token")
     .headers(Headers.jsonAnonymous)
     //pass in the the username and password, store the "access_token" json response element
as the var "authToken" in the session
-    .body(StringBody("{\"username\":\"" + Settings.org + "\",\"password\":\"test\",\"grant_type\":\"password\"}"))
+    .body(StringBody("{\"username\":\"" + Settings.admin + "\",\"password\":\"test\",\"grant_type\":\"password\"}"))
     .check(jsonPath("$.access_token").find(0).saveAs("authToken"))
   )
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3bfa4406/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
index 1f3add5..df8d808 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala
@@ -25,6 +25,8 @@ object Settings {
   // Target settings
   val org = System.getProperty("org")
   val app = System.getProperty("app")
+  val admin = System.getProperty("adminUser")
+  val password = System.getProperty("adminPassword")
   val baseUrl = System.getProperty("baseurl")
   val baseAppUrl = baseUrl + "/" + org + "/" + app
   val httpConf = http.baseURL(baseAppUrl)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3bfa4406/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
index 6ba55be..16c5bc3 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
@@ -55,8 +55,14 @@ class PushNotificationTargetUserSimulation extends Simulation {
     .feed(orgFeeder)
     .exec(createOrg)
     .exec(getManagementToken)
+    .exec(session => {
+      // print the Session for debugging, don't do that on real Simulations
+      println(session)
+      session
+    })
     .exec(createApp)
-    .exec(createNotifier)
+    .exec(createNotifier).inject(atOnceUsers(1))
+    .protocols(http.baseURL(Settings.baseUrl))
 
   val scnToRun = scenario("Create Push Notification")
     .feed(userFeeder)
@@ -67,11 +73,16 @@ class PushNotificationTargetUserSimulation extends Simulation {
         .exec(createDevice)
         .exec(connectUserToDevice)
       }
+    .exec(session => {
+      // print the Session for debugging, don't do that on real Simulations
+      println(session)
+      session
+    })
     .exec(sendNotification)
+    .inject(nothingFor(15),constantUsersPerSec(numUsersPerSecond) during (duration))
+    .throttle(reachRps(throttle) in (rampTime.seconds))
+    .protocols(httpConf)
 
-  setUp(
-    scnCreateOrg.inject(atOnceUsers(1)).protocols(http.baseURL(Settings.baseUrl)),
-    scnToRun.inject(nothingFor(15), constantUsersPerSec(numUsersPerSecond) during (duration))
-      .throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))
+  setUp(scnCreateOrg,scnToRun)
 
 }


Mime
View raw message