Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.codelibs.fess.plugin.webapp.helper;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;

import java.nio.file.Path;
Expand Down Expand Up @@ -71,10 +72,12 @@ public void tearDown(TestInfo testInfo) throws Exception {
super.tearDown(testInfo);
}

@Test
public void test_checkProperty() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_withValidPath() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -87,6 +90,7 @@ public void test_parseProjectProperties_withValidPath() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_withNullPath() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -98,6 +102,7 @@ public void test_parseProjectProperties_withNullPath() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_withNonExistentPath() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -110,6 +115,7 @@ public void test_parseProjectProperties_withNonExistentPath() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_systemPropertyAlwaysSet() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -123,6 +129,7 @@ public void test_parseProjectProperties_systemPropertyAlwaysSet() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_multipleCalls() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -137,6 +144,7 @@ public void test_parseProjectProperties_multipleCalls() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_inheritance_extendsSystemHelper() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -145,6 +153,7 @@ public void test_inheritance_extendsSystemHelper() {
assertTrue("CustomSystemHelper should extend SystemHelper", helper instanceof org.codelibs.fess.helper.SystemHelper);
}

@Test
public void test_loggerConfiguration() {
// Given
LoggerContext context = (LoggerContext) LogManager.getContext(false);
Expand All @@ -155,6 +164,7 @@ public void test_loggerConfiguration() {
assertNotNull("Logger should be configured", loggerConfig);
}

@Test
public void test_parseProjectProperties_withEmptyPath() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -167,6 +177,7 @@ public void test_parseProjectProperties_withEmptyPath() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_propertyPersistence() {
// Given
CustomSystemHelper helper1 = new CustomSystemHelper();
Expand All @@ -185,6 +196,7 @@ public void test_parseProjectProperties_propertyPersistence() {
assertEquals("Property should remain consistent", propertyAfterFirst, propertyAfterSecond);
}

@Test
public void test_parseProjectProperties_threadSafety() throws InterruptedException {
// Given
final CustomSystemHelper helper = new CustomSystemHelper();
Expand Down Expand Up @@ -212,6 +224,7 @@ public void test_parseProjectProperties_threadSafety() throws InterruptedExcepti
}
}

@Test
public void test_constructor_initialization() {
// Given & When
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -222,6 +235,7 @@ public void test_constructor_initialization() {
assertTrue("Helper should be instance of CustomSystemHelper", helper instanceof CustomSystemHelper);
}

@Test
public void test_parseProjectProperties_overwritesExistingProperty() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -235,6 +249,7 @@ public void test_parseProjectProperties_overwritesExistingProperty() {
assertEquals("Property should be overwritten to true", "true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_withAbsolutePath() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -247,6 +262,7 @@ public void test_parseProjectProperties_withAbsolutePath() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_withRelativePath() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -259,6 +275,7 @@ public void test_parseProjectProperties_withRelativePath() {
assertEquals("true", System.getProperty("fess.webapp.plugin"));
}

@Test
public void test_parseProjectProperties_withSpecialCharactersInPath() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -277,6 +294,7 @@ public void test_parseProjectProperties_withSpecialCharactersInPath() {
assertEquals("true", resultAfterUnicode);
}

@Test
public void test_multipleInstances_independence() {
// Given
CustomSystemHelper helper1 = new CustomSystemHelper();
Expand All @@ -294,6 +312,7 @@ public void test_multipleInstances_independence() {
assertNotSame("Instances should be different objects", helper2, helper3);
}

@Test
public void test_parseProjectProperties_consistencyAcrossInstances() {
// Given
System.clearProperty("fess.webapp.plugin");
Expand All @@ -313,6 +332,7 @@ public void test_parseProjectProperties_consistencyAcrossInstances() {
assertEquals("Values should be consistent", valueAfterHelper1, valueAfterHelper2);
}

@Test
public void test_parseProjectProperties_withDifferentPathTypes() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -327,6 +347,7 @@ public void test_parseProjectProperties_withDifferentPathTypes() {
}
}

@Test
public void test_parseProjectProperties_propertyValueIsExactlyTrue() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -344,6 +365,7 @@ public void test_parseProjectProperties_propertyValueIsExactlyTrue() {
assertFalse("Property value should not be empty", propertyValue.isEmpty());
}

@Test
public void test_parseProjectProperties_idempotency() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -367,6 +389,7 @@ public void test_parseProjectProperties_idempotency() {
assertEquals("Multiple calls should produce same result (idempotent)", secondValue, thirdValue);
}

@Test
public void test_parseProjectProperties_doesNotThrowException() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand All @@ -385,6 +408,7 @@ public void test_parseProjectProperties_doesNotThrowException() {
}
}

@Test
public void test_parseProjectProperties_stressTest() {
// Given
CustomSystemHelper helper = new CustomSystemHelper();
Expand Down
Loading