Skip to content

0.8.x Annotations for JUnit4 @ParameterSource

UKAI Hiroshi edited this page Oct 19, 2017 · 6 revisions

An annotation to let JCUnit know that a method defines a parameter. The method to which this annotation is attached must return an instance of com.github.dakusui.jcunit8.factorspace.Parameter.Factory.

  @ParameterSource
  public Parameter.Factory a() {
    return ParameterUtils.simple(1, 2);
  }

Parameter.Factory creates an instance of Parameter as its name suggests and it should return a list of values used as actual values of the parameter. Those values must be able to be assigned to method parameters referenced through @From annotation. See explanations about @From annotation for more detail.

Feature Specification
name @ParameterSource
package com.github.dakusui.jcunit8.runners.junit4.annotations
target A method in a parameter space class.
attributes none

Attributes

(none)

Clone this wiki locally