Skip to content

Commit b5ce319

Browse files
committed
Add unit test for validating repeated creation and closure of Scijava contexts
1 parent b63f6aa commit b5ce319

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package sc.fiji;
2+
3+
import static org.junit.jupiter.api.Assertions.assertTrue;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
class ScijavaContextTest
8+
{
9+
@Test
10+
void testContext()
11+
{
12+
for ( int i = 0; i < 100; i++ )
13+
try (org.scijava.Context context = new org.scijava.Context())
14+
{
15+
16+
}
17+
assertTrue( true, "Successfully created and closed 500 contexts without running out of resources." );
18+
}
19+
}

0 commit comments

Comments
 (0)