有人知道如何使用 Eclipse 模板在类签名上方插入“@RunWith 注释”吗?
前任。:
@RunWith(Parameterized.class)
public class MyClassTest {
...
@Parameters
public static Collection<Object[]> parameters() {
List<Object[]> list = new ArrayList<Object[]>();
list.add(new Object[] { "mind!", "find!" });
list.add(new Object[] { "misunderstood", "understood" });
return list;
}
...
}
__
模板:
// TODO: move this '@RunWith(Parameterized.class)' to class anotation
@Parameters
public static Collection<Object[]> parameters() {
${type:elemType(collection)}<Object[]> parametersList = new ${type:elemType(collection)}<Object[]>();
${cursor}// TODO: populate collection
return parametersList;
}
__ 谢谢您的帮助!