Skip to content

Commit

Permalink
objectionary#2863 fix qulice warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed Mar 5, 2024
1 parent 85ce4c3 commit 333e32f
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions eo-runtime/src/test/java/org/eolang/DataizedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void logsCorrectly() {
final Level before = log.getLevel();
log.setLevel(Level.ALL);
final List<LogRecord> logs = new LinkedList<>();
final Handler hnd = new TestHandler(logs);
final Handler hnd = new Hnd(logs);
log.addHandler(hnd);
new Dataized(new Data.ToPhi(1L), log).take();
log.setLevel(before);
Expand All @@ -68,7 +68,7 @@ void logsWhenException() {
final Level before = log.getLevel();
log.setLevel(Level.ALL);
final List<LogRecord> logs = new LinkedList<>();
final Handler hnd = new TestHandler(logs);
final Handler hnd = new Hnd(logs);
log.addHandler(hnd);
final Phi wrong = new PhIncorrect(Phi.Φ);
IntStream.range(0, 5).forEach(
Expand All @@ -95,7 +95,7 @@ void printsShortLogs() throws InterruptedException {
final Level before = log.getLevel();
log.setLevel(Level.ALL);
final List<LogRecord> logs = new LinkedList<>();
final Handler hnd = new TestHandler(logs);
final Handler hnd = new Hnd(logs);
log.addHandler(hnd);
final Thread thread = new Thread(
() -> {
Expand Down Expand Up @@ -125,7 +125,7 @@ void printsLongLogs() throws InterruptedException {
final Level before = log.getLevel();
log.setLevel(Level.ALL);
final List<LogRecord> logs = new LinkedList<>();
final Handler hnd = new TestHandler(logs);
final Handler hnd = new Hnd(logs);
log.addHandler(hnd);
final Thread thread = new Thread(
() -> {
Expand Down Expand Up @@ -201,16 +201,29 @@ public static class PhiDec extends PhDefault {
}
}

private static class TestHandler extends Handler {
final List<LogRecord> logs;
/**
* Handler implementation for tests.
*
* @since 1.0
*/
private static class Hnd extends Handler {
/**
* Logs.
*/
private final List<LogRecord> logs;

TestHandler(final List<LogRecord> logs) {
/**
* Ctor.
*
* @param logs Logs
*/
Hnd(final List<LogRecord> logs) {
this.logs = logs;
}

@Override
public void publish(final LogRecord record) {
logs.add(record);
this.logs.add(record);
}

@Override
Expand Down

0 comments on commit 333e32f

Please sign in to comment.