Skip to content

Commit

Permalink
Reduce logging when testing unclosed connections (#4883)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad authored Jan 26, 2024
1 parent 5f67425 commit 8400bd2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions testsuites/repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@
<artifactId>junit-jupiter-params</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.qos.logback.classic.Level;

public abstract class TupleQueryResultTest {

private final Logger logger = LoggerFactory.getLogger(TupleQueryResultTest.class);
Expand All @@ -67,6 +69,10 @@ public abstract class TupleQueryResultTest {
@BeforeEach
public void setUp() throws Exception {
System.setProperty("org.eclipse.rdf4j.repository.debug", "true");
ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory
.getLogger("org.eclipse.rdf4j.sail.helpers.AbstractSailConnection");
root.setLevel(Level.ERROR);

rep = createRepository();
con = rep.getConnection();

Expand All @@ -79,7 +85,9 @@ public void setUp() throws Exception {
@AfterEach
public void tearDown() throws Exception {
System.setProperty("org.eclipse.rdf4j.repository.debug", "false");

ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory
.getLogger("org.eclipse.rdf4j.sail.helpers.AbstractSailConnection");
root.setLevel(Level.WARN);
try {
con.close();
con = null;
Expand Down

0 comments on commit 8400bd2

Please sign in to comment.