You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2014/10/30 04:39:32 UTC
[06/45] fixes to push test
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
deleted file mode 100755
index 7c411b0..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-/**
- * Performs organization registration
- *
- *
- * Produces:
- *
- * orgName The name of the created organization
- * userName The user name of the admin to log in with
- * password The password of the admin to use
- */
-object OrganizationScenarios {
-
- //register the org with the randomly generated org
- val createOrgAndAdmin = exec(http("Create Organization")
- .post("/management/organizations")
- .headers(Headers.jsonAnonymous)
- .body(StringBody("{\"organization\":\"" + Settings.org + "\",\"username\":\"${username}\",\"name\":\"${username}\",\"email\":\"${username}@apigee.com\",\"password\":\"${password}\"}"))
- .check(status.is(200)))
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/TokenScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/TokenScenarios.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/TokenScenarios.scala
deleted file mode 100755
index 9dff0df..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/TokenScenarios.scala
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-/**
- * Class that will get the token and insert it into the test session.
- * Assumes that the following values are present in the session.
- *
- * Expects:
- *
- * userName The user name to log in with
- * password The password to use
- *
- * Produces:
- *
- * authToken A valid access token if the login attempt is successful
- */
-
-object TokenScenarios {
-
-
- val getManagementToken =
- exec(
- http("POST Org Token")
- .post("/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\":\"${username}\",\"password\":\"${password}\",\"grant_type\":\"password\"}"))
- .check(jsonPath("access_token")
- .saveAs("authToken"))
- )
-
- val getUserToken =
- exec(
- http("POST user token")
- .post("/token")
- .body(StringBody("{\"grant_type\":\"password\",\"username\":\"${user1}\",\"password\":\"password\"}"))
- .check(status.is(200))
- )
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/UserScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/UserScenarios.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/UserScenarios.scala
deleted file mode 100755
index 843bc2e..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/scenarios/UserScenarios.scala
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-
-object UserScenarios {
-
- val getRandomUser = exec(
- http("GET user")
- .get("/users/user" + Utils.generateRandomInt(1, Settings.numEntities))
- .check(status.is(200))
- )
-
- val postUser = exec(
- http("POST geolocated Users")
- .post("/users")
- .body(StringBody("{\"location\":{\"latitude\":\"${latitude}\",\"longitude\":\"${longitude}\"},\"username\":\"${username}\"," +
- "\"displayName\":\"${displayName}\",\"age\":\"${age}\",\"seen\":\"${seen}\",\"weight\":\"${weight}\"," +
- "\"height\":\"${height}\",\"aboutMe\":\"${aboutMe}\",\"profileId\":\"${profileId}\",\"headline\":\"${headline}\"," +
- "\"showAge\":\"${showAge}\",\"relationshipStatus\":\"${relationshipStatus}\",\"ethnicity\":\"${ethnicity}\",\"password\":\"password\"}"))
- .check(status.is(200))
- )
-
- val postUser400ok = exec(
- http("POST geolocated Users")
- .post("/users")
- .body(StringBody("{\"location\":{\"latitude\":\"${latitude}\",\"longitude\":\"${longitude}\"},\"username\":\"${username}\"," +
- "\"displayName\":\"${displayName}\",\"age\":\"${age}\",\"seen\":\"${seen}\",\"weight\":\"${weight}\"," +
- "\"height\":\"${height}\",\"aboutMe\":\"${aboutMe}\",\"profileId\":\"${profileId}\",\"headline\":\"${headline}\"," +
- "\"showAge\":\"${showAge}\",\"relationshipStatus\":\"${relationshipStatus}\",\"ethnicity\":\"${ethnicity}\",\"password\":\"password\"}"))
- .check(status.in(200 to 400))
- )
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Headers.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Headers.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Headers.scala
deleted file mode 100755
index 319bdcf..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Headers.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-/**
- *
- */
-object Headers {
-
- /**
- * Headers for anonymous posts
- */
- val jsonAnonymous = Map(
- "Cache-Control" -> """no-cache""",
- "Content-Type" -> """application/json; charset=UTF-8"""
- )
-
- /**
- * Headers for authorized users with token and json content type
- */
- val jsonAuthorized = Map(
- "Cache-Control" -> """no-cache""",
- "Content-Type" -> """application/json; charset=UTF-8""",
- "Authorization" -> "Bearer ${authToken}"
- )
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Settings.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Settings.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Settings.scala
deleted file mode 100755
index 5588b67..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Settings.scala
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-object Settings {
-
- // Target settings
- val org = System.getProperty("org")
- val app = System.getProperty("app")
- val baseUrl = System.getProperty("baseurl")
- val httpConf = http.baseURL(baseUrl + "/" + org + "/" + app)
-
- // Simulation settings
- val numUsers:Int = Integer.getInteger("numUsers", 10).toInt
- val numEntities:Int = Integer.getInteger("numEntities", 5000).toInt
- val numDevices:Int = Integer.getInteger("numDevices", 2000).toInt
-
- val rampTime:Int = Integer.getInteger("rampTime", 0).toInt // in seconds
- val duration:Int = Integer.getInteger("duration", 300).toInt // in seconds
- val throttle:Int = Integer.getInteger("throttle", 50).toInt // in seconds
-
- // Geolocation settings
- val centerLatitude:Double = 37.442348 // latitude of center point
- val centerLongitude:Double = -122.138268 // longitude of center point
- val userLocationRadius:Double = 32000 // location of requesting user in meters
- val geosearchRadius:Int = 8000 // search area in meters
-
- // Push Notification settings
- val pushNotifier = System.getProperty("notifier")
- val pushProvider = System.getProperty("provider")
-
- def createRandomPushNotifier:String = {
- return Utils.generateUniqueName("notifier")
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Utils.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Utils.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Utils.scala
deleted file mode 100755
index 396f0b9..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/settings/Utils.scala
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import scala.util.Random
-import scala.math
-import Array._
-
-/**
- *
- * Utility for creating various data elements
- *
- */
-object Utils {
-
- private val RNG = new Random
-
- /**
- * Generate a new uuid and replace the '-' with empty
- */
- def generateUUIDString(): String = {
- return java.util.UUID.randomUUID.toString.replace("-", "")
- }
-
- /**
- * Generate a unique string with a prefix
- *
- * @param prefix
- * @return
- */
- def generateUniqueName(prefix : String): String = {
- return prefix + generateUUIDString()
- }
-
- // random number in between [a...b]
- def generateRandomInt(lowerBound: Int, upperBound: Int) = RNG.nextInt(upperBound - lowerBound) + lowerBound
-
- def generateRandomGeolocation(radius: Double, centerLatitude: Double, centerLongitude: Double):Map[String, String] = {
-
- var rd = radius / 111300 // Convert Radius from meters to degrees.
- var u = RNG.nextFloat()
- var v = RNG.nextFloat()
- var q = math.sqrt(u) * rd
- var w = q * rd
- var t = 2 * math.Pi * v
- var x = math.cos(t) * w
- var y = math.sin(t) * w
- var xp = x/math.cos(centerLatitude)
- var latitude = (y + centerLatitude).toString
- var longitude = (xp + centerLongitude).toString
- var geolocation: Map[String, String] = Map("latitude"->latitude,"longitude"->longitude)
-
- return geolocation
- }
-
- def generateRandomQueryString: String = {
-
- val queryParams = Array("age", "height", "weight")
- var queryString = ""
-
- for (numParams <- 1 to generateRandomInt(1, queryParams.length)) {
- queryString = "age=" + Utils.generateRandomInt(18, 65).toString
- if (numParams == 2) {
- queryString += "%20AND%20height=" + Utils.generateRandomInt(48, 84).toString
- } else if (numParams == 3) {
- queryString += "%20AND%20weight=" + Utils.generateRandomInt(120, 350).toString
- }
- }
-
- return queryString
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/GetEntitySimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/GetEntitySimulation.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/GetEntitySimulation.scala
deleted file mode 100644
index ac9bb7f..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/GetEntitySimulation.scala
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-class GetEntitySimulation extends Simulation {
-
- // Target settings
- val httpConf = Settings.httpConf
-
- // Simulation settings
- val numUsers:Int = Settings.numUsers
- val numEntities:Int = Settings.numEntities
- val rampTime:Int = Settings.rampTime
- val throttle:Int = Settings.throttle
-
- val feeder = FeederGenerator.generateEntityNameFeeder("user", numEntities).circular
-
- val scnToRun = scenario("GET entity")
- .exec(UserScenarios.getRandomUser)
-
- setUp(scnToRun.inject(atOnceUsers(numUsers)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf)).maxDuration(Settings.duration)
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala
deleted file mode 100755
index 0c47a32..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostDevicesSimulation.scala
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-class PostDevicesSimulation extends Simulation {
-
- // Target settings
- val httpConf = Settings.httpConf
-
- // Simulation settings
- val numUsers:Int = Settings.numUsers
- val numEntities:Int = Settings.numEntities
- val rampTime:Int = Settings.rampTime
- val throttle:Int = Settings.throttle
-
- val feeder = FeederGenerator.generateEntityNameFeeder("device", numEntities)
-
- val scnToRun = scenario("POST device")
- .feed(feeder)
- .exec(DeviceScenarios.postDeviceWithNotifier)
-
- setUp(scnToRun.inject(atOnceUsers(numUsers)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
deleted file mode 100755
index b49afc7..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PostUsersSimulation.scala
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-class PostUsersSimulation extends Simulation {
-
- // Target settings
- val httpConf = Settings.httpConf
-
- // Simulation settings
- val numUsers:Int = Settings.numUsers
- val rampTime:Int = Settings.rampTime
- val throttle:Int = Settings.throttle
-
- // Geolocation settings
- val centerLatitude:Double = Settings.centerLatitude
- val centerLongitude:Double = Settings.centerLongitude
- val userLocationRadius:Double = Settings.userLocationRadius
- val geosearchRadius:Int = Settings.geosearchRadius
-
- val feeder = FeederGenerator.generateUserWithGeolocationFeeder(numUsers, userLocationRadius, centerLatitude, centerLongitude).queue
-
- val scnToRun = scenario("POST geolocated users")
- .feed(feeder)
- .exec(UserScenarios.postUser)
-
- setUp(scnToRun.inject(atOnceUsers(numUsers)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetDeviceSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetDeviceSimulation.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetDeviceSimulation.scala
deleted file mode 100755
index 66b3c5d..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetDeviceSimulation.scala
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-/**
- *
- * Simple test for setting up multiple orgs and creating push notifications
- *
- */
-class PushNotificationTargetDeviceSimulation extends Simulation {
-
- val numUsers:Int = Settings.numUsers
- val numEntities:Int = Settings.numEntities
- val rampTime:Int = Settings.rampTime
- val throttle:Int = Settings.throttle
- val duration:Int = Settings.duration
- val httpConf = Settings.httpConf
- .acceptHeader("application/json")
-
- val createNotifier = NotifierScenarios.createNotifier
- val createDevice = DeviceScenarios.postDeviceWithNotifier
- val sendNotification = NotificationScenarios.sendNotification
-
- val deviceNameFeeder = FeederGenerator.generateEntityNameFeeder("device", numEntities).circular
-
- val scnToRun = scenario("Create Push Notification")
- .during(duration.seconds) {
- feed(deviceNameFeeder)
- .exec(sendNotification)
- }
-
-
- setUp(scnToRun.inject(atOnceUsers(numUsers)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9d6b7e1/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetUserSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetUserSimulation.scala b/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetUserSimulation.scala
deleted file mode 100644
index fd565ba..0000000
--- a/stack/loadtests/simulations/test/scala/org/apache/usergrid/simulations/PushTargetUserSimulation.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import scala.concurrent.duration._
-
-class PushNotificationTargetUserSimulation extends Simulation {
-
- val numUsers:Int = Settings.numUsers
- val numEntities:Int = Settings.numEntities
- val rampTime:Int = Settings.rampTime
- val throttle:Int = Settings.throttle
- val duration:Int = Settings.duration
- val httpConf = Settings.httpConf
- .acceptHeader("application/json")
-
- val notifier = Settings.pushNotifier
- val createDevice = DeviceScenarios.postDeviceWithNotifier400ok
- val sendNotification = NotificationScenarios.sendNotification
- val createUser = UserScenarios.postUser400ok
- val deviceNameFeeder = FeederGenerator.generateEntityNameFeeder("device", numEntities).circular
- val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(numEntities, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
-
- val scnToRun = scenario("Create Push Notification")
- .feed(userFeeder)
- .exec(createUser)
- .pause(1000)
- .exec(http("Check user and user devices")
- .get("/users/${username}/devices")
- .check(status.is(200))
- )
- .feed(deviceNameFeeder)
- .exec(createDevice)
- .pause(1000)
- .exec(http("Check device connections")
- .get("/devices/${entityName}/users")
- .check(status.is(200))
- )
- .exec(http("Connect user with device")
- .post("/users/${username}/devices/${entityName}")
- .check(status.is(200))
- )
- .exec(http("Send Notification to All Devices")
- .post("/users/${username}/notifications")
- .body(StringBody("{\"payloads\":{\"" + notifier + "\":\"testmessage\"}}"))
- .check(status.is(200))
- )
-
-
- setUp(scnToRun.inject(constantUsersPerSec(numUsers) during (duration)).throttle(reachRps(throttle) in (rampTime.seconds)).protocols(httpConf))
-
-}