Skip to content

Commit

Permalink
Remove slf4j from unit tests (broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Dec 1, 2023
1 parent 68cce35 commit 4a01fe5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

<!-- dependency versions a-z -->
<dependency.junit.version>4.12</dependency.junit.version>
<dependency.log4j.version>2.22.0</dependency.log4j.version>
<dependency.logback.version>1.2.3</dependency.logback.version>
<dependency.nativelibloader.version>2.5.0</dependency.nativelibloader.version>

Expand Down Expand Up @@ -81,6 +82,18 @@
<artifactId>native-lib-loader</artifactId>
<version>${dependency.nativelibloader.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${dependency.log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${dependency.log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
8 changes: 5 additions & 3 deletions src/test/java/jssc/junit/rules/VirtualPortRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import jssc.SerialNativeInterface;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class VirtualPortRule implements TestRule {

private static final Logger LOG = LoggerFactory.getLogger(VirtualPortRule.class);
private static final Logger LOG = LogManager.getLogger(VirtualPortRule.class);

private static final ExecutorService executor = Executors.newCachedThreadPool();

Expand Down
4 changes: 4 additions & 0 deletions src/test/java/resources/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Logging settings for unit tests

# TODO: Why isn't this being recognized/honored by log4j?
log4j.rootLogger=ALL

0 comments on commit 4a01fe5

Please sign in to comment.