Code example for LineNumberReader

Methods: getLineNumber, readLine

0
        assertEquals("world", lnr.readLine());
        assertEquals(2, lnr.getLineNumber());
    } 
 
    public void testGetLineNumberAfterEnd() throws IOException { 
        lnr = new LineNumberReader(new StringReader("hello\nworld"));
        assertEquals(0, lnr.getLineNumber());
        assertEquals("hello", lnr.readLine());
        assertEquals(1, lnr.getLineNumber());
        assertEquals("world", lnr.readLine());
        assertEquals(2, lnr.getLineNumber());
        assertEquals(null, lnr.readLine());
        assertEquals(2, lnr.getLineNumber());
        assertEquals(null, lnr.readLine());
        assertEquals(2, lnr.getLineNumber());
    } 
 
    /** 
     * @tests java.io.LineNumberReader#setLineNumber(int) 
     */ 
    public void test_setLineNumberI() {