From 05ad403e2f48f98ae173c563d538539d2072328d Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Tue, 26 Mar 2024 18:55:52 +0100 Subject: [PATCH] Allow PCT testing with `database-sqlite` (#153) --- .../junitrealtimetestreporter/RealtimeJUnitStepTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/jenkinsci/plugins/junitrealtimetestreporter/RealtimeJUnitStepTest.java b/src/test/java/org/jenkinsci/plugins/junitrealtimetestreporter/RealtimeJUnitStepTest.java index ee362c1..7a42315 100644 --- a/src/test/java/org/jenkinsci/plugins/junitrealtimetestreporter/RealtimeJUnitStepTest.java +++ b/src/test/java/org/jenkinsci/plugins/junitrealtimetestreporter/RealtimeJUnitStepTest.java @@ -91,8 +91,11 @@ public RealtimeJUnitStepTest(boolean usePluggableStorage) { public void autoServer() throws Exception { if (usePluggableStorage) { - 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 H2JunitTestResultStorage()); } }