为什么说 "The attribute name is undefined for the annotation type Parameterized.Parameters"
why does it say "The attribute name is undefined for the annotation type Parameterized.Parameters"
我写了一段代码如下:
但是在编译时会抛出编译错误
"The attribute 'name' is undefined for the annotation type
Parameterized.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"}});
}
如果您有不同于以下内容的导入,则可能会导致此问题
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
请检查您的导入
我写了一段代码如下: 但是在编译时会抛出编译错误
"The attribute 'name' is undefined for the annotation type Parameterized.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"}});
}
如果您有不同于以下内容的导入,则可能会导致此问题
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
请检查您的导入