| 25 | import java.util.List; |
| 26 | |
| 27 | public class App |
| 28 | { |
| 29 | |
| 30 | public void foo() |
| 31 | throws Exception |
| 32 | { |
| 33 | Thread.sleep( 500 ); |
| 34 | } |
| 35 | |
| 36 | public void beer() |
| 37 | throws Exception |
| 38 | { |
| 39 | this.foo(); |
| 40 | this.pub( "blabla", Arrays.asList( "Mountain Goat", "Fatyak" ), 2 ); |
| 41 | } |
| 42 | |
| 43 | public void pub( String foo, List<String> beers, int i ) |
| 44 | throws Exception |
| 45 | { |
| 46 | Thread.sleep( 100 ); |
| 47 | this.bar(); |
| 48 | } |
| 49 | |
| 50 | public App bar() |
| 51 | throws Exception |
| 52 | { |
| 53 | Thread.sleep( 300 ); |
| 54 | return this; |
| 55 | } |
| 56 | |
| 57 | |
| 58 | public App redirectStreamout() |
| 59 | { |
| 60 | System.setOut( new LogHandler( System.out ) ); |
| 61 | return this; |
| 62 | } |
| 63 | |
| 64 | private static class LogHandler |
| 65 | extends PrintStream |
| 66 | { |
| 67 | OutputStream outputStream; |
| 68 | |
| 69 | public LogHandler( OutputStream outputStream ) |
| 70 | { |
| 71 | super( outputStream ); |
| 72 | this.outputStream = outputStream; |
| 73 | } |
| 74 | |
| 75 | @Override |
| 76 | public void println( String s ) |
| 77 | { |
| 78 | try |
| 79 | { |
| 80 | super.write( s.getBytes() ); |
| 81 | } |
| 82 | catch ( IOException e ) |
| 83 | { |
| 84 | e.printStackTrace(); |
nothing calls this directly
no outgoing calls
no test coverage detected