Home | History | Annotate | Download | only in runner

Lines Matching defs:Description

12  * <p>A <code>Description</code> describes a test which is to be run or has been run. <code>Descriptions</code> 
22 * a superclass below {@link Object}. We needed a way to pass a class and name together. Description
28 public class Description implements Serializable {
32 * Create a <code>Description</code> named <code>name</code>.
33 * Generally, you will add children to this <code>Description</code>.
34 * @param name the name of the <code>Description</code>
36 * @return a <code>Description</code> named <code>name</code>
38 public static Description createSuiteDescription(String name, Annotation... annotations) {
41 return new Description(name, annotations);
45 * Create a <code>Description</code> of a single test named <code>name</code> in the class <code>clazz</code>.
46 * Generally, this will be a leaf <code>Description</code>.
50 * @return a <code>Description</code> named <code>name</code>
52 public static Description createTestDescription(Class<?> clazz, String name, Annotation... annotations) {
53 return new Description(String.format("%s(%s)", name, clazz.getName()), annotations);
57 * Create a <code>Description</code> of a single test named <code>name</code> in the class <code>clazz</code>.
58 * Generally, this will be a leaf <code>Description</code>.
62 * @return a <code>Description</code> named <code>name</code>
64 public static Description createTestDescription(Class<?> clazz, String name) {
69 * Create a <code>Description</code> named after <code>testClass</code>
71 * @return a <code>Description</code> of <code>testClass</code>
73 public static Description createSuiteDescription(Class<?> testClass) {
74 return new Description(testClass.getName(), testClass.getAnnotations());
80 public static final Description EMPTY= new Description("No Tests");
84 * other description can be used (for example, an exception thrown from a Runner's
87 public static final Description TEST_MECHANISM= new Description("Test mechanism");
89 private final ArrayList<Description> fChildren= new ArrayList<Description>();
94 private Description(final String displayName, Annotation... annotations) {
107 * Add <code>Description</code> as a child of the receiver.
108 * @param description the soon-to-be child.
110 public void addChild(Description description) {
111 getChildren().add(description);
117 public ArrayList<Description> getChildren() {
142 for (Description child : getChildren())
154 if (!(obj instanceof Description))
156 Description d = (Description) obj;
166 * @return true if this is a description of a Runner that runs no tests
173 * @return a copy of this description, with no children (on the assumption that some of the
176 public Description childlessCopy() {
177 return new Description(fDisplayName, fAnnotations);
181 * @return the annotation of type annotationType that is attached to this description node,
192 * @return all of the annotations attached to this description node