remove lombok, update scripts threads

This commit is contained in:
Loredana
2020-10-09 15:48:30 +03:00
parent e663f89592
commit 68f35280c3
9 changed files with 64 additions and 45 deletions
@@ -0,0 +1,7 @@
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
@@ -17,7 +17,8 @@ class RewardsScenario extends Simulation {
.userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0")
val scn = scenario("RewardsScenario")
.repeat(10){
.repeat(100){
exec(http("transactions_add")
.post("/transactions/add/")
.body(StringBody(_ => s"""{ "customerRewardsId":null,"customerId":"${randCustId()}","transactionDate":null }""")).asJson
@@ -36,14 +37,14 @@ class RewardsScenario extends Simulation {
.check(jsonPath("$.id").saveAs("rwdId")))
}
.exec(http("transactions_add")
.exec(http("transactions_update")
.post("/transactions/add/")
.body(StringBody("""{ "customerRewardsId":"${rwdId}","customerId":"${custId}","transactionDate":"${txtDate}" }""")).asJson)
.exec(http("get_reward")
.exec(http("get_transactions")
.get("/transactions/findAll/${rwdId}"))
}
setUp(
scn.inject(atOnceUsers(100))
).protocols(httpProtocol)
}
}
@@ -16,7 +16,7 @@
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">10</stringProp>
<stringProp name="LoopController.loops">100</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">100</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
@@ -1,5 +1,5 @@
grinder.script = grinder.py
grinder.threads = 100
grinder.processes = 1
grinder.runs = 10
grinder.runs = 100
grinder.logDirectory = /logs
@@ -21,20 +21,24 @@ request1.setHeaders(headers)
utilities = HTTPPluginControl.getHTTPUtilities()
test1.record(request1)
random=java.util.Random()
log = grinder.logger.info
class TestRunner:
def __call__(self):
customerId = str(random.nextInt());
customerId = str(random.nextInt());
result = request1.POST("http://localhost:8080/transactions/add", "{"'"customerRewardsId"'":null,"'"customerId"'":"+ customerId + ","'"transactionDate"'":null}")
txnId = parseJsonString(result.getText(), "id")
result = request1.GET("http://localhost:8080/rewards/find/"+ customerId)
rwdId = parseJsonString(result.getText(), "id")
log("rwdid %s" % rwdId)
if rwdId == "":
result = request1.POST("http://localhost:8080/rewards/add", "{"'"customerId"'":"+ customerId + "}")
rwdId = parseJsonString(result.getText(), "id")
result = request1.POST("http://localhost:8080/transactions/add", "{"'"id"'":" + txnId + ","'"customerRewardsId"'":" + rwdId + ","'"customerId"'":"+ customerId + ","'"transactionDate"'":null}")
result = request1.GET("http://localhost:8080/transactions/findAll/" + rwdId)
result = request1.GET("http://localhost:8080/transactions/findAll/" + rwdId)