GetJUnitParameters.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:bench4j 作者:
public Map<String, Object> searchParameters() {
    final Map<String, Object> fields = new HashMap<String, Object>();
    for (final Field field : description.getDeclaringClass().getFields()) {
        if (field.isAnnotationPresent(Parameter.class)) {
            try {
                fields.put(field.getName(), field.get(target));
            } catch (IllegalArgumentException | IllegalAccessException e) {
                LOGGER.error("Could not obtain the field {} in the junit test case, marks it public",
                        field.getName(), e);
            }
        }
    }
    return fields;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号