Skip to content

Commit 62c0364

Browse files
committed
Improvements to DataPoints/FromDatapoints annotation javadoc
1 parent 9b81f96 commit 62c0364

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Diff for: src/main/java/org/junit/experimental/theories/DataPoints.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
/**
77
* <p>
8-
* Annotating an array-typed field or method with &#064;DataPoints will cause the
9-
* values in the array (or returned array) to be used as potential parameters
10-
* for theories in that class, when run with the
8+
* Annotating an array-typed field or method with &#064;DataPoints will cause
9+
* the values in the array (or returned array) to be used as potential
10+
* parameters for theories in that class, when run with the
1111
* {@link org.junit.experimental.theories.Theories Theories} runner.
1212
* </p>
1313
* <p>
@@ -20,6 +20,13 @@
2020
* {@link org.junit.experimental.theories.FromDataPoints &#064;FromDataPoints}
2121
* annotation.
2222
* </p>
23+
* <p>
24+
* Parameters with no specified source (i.e. without &#064;FromDataPoints or
25+
* other {@link org.junit.experimental.theories.ParametersSuppliedBy
26+
* &#064;ParameterSuppliedBy} annotations) will use all DataPoints that are
27+
* assignable to the parameter type as potential values, including named sets of
28+
* DataPoints.
29+
* </p>
2330
*
2431
* <pre>
2532
* &#064;DataPoints

Diff for: src/main/java/org/junit/experimental/theories/FromDataPoints.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212
* Annotating a parameter of a {@link org.junit.experimental.theories.Theory
1313
* &#064Theory} method with <code>&#064;FromDataPoints</code> will limit the
1414
* datapoints considered as potential values for that parameter to just the
15-
* {@link org.junit.experimental.theories.DataPoints DataPoints} with the
16-
* given name. For example:
15+
* {@link org.junit.experimental.theories.DataPoints DataPoints} with the given
16+
* name. DataPoint names can be given as the value parameter of the
17+
* &#064DataPoints annotation.
18+
* </p>
19+
* <p>
20+
* DataPoints without names will not be considered as values for any parameters
21+
* annotated with &#064FromDataPoints.
1722
* </p>
1823
*
1924
* <pre>
@@ -38,7 +43,8 @@
3843
* // This will be called with only the values in 'regexStrings' as
3944
* // regex, only the values in 'testStrings' as value, and none
4045
* // of the values in 'unnamed'.
41-
* }</pre>
46+
* }
47+
* </pre>
4248
*
4349
* @see org.junit.experimental.theories.Theory
4450
* @see org.junit.experimental.theories.DataPoint

0 commit comments

Comments
 (0)