其余Api加载测试Zerocode TDD给出错误消息 [英] Rest Api load tesing Zerocode tdd giving error message

查看:83
本文介绍了其余Api加载测试Zerocode TDD给出错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使我的剩余api自动化,并寻找与junit5一起使用的性能测试框架.我遇到了zerocode tdd,但它没有帮助它给出错误,所有测试都失败了.我的测试方法是正确的,并且在由junit jupiter正常调用时有效.当我将zerocodeLoadRunner用于同一事物时,它将无法正常工作.

I'm automating my rest api and searching for a performance testing framework to use with my junit5. I came across zerocode tdd but it is not helping it's giving error and all the tests are falling under failure. My test method is proper and works when it invoked normally by junit jupiter. When I use zerocodeLoadRunner for the same thing it is not working.

    import org.jsmart.zerocode.core.domain.LoadWith;
    import org.jsmart.zerocode.core.domain.TestMapping;
    import org.jsmart.zerocode.core.runner.parallel.ZeroCodeLoadRunner;   
    import org.junit.runner.RunWith;

    @LoadWith("loadConfig.properties")

    @TestMapping(testClass = MyTest.class, testMethod = "myMethod")

    @RunWith(ZeroCodeLoadRunner.class)

    public class LoadTest  {

    }

我收到的错误消息如下.

The error message I am getting is as follows.

    2019-09-09 12:35:57,191 [main] ERROR org.jsmart.zerocode.core.runner.parallel.ZeroCodeLoadRunner - myPackage.LoadTest.myMethod Failed. See target/logs -or- junit granular failure report(csv) -or- fuzzy search and filter report(html) for details

用于此的依赖关系如下

    <dependency>
        <groupId>org.jsmart</groupId>
        <artifactId>zerocode-tdd-jupiter</artifactId>
        <version>1.3.8</version>
    </dependency>

我不想使用任何测试工具,所以我要使用它.

I don't want to use any testing tool so I'm going with this.

推荐答案

您完成的设置适用于JUnit4(但不适用于JUnit5,因为JUnit5不支持Runners).对于 JUnit5 ,您需要使用以下扩展的零代码.

The setup which you have done works for JUnit4(but not for JUnit5 as JUnit5 does not support Runners). For JUnit5, you need to use the following extention of zerocode.

@ExtendWith({ParallelLoadExtension.class})

JUnit5-Jupiter-并行加载扩展页上有确切的详细信息.请尝试以下方式:

This JUnit5-Jupiter-Parallel-Load-Extension page has the precise details. Please try the below way:

例如

@LoadWith("load_generation.properties")
@ExtendWith({ParallelLoadExtension.class})
public class JUnit5LoadCommonLoadTest {

    @Test
    @DisplayName("testing parallel load for X, Y and Z scenarios")
    @TestMappings({
            @TestMapping(testClass = JUnit5Test.class, testMethod = "testX"),
            @TestMapping(testClass = JUnit5Test.class, testMethod = "testY"),
            @TestMapping(testClass = JUnit5MoreTest.class, testMethod = "testZ")
    })
    public void testLoad_xyz() {
        // This space remains empty
    }
}

您可以访问

You can visit this Github JUnit5 Load examples for JUnit5 Jupiter load tests and also how to run them via JUnit5 Suite.

这篇关于其余Api加载测试Zerocode TDD给出错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆