【问题标题】:why does it say "The attribute name is undefined for the annotation type Parameterized.Parameters"为什么它说“注释类型Parameterized.Parameters的属性名称未定义”
【发布时间】:2019-01-29 16:19:40
【问题描述】:

我写了如下代码: 但是在编译时会抛出编译错误说

"注释类型的属性'name'未定义 参数化.Parameters"

@RunWith(Parameterized.class)
public class TrustStandaloneTestSimple {

    @BeforeClass
    public static void setup() {
    }

    @Parameters(name = "propertyFileName")
    public static Collection<String[]> getParameters(){ 

        return Arrays.asList(new String [][]{{"trust.keystore.simple1.properties"},
                                            {"trust.keystore.simple2.properties"}});
    }

【问题讨论】:

  • 你的进口是什么?

标签: junit openssl parameterized-tests


【解决方案1】:

如果您有以下以外的其他导入可能会导致问题

import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

请检查您的进口情况

【讨论】:

  • 已正确导入所有内容。这只是导致此错误的配置问题。系统使用的是旧版本的 JUnit。声明没有错。不过感谢您的帮助。
猜你喜欢
  • 2016-07-17
  • 2022-12-16
  • 1970-01-01
  • 2023-02-24
  • 2023-03-16
  • 1970-01-01
  • 2016-09-01
  • 1970-01-01
相关资源
最近更新 更多