You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2023/01/04 12:33:50 UTC

[jspwiki] 04/06: Ensure EhCache is clean on first test execution

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 9bc32a67c81b8f9c2980e7fb92bb7d9fbe156019
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Wed Jan 4 12:59:58 2023 +0100

    Ensure EhCache is clean on first test execution
---
 .../test/java/org/apache/wiki/providers/CachingProviderTest.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/jspwiki-main/src/test/java/org/apache/wiki/providers/CachingProviderTest.java b/jspwiki-main/src/test/java/org/apache/wiki/providers/CachingProviderTest.java
index 227539658..3ef6aabae 100644
--- a/jspwiki-main/src/test/java/org/apache/wiki/providers/CachingProviderTest.java
+++ b/jspwiki-main/src/test/java/org/apache/wiki/providers/CachingProviderTest.java
@@ -19,6 +19,7 @@
 
 package org.apache.wiki.providers;
 
+import net.sf.ehcache.CacheManager;
 import org.apache.wiki.TestEngine;
 import org.apache.wiki.api.core.Page;
 import org.apache.wiki.cache.CachingManager;
@@ -27,6 +28,7 @@ import org.apache.wiki.util.FileUtil;
 import org.awaitility.Awaitility;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
 import java.io.File;
@@ -39,6 +41,11 @@ class CachingProviderTest {
 
     TestEngine engine;
 
+    @BeforeAll
+    static void ensureEhCacheFreshStart() {
+        CacheManager.getInstance().shutdown();
+    }
+
     @AfterEach
     void tearDown() {
         engine.stop();