• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.junit.runner;
2 
3 import java.lang.annotation.ElementType;
4 import java.lang.annotation.Inherited;
5 import java.lang.annotation.Retention;
6 import java.lang.annotation.RetentionPolicy;
7 import java.lang.annotation.Target;
8 
9 import org.junit.runner.manipulation.Ordering;
10 import org.junit.validator.ValidateWith;
11 
12 /**
13  * When a test class is annotated with <code>&#064;OrderWith</code> or extends a class annotated
14  * with <code>&#064;OrderWith</code>, JUnit will order the tests in the test class (and child
15  * test classes, if any) using the ordering defined by the {@link Ordering} class.
16  *
17  * @since 4.13
18  */
19 @Retention(RetentionPolicy.RUNTIME)
20 @Target(ElementType.TYPE)
21 @Inherited
22 @ValidateWith(OrderWithValidator.class)
23 public @interface OrderWith {
24     /**
25      * Gets a class that extends {@link Ordering}. The class must have a public no-arg constructor.
26      */
value()27     Class<? extends Ordering.Factory> value();
28 }
29