|
3 | 3 | import malva.TestCase;
|
4 | 4 |
|
5 | 5 | import java.io.ByteArrayOutputStream;
|
| 6 | +import java.io.File; |
| 7 | +import java.io.FileNotFoundException; |
6 | 8 | import java.io.OutputStream;
|
7 | 9 | import java.io.PrintStream;
|
8 | 10 | import java.io.UnsupportedEncodingException;
|
9 | 11 |
|
10 | 12 | public class PrintStreamTest extends TestCase {
|
11 | 13 | public static void testConstructor() throws UnsupportedEncodingException {
|
12 | 14 | final OutputStream out = new ByteArrayOutputStream();
|
13 |
| -/* @since 1.5 |
14 | 15 | assertThrows(new Block() {
|
15 |
| - @Override public void run() { |
| 16 | + @Override public void run() throws FileNotFoundException { |
16 | 17 | new PrintStream((File) null);
|
17 | 18 | }
|
18 | 19 | }, NullPointerException.class);
|
19 | 20 | assertThrows(new Block() {
|
20 |
| - @Override public void run() { |
| 21 | + @Override public void run() throws FileNotFoundException, UnsupportedEncodingException { |
21 | 22 | new PrintStream((File) null, "utf-8");
|
22 | 23 | }
|
23 | 24 | }, NullPointerException.class);
|
24 |
| -*/ |
25 | 25 | assertThrows(new Block() {
|
26 | 26 | @Override public void run() {
|
27 | 27 | new PrintStream((OutputStream) null);
|
@@ -55,18 +55,16 @@ public static void testConstructor() throws UnsupportedEncodingException {
|
55 | 55 | }
|
56 | 56 | }, UnsupportedEncodingException.class);
|
57 | 57 | assertNotNull(new PrintStream(out, true, "utf-8"));
|
58 |
| -/* @since 1.5 |
59 | 58 | assertThrows(new Block() {
|
60 |
| - @Override public void run() { |
| 59 | + @Override public void run() throws FileNotFoundException { |
61 | 60 | new PrintStream((String) null);
|
62 | 61 | }
|
63 | 62 | }, NullPointerException.class);
|
64 | 63 | assertThrows(new Block() {
|
65 |
| - @Override public void run() { |
| 64 | + @Override public void run() throws FileNotFoundException, UnsupportedEncodingException { |
66 | 65 | new PrintStream((String) null, (String) "utf-8");
|
67 | 66 | }
|
68 | 67 | }, NullPointerException.class);
|
69 |
| -*/ |
70 | 68 | }
|
71 | 69 |
|
72 | 70 | public static void main(String[] args) throws Exception {
|
|
0 commit comments