Code example for PipedWriter

Methods: closewrite

0
    public void test_ConstructorLjava_io_PipedReader() throws Exception { 
        // Test for method java.io.PipedWriter(java.io.PipedReader) 
        char[] buf = new char[10];
        "HelloWorld".getChars(0, 10, buf, 0);
        PipedReader rd = new PipedReader();
        pw = new PipedWriter(rd);
        rdrThread = new Thread(reader = new PReader(rd), "Constructor(Reader)");
        rdrThread.start();
        pw.write(buf);
        pw.close();
        rdrThread.join(500);
        assertEquals("Failed to construct writer", "HelloWorld", new String(
                reader.buf));
    } 
 
    /** 
     * @tests java.io.PipedWriter#close() 
     */ 
    public void test_close() throws Exception { 
        // Test for method void java.io.PipedWriter.close() 
        char[] buf = new char[10];