Skip to content

Commit 72af29d

Browse files
committed
Added specific targetting for the various theory annotations
1 parent b8adef3 commit 72af29d

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package org.junit.experimental.theories;
22

3+
import static java.lang.annotation.ElementType.FIELD;
4+
import static java.lang.annotation.ElementType.METHOD;
5+
36
import java.lang.annotation.Retention;
47
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
59

610
@Retention(RetentionPolicy.RUNTIME)
11+
@Target({FIELD, METHOD})
712
public @interface DataPoint {
813

914
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package org.junit.experimental.theories;
22

3+
import static java.lang.annotation.ElementType.FIELD;
4+
import static java.lang.annotation.ElementType.METHOD;
5+
36
import java.lang.annotation.Retention;
47
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
59

610
@Retention(RetentionPolicy.RUNTIME)
11+
@Target({FIELD, METHOD})
712
public @interface DataPoints {
813

914
}

src/main/java/org/junit/experimental/theories/ParametersSuppliedBy.java

+5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
package org.junit.experimental.theories;
22

3+
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
4+
import static java.lang.annotation.ElementType.PARAMETER;
5+
36
import java.lang.annotation.Retention;
47
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
59

610

711
@Retention(RetentionPolicy.RUNTIME)
12+
@Target({ANNOTATION_TYPE, PARAMETER})
813
public @interface ParametersSuppliedBy {
914

1015
Class<? extends ParameterSupplier> value();
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
package org.junit.experimental.theories;
22

3+
import static java.lang.annotation.ElementType.METHOD;
4+
35
import java.lang.annotation.Retention;
46
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
58

69
@Retention(RetentionPolicy.RUNTIME)
10+
@Target(METHOD)
711
public @interface Theory {
812
boolean nullsAccepted() default true;
913
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package org.junit.experimental.theories.suppliers;
22

3+
import static java.lang.annotation.ElementType.PARAMETER;
4+
35
import java.lang.annotation.Retention;
46
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
58

69
import org.junit.experimental.theories.ParametersSuppliedBy;
710

811
@ParametersSuppliedBy(TestedOnSupplier.class)
912
@Retention(RetentionPolicy.RUNTIME)
13+
@Target(PARAMETER)
1014
public @interface TestedOn {
1115
int[] ints();
1216
}

0 commit comments

Comments
 (0)