File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
spring-boot/src/test/java/org/springframework/boot Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,19 @@ protected void releaseOutput() {
7272 this .copy = null ;
7373 }
7474
75+ public void flush () {
76+ try {
77+ this .captureOut .flush ();
78+ this .captureErr .flush ();
79+ }
80+ catch (IOException e ) {
81+ // ignore
82+ }
83+ }
84+
7585 @ Override
7686 public String toString () {
87+ flush ();
7788 return this .copy .toString ();
7889 }
7990
@@ -104,12 +115,17 @@ public void write(byte[] b) throws IOException {
104115 public void write (byte [] b , int off , int len ) throws IOException {
105116 this .copy .write (b , off , len );
106117 this .original .write (b , off , len );
107- this .original .flush ();
108118 }
109119
110120 public PrintStream getOriginal () {
111121 return this .original ;
112122 }
123+
124+ @ Override
125+ public void flush () throws IOException {
126+ this .copy .flush ();
127+ this .original .flush ();
128+ }
113129 }
114130
115131 /**
You can’t perform that action at this time.
0 commit comments