Code example for LineNumberInputStream

Methods: getLineNumber, read, setLineNumber

0
    /** 
     * @tests java.io.LineNumberInputStream#getLineNumber() 
     */ 
    public void test_getLineNumber() throws IOException { 
        assertEquals("New stream returned line number other than zero", 0, lnis
                .getLineNumber());
 
        lnis.read();
        lnis.read();
 
        assertEquals("stream returned incorrect line number after read", 1,
                lnis.getLineNumber());
 
        lnis.setLineNumber(89);
        assertEquals("stream returned incorrect line number after set", 89,
                lnis.getLineNumber());
    } 
 
    /** 
     * @tests java.io.LineNumberInputStream#mark(int) 
     */