summaryrefslogtreecommitdiff
path: root/test/junit/scala/tools/testing/ClearAfterClass.java
blob: 232d459c4e75c0e0ab439e5df9358f2747f008aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package scala.tools.testing;

import org.junit.AfterClass;

/**
 * Extend this class to use JUnit's @AfterClass. This annotation only works on static methods,
 * which cannot be written in Scala.
 *
 * Example: {@link scala.tools.nsc.backend.jvm.opt.InlinerTest}
 */
public class ClearAfterClass {
    public static interface Clearable {
        void clear();
    }

    public static Clearable stateToClear;

    @AfterClass
    public static void clearState() { stateToClear.clear(); }
}