Whiteship
  • Home
  • 인프런 강의
  • Java
  • Spring
  • JPA
  • SDE Tips
Subscribe

표준 출력

A collection of 1 post
파이프

자바 System.out.println 콘솔 출력 가로채기

public class Sout { public void hi(){ System.out.println(“hi”); } } 이렇게 콘솔에 어떤 메시지를 출력하는 경우가 있을 때 저걸 애플리케이션에서 캡춰할 수 있는 걸 만들어 보는 과제가 떨어졌다. public class SoutTest { SoutInterceptor soutInterceptor = new SoutInterceptor(); @Test public void sout() throws IOException { soutInterceptor.active(); Sout sout = new Sout(); sout.hi(); assertThat(
Jan 25, 2010 — 3 min read
Whiteship © 2022
Powered by Ghost