suppress test logs

This commit is contained in:
Naoyuki Kanezawa
2015-04-23 02:40:32 +09:00
parent a270cac85e
commit d3a12cb476
3 changed files with 14 additions and 8 deletions

View File

@@ -9,9 +9,12 @@ import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.*;
import java.util.logging.Logger;
public abstract class Connection {
private static final Logger logger = Logger.getLogger(Socket.class.getName());
final static int TIMEOUT = 10000;
final static int PORT = 3000;
@@ -22,7 +25,7 @@ public abstract class Connection {
@Before
public void startServer() throws IOException, InterruptedException {
System.out.println("Starting server ...");
logger.fine("Starting server ...");
final CountDownLatch latch = new CountDownLatch(1);
serverProcess = Runtime.getRuntime().exec(
@@ -38,10 +41,10 @@ public abstract class Connection {
line = reader.readLine();
latch.countDown();
do {
System.out.println("SERVER OUT: " + line);
logger.fine("SERVER OUT: " + line);
} while ((line = reader.readLine()) != null);
} catch (IOException e) {
e.printStackTrace();
logger.warning(e.getMessage());
}
}
});
@@ -53,10 +56,10 @@ public abstract class Connection {
String line;
try {
while ((line = reader.readLine()) != null) {
System.err.println("SERVER ERR: " + line);
logger.fine("SERVER ERR: " + line);
}
} catch (IOException e) {
e.printStackTrace();
logger.warning(e.getMessage());
}
}
});
@@ -65,7 +68,7 @@ public abstract class Connection {
@After
public void stopServer() throws InterruptedException {
System.out.println("Stopping server ...");
logger.fine("Stopping server ...");
serverProcess.destroy();
serverOutout.cancel(false);
serverError.cancel(false);