carbidecpp20devenv/plugins/org.eclipse.test.source_3.3.0.v20080507/src/org.junit4_4.3.1/junitsrc/org/junit/AfterClass.java
equal
deleted
inserted
replaced
|
1 package org.junit; |
|
2 |
|
3 import java.lang.annotation.ElementType; |
|
4 import java.lang.annotation.Retention; |
|
5 import java.lang.annotation.RetentionPolicy; |
|
6 import java.lang.annotation.Target; |
|
7 |
|
8 /** |
|
9 * <p>If you allocate expensive external resources in a {@link org.junit.BeforeClass} method you need to release them |
|
10 * after all the tests in the class have run. Annotating a <code>public static void</code> method |
|
11 * with <code>@AfterClass</code> causes that method to be run after all the tests in the class have been run. All <code>@AfterClass</code> |
|
12 * methods are guaranteed to run even if a {@link org.junit.BeforeClass} method throws an |
|
13 * exception. The <code>@AfterClass</code> methods declared in superclasses will be run after those of the current |
|
14 * class.</p> |
|
15 * |
|
16 * Here is a simple example: |
|
17 * <pre> |
|
18 * public class Example { |
|
19 * DatabaseConnection database; |
|
20 * @BeforeClass public void login() { |
|
21 * database= ...; |
|
22 * } |
|
23 * @Test public void something() { |
|
24 * ... |
|
25 * } |
|
26 * @Test public void somethingElse() { |
|
27 * ... |
|
28 * } |
|
29 * @AfterClass public void logout() { |
|
30 * database.logout(); |
|
31 * } |
|
32 * } |
|
33 * </pre> |
|
34 * |
|
35 * @see org.junit.BeforeClass |
|
36 * @see org.junit.Test |
|
37 */ |
|
38 @Retention(RetentionPolicy.RUNTIME) |
|
39 @Target(ElementType.METHOD) |
|
40 public @interface AfterClass { |
|
41 } |