Skip to content

Commit

Permalink
Make all major Ares annotations inherited, this resolves #124
Browse files Browse the repository at this point in the history
How this works now:

We first search at the test method, then at the containing class, all
its superclasses (but not interfaces!) the hierarchy up, and then in
case of nested classes the next class outwards (and then again all
superclasses of that class) and so on until the outermost class is
reached. The upwards class hierarchy traversal is the new component
here.

This means:

For non-repeatable annotations (such as Deadline), we stop as soon as we
find the first Deadline using this process. For repeatable annotations
(such as WhitelistPath), we collect all annotations we can find using
this process.

The PublicTest and HiddenTest annotations are unchanged because they are
meant for methods only (and we generally recommend using just Public and
Hidden).
  • Loading branch information
MaisiKoleni committed Jan 17, 2022
1 parent d98cc68 commit 792afcb
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/ActivateHiddenBefore.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -26,6 +27,7 @@
* @version 1.1.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/AddTrustedPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -29,6 +30,7 @@
* @version 1.0.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/AddTrustedPackages.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -20,6 +21,7 @@
* @version 1.0.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/AllowLocalPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -21,6 +22,7 @@
* @version 1.0.0
*/
@API(status = Status.EXPERIMENTAL)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/AllowThreads.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -14,6 +15,7 @@
* @since 0.4.0
* @version 1.0.0
*/
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/BlacklistPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand Down Expand Up @@ -42,6 +43,7 @@
* @version 1.1.0
*/
@API(status = Status.EXPERIMENTAL)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/BlacklistPackages.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -20,6 +21,7 @@
* @version 1.0.0
*/
@API(status = Status.EXPERIMENTAL)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/BlacklistPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand Down Expand Up @@ -32,6 +33,7 @@
* @version 1.1.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/BlacklistPaths.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -22,6 +23,7 @@
* @version 1.0.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/Deadline.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.time.ZoneId;
Expand Down Expand Up @@ -51,6 +52,7 @@
* @version 1.1.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/ExtendedDeadline.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand Down Expand Up @@ -32,6 +33,7 @@
* @version 1.0.1
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/MirrorOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -29,6 +30,7 @@
* @version 1.1.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand Down Expand Up @@ -50,6 +51,7 @@
* @version 1.0.1
*/
@API(status = Status.EXPERIMENTAL)
@Inherited
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
public @interface PrivilegedExceptionsOnly {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/StrictTimeout.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -36,6 +37,7 @@
* @version 2.0.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/TrustedThreads.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand Down Expand Up @@ -57,6 +58,7 @@
* @author Christian Femers
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, CONSTRUCTOR, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/WhitelistClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -21,6 +22,7 @@
* @version 1.0.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/WhitelistClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -20,6 +21,7 @@
* @version 1.0.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/WhitelistPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand Down Expand Up @@ -36,6 +37,7 @@
* @version 1.1.1
*/
@API(status = Status.EXPERIMENTAL)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/WhitelistPackages.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -20,6 +21,7 @@
* @version 1.0.0
*/
@API(status = Status.EXPERIMENTAL)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/WhitelistPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand Down Expand Up @@ -32,6 +33,7 @@
* @version 1.1.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/WhitelistPaths.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand All @@ -22,6 +23,7 @@
* @version 1.0.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, TYPE, ANNOTATION_TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/jqwik/Hidden.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand Down Expand Up @@ -35,6 +36,7 @@
* @version 1.1.1
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, ANNOTATION_TYPE, TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/jqwik/JqwikArtemisTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand All @@ -23,6 +24,7 @@
* @author Christian Femers
*/
@API(status = Status.INTERNAL)
@Inherited
@Documented
@Retention(RUNTIME)
@Target(ANNOTATION_TYPE)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/jqwik/Public.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand Down Expand Up @@ -37,6 +38,7 @@
* @version 1.1.1
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, ANNOTATION_TYPE, TYPE })
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/de/tum/in/test/api/jupiter/Hidden.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

Expand Down Expand Up @@ -38,6 +39,7 @@
* @version 1.1.0
*/
@API(status = Status.MAINTAINED)
@Inherited
@Documented
@Retention(RUNTIME)
@Target({ METHOD, ANNOTATION_TYPE, TYPE })
Expand Down
Loading

0 comments on commit 792afcb

Please sign in to comment.