Skip to content

Commit

Permalink
Setup junit platform logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Mar 17, 2024
1 parent 3dee508 commit 472a185
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 85 deletions.
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
. Адаптируем имена (find & replace)
.. Имя проекта (в шаблоне bezmen)
.. Имя приложения (в шаблоне sepuling)
.. Имя базы данных (в шаблоне enteropia)
.. Имя схемы данных (в шаблоне sepulkarium)
. Настраиваем синхронизацию
.. Создаем Github App на уровне репозитория или организации
Expand Down
14 changes: 7 additions & 7 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,31 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>deps-jars</id>
<id>copy-deps</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<excludeGroupIds>${project.groupId}</excludeGroupIds>
<outputDirectory>${project.build.directory}/image-context/lib</outputDirectory>
<outputDirectory>${project.build.directory}/image/lib</outputDirectory>
</configuration>
</execution>
<execution>
<id>libs-jars</id>
<id>copy-libs</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<includeGroupIds>${project.groupId}</includeGroupIds>
<outputDirectory>${project.build.directory}/image-context/bin</outputDirectory>
<outputDirectory>${project.build.directory}/image/bin</outputDirectory>
</configuration>
</execution>
<execution>
<id>app-jar</id>
<id>copy-app</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
Expand All @@ -101,7 +101,7 @@
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<outputDirectory>${project.build.directory}/image-context/bin</outputDirectory>
<outputDirectory>${project.build.directory}/image/bin</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
Expand All @@ -124,7 +124,7 @@
<executable>docker</executable>
<arguments>
<argument>build</argument>
<argument>${project.build.directory}/image-context</argument>
<argument>${project.build.directory}/image</argument>
<argument>--file</argument>
<argument>${project.basedir}/Dockerfile</argument>
<argument>--tag</argument>
Expand Down
11 changes: 0 additions & 11 deletions app/sepuling-java/src/it/resources/logback-test.xml

This file was deleted.

11 changes: 0 additions & 11 deletions app/sepuling-kotlin/src/it/resources/logback-test.xml

This file was deleted.

11 changes: 0 additions & 11 deletions lib/messaging/src/it/resources/logback-test.xml

This file was deleted.

4 changes: 3 additions & 1 deletion lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<artifactId>slf4j-bom</artifactId>
<version>2.0.12</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
11 changes: 0 additions & 11 deletions lib/storage/src/it/resources/logback-test.xml

This file was deleted.

11 changes: 0 additions & 11 deletions lib/storage/src/test/resources/logback-test.xml

This file was deleted.

8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@
junit.jupiter.execution.parallel.config.fixed.parallelism=2
</configurationParameters>
</properties>
<systemPropertyVariables>
<java.util.logging.manager>org.apache.logging.log4j.jul.LogManager</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -302,6 +305,9 @@
junit.jupiter.execution.parallel.enabled=false
</configurationParameters>
</properties>
<systemPropertyVariables>
<java.util.logging.manager>org.apache.logging.log4j.jul.LogManager</java.util.logging.manager>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -367,7 +373,7 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<skip>true</skip>
<skip>true</skip> <!-- enable explicitly in public modules -->
</configuration>
</plugin>
</plugins>
Expand Down
11 changes: 0 additions & 11 deletions test/e2e/src/test/resources/logback-test.xml

This file was deleted.

13 changes: 5 additions & 8 deletions tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,11 @@
<type>pom</type>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.12</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.3</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.23.1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
Expand Down
14 changes: 12 additions & 2 deletions tool/testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,18 @@
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<scope>runtime</scope>
</dependency>

Expand Down
14 changes: 14 additions & 0 deletions tool/testing/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1.} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.junit.jupiter.api" level="debug"/>
<Root level="error">
<AppenderRef ref="CONSOLE"/>
</Root>
</Loggers>
</Configuration>
12 changes: 12 additions & 0 deletions tool/testing/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1} - %msg%n</pattern>
</encoder>
</appender>
<logger name="smecalculus" level="error"/>
<root level="error">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>

0 comments on commit 472a185

Please sign in to comment.