org.junit.jupiter.params.aggregator.ArgumentsAggregationException源码实例Demo

类org.junit.jupiter.params.aggregator.ArgumentsAggregationException源码实例Demo

下面列出了org.junit.jupiter.params.aggregator.ArgumentsAggregationException 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: triplea   文件: RemoteActionCodeTest.java
@Override
public Method aggregateArguments(
    final ArgumentsAccessor arguments, final ParameterContext context)
    throws ArgumentsAggregationException {
  // Ignore CSV columns that are already used by different parameters
  final int offset = context.getIndex();
  final Class<?> remoteInterface = arguments.get(offset, Class.class);
  final String methodName = arguments.getString(offset + 1);
  final Class<?>[] argumentTypes =
      IntStream.range(offset + 2, arguments.size())
          .mapToObj(i -> arguments.get(i, Class.class))
          .toArray(Class<?>[]::new);
  try {
    return remoteInterface.getMethod(methodName, argumentTypes);
  } catch (final NoSuchMethodException e) {
    throw new ArgumentsAggregationException("Invalid method specified", e);
  }
}
 
源代码2 项目: demo-junit-5   文件: ArgumentAggregatorTest.java
@Override
public Object aggregateArguments(
		ArgumentsAccessor arguments, ParameterContext context) throws ArgumentsAggregationException {
	return Point.from(arguments.getDouble(1), arguments.getDouble(2));
}
 
源代码3 项目: tutorials   文件: PersonAggregator.java
@Override
public Object aggregateArguments(ArgumentsAccessor accessor, ParameterContext context)
        throws ArgumentsAggregationException {
    return new Person(accessor.getString(1), accessor.getString(2), accessor.getString(3));
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 同包方法