Skip to content

Commit 65b14fa

Browse files
authored
Allow PCT testing with database-sqlite (#610)
1 parent 76fa010 commit 65b14fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/io/jenkins/plugins/junit/storage/TestResultStorageJunitTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ public class TestResultStorageJunitTest {
116116
* @see <a href="http://www.h2database.com/html/features.html#auto_mixed_mode">Automatic Mixed Mode</a>
117117
*/
118118
@Before public void autoServer() throws Exception {
119-
LocalH2Database database = (LocalH2Database) GlobalDatabaseConfiguration.get().getDatabase();
120-
GlobalDatabaseConfiguration.get().setDatabase(new LocalH2Database(database.getPath(), true));
119+
GlobalDatabaseConfiguration gdc = GlobalDatabaseConfiguration.get();
120+
gdc.setDatabase(null);
121+
LocalH2Database.setDefaultGlobalDatabase();
122+
LocalH2Database database = (LocalH2Database) gdc.getDatabase();
123+
gdc.setDatabase(new LocalH2Database(database.getPath(), true));
121124
JunitTestResultStorageConfiguration.get().setStorage(new Impl());
122125
}
123126

0 commit comments

Comments
 (0)