generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from Arquisoft/feture/41_gatling_tests
Feture/41 gatling tests -- Issue #41
- Loading branch information
Showing
23 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
syg-backend/SYG-rest-controller/src/test/java/simulations/CategoryGatlingTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package simulations; | ||
|
||
import static io.gatling.javaapi.core.CoreDsl.*; | ||
import static io.gatling.javaapi.http.HttpDsl.*; | ||
|
||
import io.gatling.javaapi.core.*; | ||
import io.gatling.javaapi.http.*; | ||
|
||
public class CategoryGatlingTests extends Simulation { | ||
|
||
private static final String BASE_URL = "http://localhost:8080"; | ||
|
||
HttpProtocolBuilder httpProtocol = http.baseUrl(BASE_URL).acceptHeader("application/json") | ||
.contentTypeHeader("application/json"); | ||
|
||
ScenarioBuilder findAllCategories = scenario("Encuentra todas las categorias") | ||
.exec(http("findAllCategories").get("/category").check(status().is(200))); | ||
ScenarioBuilder findCategoryById = scenario("Encuentra una categoria por id") | ||
.exec(http("findCategoryById").get("/category/id?id=1").check(status().is(200))); | ||
{ | ||
setUp(findAllCategories.injectOpen( | ||
// Incrementa el número de usuarios rápidamente | ||
incrementUsersPerSec(5).times(12) // Incremento de usuarios por segundo 12 veces (1 minuto) | ||
.eachLevelLasting(5) // Cada nivel dura 5 segundos | ||
.startingFrom(10) // Comienza con 10 usuarios por segundo | ||
), findCategoryById.injectOpen( | ||
incrementUsersPerSec(5).times(12).eachLevelLasting(5).startingFrom(10))).protocols(httpProtocol) | ||
.maxDuration(300); | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
syg-backend/SYG-rest-controller/src/test/java/simulations/QuestionGatlingTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package simulations; | ||
|
||
import static io.gatling.javaapi.core.CoreDsl.*; | ||
import static io.gatling.javaapi.http.HttpDsl.*; | ||
|
||
import io.gatling.javaapi.core.*; | ||
import io.gatling.javaapi.http.*; | ||
|
||
public class QuestionGatlingTests extends Simulation { | ||
|
||
private static final String BASE_URL = "http://localhost:8080"; | ||
|
||
HttpProtocolBuilder httpProtocol = http.baseUrl(BASE_URL).acceptHeader("application/json") | ||
.contentTypeHeader("application/json"); | ||
|
||
ScenarioBuilder findAllQuestions = scenario("Encuentra todas las preguntas") | ||
.exec(http("findAllQuestions").get("/question").check(status().is(200))); | ||
ScenarioBuilder findQuestionById = scenario("Encuentra una pregunta por su id") | ||
.exec(http("findQuestionById").get("/question/id?id=200").check(status().is(200))); | ||
ScenarioBuilder findQuestionByCategory = scenario("Encuentra una pregunta por su categoria") | ||
.exec(http("findQuestionByCategory").get("/question/category?categoryId=1").check(status().is(200))); | ||
{ | ||
setUp(findAllQuestions.injectOpen(incrementUsersPerSec(5).times(12).eachLevelLasting(5).startingFrom(10)), | ||
findQuestionById.injectOpen(incrementUsersPerSec(5).times(12).eachLevelLasting(5).startingFrom(10)), | ||
findQuestionByCategory | ||
.injectOpen(incrementUsersPerSec(5).times(12).eachLevelLasting(5).startingFrom(10))) | ||
.protocols(httpProtocol).maxDuration(300); | ||
|
||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
syg-backend/SYG-rest-controller/src/test/java/simulations/UserGatlingTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package simulations; | ||
|
||
import static io.gatling.javaapi.core.CoreDsl.*; | ||
import static io.gatling.javaapi.http.HttpDsl.*; | ||
|
||
import io.gatling.javaapi.core.*; | ||
import io.gatling.javaapi.http.*; | ||
|
||
public class UserGatlingTests extends Simulation { | ||
|
||
private static final String BASE_URL = "http://localhost:8080"; | ||
|
||
HttpProtocolBuilder httpProtocol = http.baseUrl(BASE_URL).acceptHeader("application/json") | ||
.contentTypeHeader("application/json"); | ||
|
||
ScenarioBuilder findUserById = scenario("Encuentra un usuario por su uuid").exec( | ||
http("findUserById").get("/user/userId?id=4366fdc8-b32d-46bc-9df8-2e8ce68f0743").check(status().is(200))); | ||
ScenarioBuilder findUserByName = scenario("Encuentra un usuario por nombre") | ||
.exec(http("findUserByName").get("/user/name/?userName=alvaro").check(status().is(200))); | ||
|
||
{ | ||
setUp(findUserById.injectOpen(incrementUsersPerSec(5).times(12).eachLevelLasting(5).startingFrom(10)), | ||
findUserByName.injectOpen(incrementUsersPerSec(5).times(12).eachLevelLasting(5).startingFrom(10))) | ||
.protocols(httpProtocol).maxDuration(300); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters