File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
src/test/java/org/scijava/thread Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 33
33
34
34
import static org .junit .Assert .assertSame ;
35
35
36
+ import org .junit .After ;
37
+ import org .junit .Before ;
36
38
import org .junit .Test ;
37
39
import org .scijava .Context ;
38
40
43
45
*/
44
46
public class ThreadServiceTest {
45
47
48
+ private Context context ;
49
+ private ThreadService threadService ;
50
+
51
+ @ Before
52
+ public void setUp () {
53
+ context = new Context (ThreadService .class );
54
+ threadService = context .getService (ThreadService .class );
55
+ }
56
+
57
+ @ After
58
+ public void tearDown () {
59
+ context .dispose ();
60
+ }
61
+
46
62
/**
47
63
* Tests {@link ThreadService#getParent(Thread)} when called after
48
64
* {@link ThreadService#invoke(Runnable)}.
49
65
*/
50
66
@ Test
51
67
public void testGetParent () throws Exception {
52
- final Context context = new Context (ThreadService .class );
53
- final ThreadService threadService = context .getService (ThreadService .class );
54
68
final AskForParent ask = new AskForParent (threadService );
55
69
threadService .invoke (ask );
56
70
assertSame (Thread .currentThread (), ask .parent );
57
- context .dispose ();
58
71
}
59
72
60
73
private static class AskForParent implements Runnable {
You can’t perform that action at this time.
0 commit comments