Update Test Environment to macOS-14 and Enhance Logging During Test Execution (#2806)
* add log4j2.xml * replace with macos-14
This commit is contained in:
parent
8e215f4cbd
commit
106900ae91
4 changed files with 30 additions and 4 deletions
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
|
@ -16,7 +16,7 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: macos-14
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
|
@ -101,6 +101,7 @@ public abstract class CrudTestBase extends ITBase {
|
|||
// Bodies
|
||||
// ================
|
||||
protected void testCreate() {
|
||||
logger.info("[BEGIN] testCreate");
|
||||
// Test: create setting api.
|
||||
for (int i = 0; i < NUM; i++) {
|
||||
final Map<String, Object> requestBody = createTestParam(i);
|
||||
|
@ -114,9 +115,11 @@ public abstract class CrudTestBase extends ITBase {
|
|||
// Test: number of settings.
|
||||
final Map<String, Object> searchBody = createSearchBody(SEARCH_ALL_NUM);
|
||||
checkGetMethod(searchBody, getListEndpointSuffix()).then().body(getJsonPath() + ".size()", equalTo(NUM));
|
||||
logger.info("[END] testCreate");
|
||||
}
|
||||
|
||||
protected void testRead() {
|
||||
logger.info("[BEGIN] testRead");
|
||||
// Test: get settings api.
|
||||
final Map<String, Object> searchBody = createSearchBody(SEARCH_ALL_NUM);
|
||||
List<String> nameList = getPropList(searchBody, getKeyProperty());
|
||||
|
@ -141,10 +144,11 @@ public abstract class CrudTestBase extends ITBase {
|
|||
searchBody.put("page", i + 1);
|
||||
checkGetMethod(searchBody, getListEndpointSuffix()).then().body("response." + getListEndpointSuffix() + ".size()", equalTo(1));
|
||||
}
|
||||
|
||||
logger.info("[END] testRead");
|
||||
}
|
||||
|
||||
protected void testUpdate() {
|
||||
logger.info("[BEGIN] testUpdate");
|
||||
// Test: update settings api
|
||||
final Set<String> keySet = createTestParam(0).keySet();
|
||||
final Map<String, Object> updateMap = getUpdateMap();
|
||||
|
@ -169,6 +173,7 @@ public abstract class CrudTestBase extends ITBase {
|
|||
}
|
||||
|
||||
checkUpdate();
|
||||
logger.info("[END] testUpdate");
|
||||
}
|
||||
|
||||
protected void checkUpdate() {
|
||||
|
@ -184,6 +189,7 @@ public abstract class CrudTestBase extends ITBase {
|
|||
}
|
||||
|
||||
protected void testDelete() {
|
||||
logger.info("[BEGIN] testDelete");
|
||||
final Map<String, Object> searchBody = createSearchBody(SEARCH_ALL_NUM);
|
||||
|
||||
for (int count = 0; count < NUM; count++) {
|
||||
|
@ -194,6 +200,7 @@ public abstract class CrudTestBase extends ITBase {
|
|||
|
||||
// Test: number of settings.
|
||||
checkGetMethod(searchBody, getListEndpointSuffix()).then().body(getJsonPath() + ".size()", equalTo(0));
|
||||
logger.info("[END] testDelete");
|
||||
}
|
||||
|
||||
// ================
|
||||
|
|
|
@ -18,6 +18,8 @@ package org.codelibs.fess.util;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.codelibs.core.io.ResourceUtil;
|
||||
import org.codelibs.fess.es.config.exentity.LabelType;
|
||||
import org.codelibs.fess.helper.SystemHelper;
|
||||
|
@ -26,6 +28,8 @@ import org.xml.sax.InputSource;
|
|||
|
||||
public class GsaConfigParserTest extends UnitFessTestCase {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(GsaConfigParserTest.class);
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
@ -38,10 +42,10 @@ public class GsaConfigParserTest extends UnitFessTestCase {
|
|||
parser.parse(new InputSource(is));
|
||||
}
|
||||
parser.getWebConfig().ifPresent(c -> {
|
||||
System.out.println(c.toString());
|
||||
logger.debug(c.toString());
|
||||
}).orElse(() -> fail());
|
||||
parser.getFileConfig().ifPresent(c -> {
|
||||
System.out.println(c.toString());
|
||||
logger.debug(c.toString());
|
||||
}).orElse(() -> fail());
|
||||
LabelType[] labelTypes = parser.getLabelTypes();
|
||||
assertEquals(3, labelTypes.length);
|
||||
|
|
15
src/test/resources/log4j2.xml
Normal file
15
src/test/resources/log4j2.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout
|
||||
pattern="%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n" />
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="INFO">
|
||||
<AppenderRef ref="Console" />
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
Loading…
Add table
Reference in a new issue