Skip to content

Commit f525405

Browse files
committed
Add a test for the EclipseHelper avoiding to write META-INF/json/
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 8e92558 commit f525405

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/java/org/scijava/annotations/EclipseHelperTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@
5252
*/
5353
public class EclipseHelperTest {
5454

55+
@Test
56+
public void testSkipIndexGeneration() throws Exception {
57+
final File dir = createTempDirectory();
58+
copyClasses(dir, Complex.class, Simple.class);
59+
final File jsonDir = new File(dir, Index.INDEX_PREFIX);
60+
assertFalse(jsonDir.exists());
61+
final URLClassLoader loader =
62+
new URLClassLoader(new URL[] { dir.toURI().toURL() }, getClass()
63+
.getClassLoader().getParent());
64+
EclipseHelper.indexed.clear();
65+
EclipseHelper.updateAnnotationIndex(loader);
66+
assertFalse(jsonDir.exists());
67+
}
68+
5569
@Test
5670
public void testIndexing() throws Exception {
5771
final File dir = createTempDirectory();

0 commit comments

Comments
 (0)