Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.plugin.scanner;

import org.elasticsearch.core.IOUtils;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.compiler.InMemoryJavaCompiler;
import org.elasticsearch.test.jar.JarUtils;
Expand Down Expand Up @@ -39,6 +40,9 @@ public void testModuleInfoIsNotReturnedAsAClassFromJar() throws IOException {

List<ClassReader> classReaders = ClassReaders.ofPaths(Stream.of(jar));
org.hamcrest.MatcherAssert.assertThat(classReaders, Matchers.empty());

// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
IOUtils.rm(tmp);
}

public void testTwoClassesInAStreamFromJar() throws IOException {
Expand All @@ -57,6 +61,9 @@ public class B {}
List<ClassReader> classReaders = ClassReaders.ofPaths(Stream.of(jar));
List<String> collect = classReaders.stream().map(cr -> cr.getClassName()).collect(Collectors.toList());
org.hamcrest.MatcherAssert.assertThat(collect, Matchers.containsInAnyOrder("p/A", "p/B"));

// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
IOUtils.rm(tmp);
}

public void testStreamOfJarsAndIndividualClasses() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.elasticsearch.plugin.scanner;

import org.elasticsearch.core.IOUtils;
import org.elasticsearch.plugin.scanner.test_model.ExtensibleClass;
import org.elasticsearch.plugin.scanner.test_model.ExtensibleInterface;
import org.elasticsearch.plugin.scanner.test_model.TestNamedComponent;
Expand Down Expand Up @@ -100,6 +101,9 @@ public class B implements ExtensibleInterface{}
)
)
);

// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
IOUtils.rm(tmp);
}

public void testNamedComponentsCanExtednCommonSuperClass() throws IOException {
Expand Down Expand Up @@ -174,6 +178,9 @@ public class B implements CustomExtensibleInterface{}
)
)
);

// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
IOUtils.rm(tmp);
}

public void testWriteToFile() throws IOException {
Expand Down