#502 Replaced usages of System.out with logger.

This commit is contained in:
daniel-bryla
2016-10-23 19:59:03 +02:00
parent 4ca205c03c
commit 0438811489
154 changed files with 1155 additions and 792 deletions
@@ -31,13 +31,15 @@ import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.mockito.InOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author hongshuwei@gmail.com
*/
public class ReaderAndWriterTest extends StdOutTest {
private static final Logger LOGGER = LoggerFactory.getLogger(ReaderAndWriterTest.class);
/**
* Verify reader and writer can only get the lock to read and write orderly
@@ -60,7 +62,7 @@ public class ReaderAndWriterTest extends StdOutTest {
try {
executeService.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
System.out.println("Error waiting for ExecutorService shutdown");
LOGGER.error("Error waiting for ExecutorService shutdown", e);
}
final InOrder inOrder = inOrder(getStdOutMock());
@@ -91,7 +93,7 @@ public class ReaderAndWriterTest extends StdOutTest {
try {
executeService.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
System.out.println("Error waiting for ExecutorService shutdown");
LOGGER.error("Error waiting for ExecutorService shutdown", e);
}
final InOrder inOrder = inOrder(getStdOutMock());
@@ -31,12 +31,16 @@ import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.mockito.InOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author hongshuwei@gmail.com
*/
public class ReaderTest extends StdOutTest {
private static final Logger LOGGER = LoggerFactory.getLogger(ReaderTest.class);
/**
* Verify that multiple readers can get the read lock concurrently
*/
@@ -57,7 +61,7 @@ public class ReaderTest extends StdOutTest {
try {
executeService.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
System.out.println("Error waiting for ExecutorService shutdown");
LOGGER.error("Error waiting for ExecutorService shutdown", e);
}
// Read operation will hold the read lock 250 milliseconds, so here we prove that multiple reads
@@ -31,12 +31,16 @@ import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.mockito.InOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author hongshuwei@gmail.com
*/
public class WriterTest extends StdOutTest {
private static final Logger LOGGER = LoggerFactory.getLogger(WriterTest.class);
/**
* Verify that multiple writers will get the lock in order.
*/
@@ -58,7 +62,7 @@ public class WriterTest extends StdOutTest {
try {
executeService.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
System.out.println("Error waiting for ExecutorService shutdown");
LOGGER.error("Error waiting for ExecutorService shutdown", e);
}
// Write operation will hold the write lock 250 milliseconds, so here we verify that when two
// writer execute concurrently, the second writer can only writes only when the first one is