Skip to content

Commit

Permalink
Make sure all testing frameworks use ExtHandler
Browse files Browse the repository at this point in the history
This avoids the situation where `printf`-formatted messages are translated to "simple" messages due to quarkusio#22844.
  • Loading branch information
dmlloyd committed Dec 21, 2023
1 parent 47f0c58 commit d6e8ae3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.ErrorManager;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.LogRecord;

import org.jboss.logmanager.ExtHandler;
import org.jboss.logmanager.formatters.PatternFormatter;

public class InMemoryLogHandler extends Handler {
public class InMemoryLogHandler extends ExtHandler {
private static final PatternFormatter FORMATTER = new PatternFormatter("%X{requestId} ### %s");

private static final List<String> recordList = new CopyOnWriteArrayList<>();
Expand Down
13 changes: 13 additions & 0 deletions independent-projects/resteasy-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<maven.version>3.9.6</maven.version>
<assertj.version>3.24.2</assertj.version>
<jboss-logging.version>3.5.3.Final</jboss-logging.version>
<jboss-logmanager.version>3.0.4.Final</jboss-logmanager.version>
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
<gizmo.version>1.7.0</gizmo.version>
<jakarta.persistence-api.version>3.1.0</jakarta.persistence-api.version>
Expand Down Expand Up @@ -292,6 +293,18 @@
<version>${jboss-logging.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<version>${jboss-logmanager.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions independent-projects/resteasy-reactive/server/vertx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
<artifactId>jboss-logging</artifactId>
</dependency>

<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;

public class InMemoryLogHandler extends Handler {
import org.jboss.logmanager.ExtHandler;

public class InMemoryLogHandler extends ExtHandler {

private final Predicate<LogRecord> predicate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Predicate;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;

import org.jboss.logmanager.ExtHandler;
import org.wildfly.common.Assert;

public class InMemoryLogHandler extends Handler {
public class InMemoryLogHandler extends ExtHandler {

private final Predicate<LogRecord> predicate;

Expand Down

0 comments on commit d6e8ae3

Please sign in to comment.