Search in sources :

Example 1 with ThrowingReader

use of tests.support.ThrowingReader in project j2objc by google.

the class OldBufferedReaderTest method testSourceThrowsWithMark.

public void testSourceThrowsWithMark() throws IOException {
    br = new BufferedReader(new ThrowingReader(new StringReader("ABCDEFGHI"), 4));
    br.read();
    br.read();
    br.mark(10);
    br.read();
    br.read();
    try {
        br.read();
        fail();
    } catch (IOException fromThrowingReader) {
    }
    assertEquals('E', br.read());
    assertEquals('F', br.read());
}
Also used : ThrowingReader(tests.support.ThrowingReader) BufferedReader(java.io.BufferedReader) Support_StringReader(tests.support.Support_StringReader) StringReader(java.io.StringReader) IOException(java.io.IOException)

Example 2 with ThrowingReader

use of tests.support.ThrowingReader in project robovm by robovm.

the class OldBufferedReaderTest method testSourceThrowsWithMark.

public void testSourceThrowsWithMark() throws IOException {
    br = new BufferedReader(new ThrowingReader(new StringReader("ABCDEFGHI"), 4));
    br.read();
    br.read();
    br.mark(10);
    br.read();
    br.read();
    try {
        br.read();
        fail();
    } catch (IOException fromThrowingReader) {
    }
    assertEquals('E', br.read());
    assertEquals('F', br.read());
}
Also used : ThrowingReader(tests.support.ThrowingReader) BufferedReader(java.io.BufferedReader) Support_StringReader(tests.support.Support_StringReader) StringReader(java.io.StringReader) IOException(java.io.IOException)

Aggregations

BufferedReader (java.io.BufferedReader)2 IOException (java.io.IOException)2 StringReader (java.io.StringReader)2 Support_StringReader (tests.support.Support_StringReader)2 ThrowingReader (tests.support.ThrowingReader)2