java - 使用 Zerocode 运行 Junit 测试套件

标签 java junit zerocode

我正在尝试使用 Zerocode 对 Junit(4) 运行负载测试。我能够按照这些教程运行现有的 Junit 测试类

我有一个正常工作的 Junit 测试套件,我想知道如何使用 Zerocode 来启动这个测试套件,以便它将运行所有测试类中的所有测试以进行负载测试。上面的示例描述了如何运行选定的测试方法或仅运行少数测试方法。

最佳答案

我认为你不能用 Zerocode 来做到这一点。

如果您想重用 JUnit 测试,您需要创建一个 LoadScenario 测试类。在此类中,您需要告知要使用哪个测试以及应该运行哪个方法。

例如

@LoadWith("load_generation.properties")
@TestMapping(testClass = PostCorpLoanServiceTest.class, testMethod = "testPostNewLoan_crudOperations")
@TestMapping(testClass = PutCorpLoanServiceTest.class, testMethod = "testPutAmendExistingLoan")
@TestMapping(testClass = GetScreeningServiceTest.class, testMethod = "testGetScreeningLocalAndGlobal")
@RunWith(ZeroCodeMultiLoadRunner.class)
public class JunitParallelMultiScenarioTest {

}

看看 github 上托管的这个存储库: https://github.com/authorjapps/performance-tests 。 它是 ZeroCode 框架(框架的负载测试部分)的展示项目。它包含在 Zerocode 框架的帮助下创建的负载测试示例。

关于java - 使用 Zerocode 运行 Junit 测试套件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58657690/

相关文章:

java - Rest Api 负载测试 Zerocode tdd 给出错误消息

java.lang.AssertionError : expected:<200> but was:<404> in jersey restful services unit test

java - 调用Java方法

java - 无法读取上传到 Azure Blob 的文件

java - 访问 Shoutcast 当前流信息

java - Mockito - 方法内的测试方法

java - Mockito 显示与 mock 的交互为 0

java - 我需要在 JUnit 测试中专注于测试 "public"方法还是 "private"方法?