gpt4 book ai didi

java - 类型不匹配 : cannot convert from Class to Class

转载 作者:行者123 更新时间:2023-12-02 13:45:01 24 4
gpt4 key购买 nike

我正在尝试使用参数执行 JUNIT 测试。

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.beust.jcommander.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class QtyByParam extends TestBase_Post {

我已经包含了 jar junit-4.11.jar , junit-dep-4.11.jar

有什么遗漏的吗?我得到Type mismatch: cannot convert from Class<Parameterized> to Class<? extends Runner>错误位于@RunWith部分。

最佳答案

您导入了错误的类:

import com.beust.jcommander.Parameterized;

这是正确的导入:

import org.junit.runners.Parameterized;

关于java - 类型不匹配 : cannot convert from Class<Parameterized> to Class<? 扩展了 Runner>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24431889/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com