Code example for PipedReader

Methods: close, read, sleep

0
    /** 
     * @tests java.io.PipedReader#close() 
     */ 
    public void test_close() throws Exception { 
        char[] c = null;
        preader = new PipedReader();
        t = new Thread(new PWriter(preader), "");
        t.start();
        Thread.sleep(500); // Allow writer to start
        c = new char[11];
        preader.read(c, 0, 11);
        preader.close();
        assertEquals("Read incorrect chars", "Hello World", new String(c));
    } 
 
    /** 
     * @tests java.io.PipedReader#connect(java.io.PipedWriter) 
     */ 
    public void test_connectLjava_io_PipedWriter() throws Exception { 
        char[] c = null;