From f53e4059c779f619ce2cab42983995d3444b6b3b Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Thu, 29 Jan 2026 10:43:53 +0900 Subject: [PATCH 1/2] Update version to 15.5.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2548a06..9bffbbd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ fess-ds-git jar Git Data Store - 15.4.1-SNAPSHOT + 15.5.0-SNAPSHOT scm:git:git@github.com:codelibs/fess-ds-git.git scm:git:git@github.com:codelibs/fess-ds-git.git @@ -14,7 +14,7 @@ org.codelibs.fess fess-parent - 15.4.0 + 15.5.0-SNAPSHOT From 3eeb4f253d4c8873033bbaaeebcf3653f036bbc3 Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Thu, 29 Jan 2026 14:15:40 +0900 Subject: [PATCH 2/2] Migrate tests to JUnit 5 / utflute 2.5.0 --- .../fess/ds/git/GitDataStoreTest.java | 14 +-- .../codelibs/fess/ds/git/UnitDsTestCase.java | 96 +++++++++++++++++++ 2 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 src/test/java/org/codelibs/fess/ds/git/UnitDsTestCase.java diff --git a/src/test/java/org/codelibs/fess/ds/git/GitDataStoreTest.java b/src/test/java/org/codelibs/fess/ds/git/GitDataStoreTest.java index 7170ff4..f6aab7f 100644 --- a/src/test/java/org/codelibs/fess/ds/git/GitDataStoreTest.java +++ b/src/test/java/org/codelibs/fess/ds/git/GitDataStoreTest.java @@ -15,6 +15,8 @@ */ package org.codelibs.fess.ds.git; +import org.junit.jupiter.api.TestInfo; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileOutputStream; @@ -32,10 +34,10 @@ import org.codelibs.fess.exception.DataStoreException; import org.codelibs.fess.opensearch.config.exentity.DataConfig; import org.codelibs.fess.util.ComponentUtil; -import org.dbflute.utflute.lastaflute.LastaFluteTestCase; +import org.codelibs.fess.ds.git.UnitDsTestCase; import org.eclipse.jgit.diff.DiffEntry; -public class GitDataStoreTest extends LastaFluteTestCase { +public class GitDataStoreTest extends UnitDsTestCase { @Override protected String prepareConfigFile() { @@ -48,14 +50,14 @@ protected boolean isSuppressTestCaseTransaction() { } @Override - public void setUp() throws Exception { - super.setUp(); + public void setUp(TestInfo testInfo) throws Exception { + super.setUp(testInfo); } @Override - public void tearDown() throws Exception { + public void tearDown(TestInfo testInfo) throws Exception { ComponentUtil.setFessConfig(null); - super.tearDown(); + super.tearDown(testInfo); } public void test_storeData() { diff --git a/src/test/java/org/codelibs/fess/ds/git/UnitDsTestCase.java b/src/test/java/org/codelibs/fess/ds/git/UnitDsTestCase.java new file mode 100644 index 0000000..fb59a71 --- /dev/null +++ b/src/test/java/org/codelibs/fess/ds/git/UnitDsTestCase.java @@ -0,0 +1,96 @@ +/* + * Copyright 2012-2025 CodeLibs Project and the Others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package org.codelibs.fess.ds.git; + +import org.codelibs.fess.util.ComponentUtil; +import org.dbflute.utflute.lastaflute.LastaFluteTestCase; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.TestInfo; + +public abstract class UnitDsTestCase extends LastaFluteTestCase { + @Override + protected String prepareConfigFile() { + return "test_app.xml"; + } + + @Override + protected void tearDown(TestInfo testInfo) throws Exception { + ComponentUtil.setFessConfig(null); + super.tearDown(testInfo); + } + + // ===== Assert methods for JUnit 4/5 compatibility ===== + + protected void fail(String message) { + Assertions.fail(message); + } + + protected void assertTrue(String message, boolean condition) { + Assertions.assertTrue(condition, message); + } + + protected void assertFalse(String message, boolean condition) { + Assertions.assertFalse(condition, message); + } + + protected void assertEquals(String message, Object expected, Object actual) { + Assertions.assertEquals(expected, actual, message); + } + + protected void assertEquals(String message, long expected, long actual) { + Assertions.assertEquals(expected, actual, message); + } + + protected void assertEquals(String message, double expected, double actual, double delta) { + Assertions.assertEquals(expected, actual, delta, message); + } + + protected void assertEquals(double expected, double actual, double delta) { + Assertions.assertEquals(expected, actual, delta); + } + + protected void assertEquals(String message, float expected, float actual, float delta) { + Assertions.assertEquals(expected, actual, delta, message); + } + + protected void assertEquals(float expected, float actual, float delta) { + Assertions.assertEquals(expected, actual, delta); + } + + protected void assertNotNull(String message, Object object) { + Assertions.assertNotNull(object, message); + } + + protected void assertNull(String message, Object object) { + Assertions.assertNull(object, message); + } + + protected void assertSame(Object expected, Object actual) { + Assertions.assertSame(expected, actual); + } + + protected void assertSame(String message, Object expected, Object actual) { + Assertions.assertSame(expected, actual, message); + } + + protected void assertNotSame(Object expected, Object actual) { + Assertions.assertNotSame(expected, actual); + } + + protected void assertNotSame(String message, Object expected, Object actual) { + Assertions.assertNotSame(expected, actual, message); + } +}