< prev index next >
test/jdk/java/io/Reader/NullReader.java
Print this page
@@ -33,11 +33,11 @@
import static org.testng.Assert.*;
/*
* @test
- * @bug 8196298
+ * @bug 8196298 8204930
* @run testng NullReader
* @summary Check for expected behavior of Reader.nullReader().
*/
public class NullReader {
private static Reader openReader;
@@ -94,10 +94,15 @@
assertEquals(0, openReader.read(charBuffer),
"read(CharBuffer) != 0");
}
@Test(groups = "open")
+ public static void testReady() throws IOException {
+ assertFalse(openReader.ready());
+ }
+
+ @Test(groups = "open")
public static void testSkip() throws IOException {
assertEquals(0, openReader.skip(1), "skip() != 0");
}
@Test(groups = "open")
@@ -127,10 +132,15 @@
CharBuffer charBuffer = CharBuffer.allocate(0);
closedReader.read(charBuffer);
}
@Test(groups = "closed", expectedExceptions = IOException.class)
+ public static void testReadyClosed() throws IOException {
+ closedReader.ready();
+ }
+
+ @Test(groups = "closed", expectedExceptions = IOException.class)
public static void testSkipClosed() throws IOException {
closedReader.skip(1);
}
@Test(groups = "closed", expectedExceptions = IOException.class)
< prev index next >