mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-08-26 16:36:37 +00:00
Fix test failures due to missing bdb close
This commit is contained in:
@@ -55,6 +55,7 @@ import org.eclipse.jetty.server.SslConnectionFactory;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
@@ -167,6 +168,22 @@ public class CookieFetchHTTPIntegrationTest extends ProcessorTestBase {
|
||||
FileUtils.deleteDirectory(staticTempDir.toFile());
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
protected void afterEach() throws Exception {
|
||||
if (fetcher != null) {
|
||||
fetcher.stop();
|
||||
}
|
||||
if (bdbCookieStore != null) {
|
||||
bdbCookieStore.stop();
|
||||
}
|
||||
if (simpleCookieStore != null) {
|
||||
simpleCookieStore.stop();
|
||||
}
|
||||
if (bdb != null) {
|
||||
bdb.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static class AlwaysLocalhostServerCache extends ServerCache {
|
||||
protected static final InetAddress LOCALHOST;
|
||||
static {
|
||||
|
||||
@@ -132,10 +132,18 @@ public class FetchHTTP2Test {
|
||||
|
||||
@AfterEach
|
||||
public void afterEach() {
|
||||
fetcher.stop();
|
||||
cookieStore.stop();
|
||||
bdb.stop();
|
||||
recorder.cleanup();
|
||||
if (fetcher != null) {
|
||||
fetcher.stop();
|
||||
}
|
||||
if (cookieStore != null) {
|
||||
cookieStore.stop();
|
||||
}
|
||||
if (bdb != null) {
|
||||
bdb.close();
|
||||
}
|
||||
if (recorder != null) {
|
||||
recorder.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -305,4 +313,4 @@ public class FetchHTTP2Test {
|
||||
assertEquals(-2, curi.getFetchStatus());
|
||||
curi.getRecorder().cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user