This is an automated email from the ASF dual-hosted git repository. pmouawad pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git
commit 3c0ed9f02256609c03a3248e5cb42dbce2eacdca Author: pmouawad <[email protected]> AuthorDate: Mon Sep 30 23:13:45 2019 +0200 Fix Sonar warning: Replace printStackTrace by logging --- .../junit-sample/src/main/java/woolfel/DummyTestCase.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java b/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java index 2523c6b..246e514 100644 --- a/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java +++ b/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java @@ -20,10 +20,13 @@ package woolfel; import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import junit.framework.TestCase; public class DummyTestCase extends TestCase { - + private static final Logger LOGGER = LoggerFactory.getLogger(DummyTestCase.class); public DummyTestCase() { super(); System.out.println("public DummyTestCase()"); @@ -49,7 +52,7 @@ public class DummyTestCase extends TestCase { TimeUnit.MILLISECONDS.sleep(100); assertEquals(10,10); } catch (InterruptedException e) { - e.printStackTrace(); + LOGGER.warn("Exception on sleep", e); } } @@ -58,7 +61,7 @@ public class DummyTestCase extends TestCase { TimeUnit.MILLISECONDS.sleep(100); assertEquals("one","one"); } catch (InterruptedException e) { - e.printStackTrace(); + LOGGER.warn("Exception on sleep", e); } } @@ -67,7 +70,7 @@ public class DummyTestCase extends TestCase { TimeUnit.MILLISECONDS.sleep(100); assertEquals(20,10); } catch (InterruptedException e) { - e.printStackTrace(); + LOGGER.warn("Exception on sleep", e); } } @@ -76,7 +79,7 @@ public class DummyTestCase extends TestCase { TimeUnit.MILLISECONDS.sleep(100); assertEquals("one","two"); } catch (InterruptedException e) { - e.printStackTrace(); + LOGGER.warn("Exception on sleep", e); } }
