< prev index next >
test/jdk/java/util/Formatter/Constructors.java
Print this page
*** 399,414 ****
fail("new Formatter((OutputStream) null, \"ISO-8859-1\", Locale.UK)",
x);
}
try (PrintStream ps = new PrintStream("foo")) {
! new Formatter(ps, null, Locale.UK);
! fail("new Formatter(new PrintStream(\"foo\"), null, Locale.UK)");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new Formatter(new PrintStream(\"foo\"), null, Locale.UK)",
x);
}
try (PrintStream ps = new PrintStream("foo")) {
new Formatter(ps, "bar", Locale.UK);
--- 399,425 ----
fail("new Formatter((OutputStream) null, \"ISO-8859-1\", Locale.UK)",
x);
}
try (PrintStream ps = new PrintStream("foo")) {
! new Formatter(ps, (String)null, Locale.UK);
! fail("new Formatter(new PrintStream(\"foo\"), (String)null, Locale.UK)");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new Formatter(new PrintStream(\"foo\"), (String)null, Locale.UK)",
! x);
! }
!
! // Formatter(OutputStream os, Charset charset, Locale l)
! try (PrintStream ps = new PrintStream("foo")) {
! new Formatter(ps, (Charset)null, Locale.UK);
! fail("new Formatter(new PrintStream(\"foo\"), (Charset)null, Locale.UK)");
! } catch (NullPointerException x) {
! pass();
! } catch (Exception x) {
! fail("new Formatter(new PrintStream(\"foo\"), (Charset)null, Locale.UK)",
x);
}
try (PrintStream ps = new PrintStream("foo")) {
new Formatter(ps, "bar", Locale.UK);
*** 436,451 ****
fail("new PrintStream(\"foo\")", x);
}
// PrintStream(String fileName, String csn)
try {
! new PrintStream("foo", null);
! fail("new PrintStream(\"foo\", null)");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintStream(\"foo\", null)", x);
}
// PrintStream(File file)
try (PrintStream ps = new PrintStream(new File("foo"))) {
pass();
--- 447,472 ----
fail("new PrintStream(\"foo\")", x);
}
// PrintStream(String fileName, String csn)
try {
! new PrintStream("foo", (String)null);
! fail("new PrintStream(\"foo\", (String)null)");
! } catch (NullPointerException x) {
! pass();
! } catch (Exception x) {
! fail("new PrintStream(\"foo\", (String)null)", x);
! }
!
! // PrintStream(String fileName, Charset charset)
! try {
! new PrintStream("foo", (Charset)null);
! fail("new PrintStream(\"foo\", (Charset)null)");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintStream(\"foo\", (Charset)null)", x);
}
// PrintStream(File file)
try (PrintStream ps = new PrintStream(new File("foo"))) {
pass();
*** 453,468 ****
fail("new PrintStream(new File(\"foo\"))", x);
}
// PrintStream(File file, String csn)
try {
! new PrintStream(new File("foo"), null);
! fail("new PrintStream(new File(\"foo\"), null)");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintStream(new File(\"foo\"), null)", x);
}
// PrintWriter(String fileName)
try (PrintWriter pw = new PrintWriter("foo")) {
pass();
--- 474,499 ----
fail("new PrintStream(new File(\"foo\"))", x);
}
// PrintStream(File file, String csn)
try {
! new PrintStream(new File("foo"), (String)null);
! fail("new PrintStream(new File(\"foo\"), (String)null)");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintStream(new File(\"foo\"), (String)null)", x);
! }
!
! // PrintStream(File file, Charset charset)
! try {
! new PrintStream(new File("foo"), (Charset)null);
! fail("new PrintStream(new File(\"foo\"), (Charset)null)");
! } catch (NullPointerException x) {
! pass();
! } catch (Exception x) {
! fail("new PrintStream(new File(\"foo\"), (Charset)null)", x);
}
// PrintWriter(String fileName)
try (PrintWriter pw = new PrintWriter("foo")) {
pass();
*** 470,485 ****
fail("new PrintWriter(\"foo\")", x);
}
// PrintWriter(String fileName, String csn)
try {
! new PrintWriter("foo", null);
! fail("new PrintWriter(\"foo\"), null");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintWriter(\"foo\"), null", x);
}
// PrintWriter(File file)
try (PrintWriter pw = new PrintWriter(new File("foo"))) {
pass();
--- 501,526 ----
fail("new PrintWriter(\"foo\")", x);
}
// PrintWriter(String fileName, String csn)
try {
! new PrintWriter("foo", (String)null);
! fail("new PrintWriter(\"foo\"), (String)null");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintWriter(\"foo\"), (String)null", x);
! }
!
! // PrintWriter(String fileName, Charset charset)
! try {
! new PrintWriter("foo", (Charset)null);
! fail("new PrintWriter(\"foo\"), (Charset)null");
! } catch (NullPointerException x) {
! pass();
! } catch (Exception x) {
! fail("new PrintWriter(\"foo\"), (Charset)null", x);
}
// PrintWriter(File file)
try (PrintWriter pw = new PrintWriter(new File("foo"))) {
pass();
*** 487,502 ****
fail("new PrintWriter(new File(\"foo\"))", x);
}
// PrintWriter(File file, String csn)
try {
! new PrintWriter(new File("foo"), null);
! fail("new PrintWriter(new File(\"foo\")), null");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintWriter(new File(\"foo\")), null", x);
}
if (fail != 0)
throw new RuntimeException((fail + pass) + " tests: "
+ fail + " failure(s), first", first);
--- 528,553 ----
fail("new PrintWriter(new File(\"foo\"))", x);
}
// PrintWriter(File file, String csn)
try {
! new PrintWriter(new File("foo"), (String)null);
! fail("new PrintWriter(new File(\"foo\")), (String)null");
! } catch (NullPointerException x) {
! pass();
! } catch (Exception x) {
! fail("new PrintWriter(new File(\"foo\")), (String)null", x);
! }
!
! // PrintWriter(File file, Charset charset)
! try {
! new PrintWriter(new File("foo"), (Charset)null);
! fail("new PrintWriter(new File(\"foo\")), (Charset)null");
} catch (NullPointerException x) {
pass();
} catch (Exception x) {
! fail("new PrintWriter(new File(\"foo\")), (Charset)null", x);
}
if (fail != 0)
throw new RuntimeException((fail + pass) + " tests: "
+ fail + " failure(s), first", first);
< prev index next >