From cff01302a3e18ff72ac461e3e4e99dff71137d34 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Tue, 26 Mar 2024 08:49:45 -0700 Subject: [PATCH] Allow PCT testing with `database-sqlite` --- .../plugins/junit/storage/TestResultStorageJunitTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/io/jenkins/plugins/junit/storage/TestResultStorageJunitTest.java b/src/test/java/io/jenkins/plugins/junit/storage/TestResultStorageJunitTest.java index df1f17d02..5dc852954 100644 --- a/src/test/java/io/jenkins/plugins/junit/storage/TestResultStorageJunitTest.java +++ b/src/test/java/io/jenkins/plugins/junit/storage/TestResultStorageJunitTest.java @@ -116,8 +116,11 @@ public class TestResultStorageJunitTest { * @see Automatic Mixed Mode */ @Before public void autoServer() throws Exception { - LocalH2Database database = (LocalH2Database) GlobalDatabaseConfiguration.get().getDatabase(); - GlobalDatabaseConfiguration.get().setDatabase(new LocalH2Database(database.getPath(), true)); + GlobalDatabaseConfiguration gdc = GlobalDatabaseConfiguration.get(); + gdc.setDatabase(null); + LocalH2Database.setDefaultGlobalDatabase(); + LocalH2Database database = (LocalH2Database) gdc.getDatabase(); + gdc.setDatabase(new LocalH2Database(database.getPath(), true)); JunitTestResultStorageConfiguration.get().setStorage(new Impl()); }