| | |
| | | } |
| | | } |
| | | |
| | | @Test() |
| | | @Test |
| | | public void testWriteLineInOutputStream() throws UnsupportedEncodingException { |
| | | final MockConsoleApplication ca = MockConsoleApplication.getDefault(); |
| | | ca.print(msg); |
| | |
| | | assertThat(ca.getErr()).isEmpty(); |
| | | } |
| | | |
| | | @Test() |
| | | @Test |
| | | public void testWriteLineInErrorStream() throws UnsupportedEncodingException { |
| | | final MockConsoleApplication ca = MockConsoleApplication.getDefault(); |
| | | ca.errPrintln(msg); |
| | |
| | | assertThat(ca.getErr()).contains(msg.toString()); |
| | | } |
| | | |
| | | @Test() |
| | | @Test |
| | | public void testWriteOutputStreamVerbose() throws UnsupportedEncodingException { |
| | | final MockConsoleApplication ca = MockConsoleApplication.getDefault(); |
| | | ca.printVerboseMessage(msg); |
| | |
| | | assertThat(ca.getErr()).isEmpty(); |
| | | } |
| | | |
| | | @Test() |
| | | @Test |
| | | public void testWriteErrorStreamVerbose() throws UnsupportedEncodingException { |
| | | final MockConsoleApplication ca = MockConsoleApplication.getDefault(); |
| | | ca.errPrintVerboseMessage(msg); |
| | |
| | | * |
| | | * @throws UnsupportedEncodingException |
| | | */ |
| | | @Test() |
| | | @Test |
| | | public void testNonInteractiveApplicationShouldNotStdoutErrors() throws UnsupportedEncodingException { |
| | | final MockConsoleApplication ca = MockConsoleApplication.getDefault(); |
| | | |
| | |
| | | * |
| | | * @throws UnsupportedEncodingException |
| | | */ |
| | | @Test() |
| | | @Test |
| | | public void testInteractiveApplicationShouldStdoutErrors() throws UnsupportedEncodingException { |
| | | final MockConsoleApplication ca = MockConsoleApplication.getDefault(); |
| | | |
| | |
| | | * In quiet mode, only the stderr should contain lines. |
| | | * @throws UnsupportedEncodingException |
| | | */ |
| | | @Test() |
| | | @Test |
| | | public void testQuietMode() throws UnsupportedEncodingException { |
| | | final MockConsoleApplication ca = MockConsoleApplication.getDefault(); |
| | | ca.setQuiet(true); |