diff -r 000000000000 -r 82d1d1de1a01 carbidecpp20devenv/plugins/org.eclipse.test.source_3.3.0.v20080507/src/org.junit4_4.3.1/junitsrc/org/junit/AfterClass.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/carbidecpp20devenv/plugins/org.eclipse.test.source_3.3.0.v20080507/src/org.junit4_4.3.1/junitsrc/org/junit/AfterClass.java Wed Mar 18 17:21:00 2009 -0500 @@ -0,0 +1,41 @@ +package org.junit; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

If you allocate expensive external resources in a {@link org.junit.BeforeClass} method you need to release them + * after all the tests in the class have run. Annotating a public static void method + * with @AfterClass causes that method to be run after all the tests in the class have been run. All @AfterClass + * methods are guaranteed to run even if a {@link org.junit.BeforeClass} method throws an + * exception. The @AfterClass methods declared in superclasses will be run after those of the current + * class.

+ * + * Here is a simple example: +*
+ * public class Example {
+ *    DatabaseConnection database;
+ *    @BeforeClass public void login() {
+ *          database= ...;
+ *    }
+ *    @Test public void something() {
+ *          ...
+ *    }
+ *    @Test public void somethingElse() {
+ *          ...
+ *    }
+ *    @AfterClass public void logout() {
+ *          database.logout();
+ *    }
+ * }
+ * 
+ * + * @see org.junit.BeforeClass + * @see org.junit.Test + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface AfterClass { +}