JUNIT参数化测试诡异问题:No tests found matching Method 测试方法(测试类) from org.junit.internal.requests.ClassR..

在进行JUNIT参数化测试时遇到了错误:No tests found matching 方法名(类名)。参考了iteye博客和StackOverflow上的解答,解决方案是重写org.junit.runner.Parameterized,并使用PowerMockRunner Delegate搭配自定义的B2bParameterized类。
摘要由CSDN通过智能技术生成

本文参考与

1: https://www.iteye.com/blog/hedajia-2208403

2: https://stackoverflow.com/questions/12798079/initializationerror-with-eclipse-and-junit4-when-executing-a-single-test/18438718#18438718

JUNIT参数化测试,遇到的诡异问题

No tests found matching Method 测试方法名(测试类名) from org.junit.internal.request.ClassRequest@ibdecc21

解决方案:

重写 org.junit.runner.Parameterized

代码如下

public class B2bParameterized extends Parameterized {  
  
    public B2bParameterized (Class<?> klass) throws Throwable {  
        super(klass);  
    }  
  
    public void filter(Filter filter) throws NoTestsRemainException {  
        super.filter(new FilterDecorator(filter
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值