Skip to content

Commit b060732

Browse files
committed
ScriptInfoTest: do not use a static Context
Other tests create a new Context per test. This is cleaner than reusing the same Context.
1 parent cf6efde commit b060732

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/test/java/org/scijava/script/ScriptInfoTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
import javax.script.ScriptEngine;
5555
import javax.script.ScriptException;
5656

57-
import org.junit.AfterClass;
58-
import org.junit.BeforeClass;
57+
import org.junit.After;
58+
import org.junit.Before;
5959
import org.junit.Test;
6060
import org.scijava.Context;
6161
import org.scijava.ItemIO;
@@ -77,19 +77,19 @@
7777
*/
7878
public class ScriptInfoTest {
7979

80-
private static Context context;
81-
private static ScriptService scriptService;
80+
private Context context;
81+
private ScriptService scriptService;
8282

8383
// -- Test setup --
8484

85-
@BeforeClass
86-
public static void setUp() {
85+
@Before
86+
public void setUp() {
8787
context = new Context();
8888
scriptService = context.service(ScriptService.class);
8989
}
9090

91-
@AfterClass
92-
public static void tearDown() {
91+
@After
92+
public void tearDown() {
9393
context.dispose();
9494
}
9595

0 commit comments

Comments
 (0)