Package java.io

Examples of java.io.PipedReader


     * can cause a deadlock.
     */
    public void testGetInfo() throws IOException {
        sysinfo_api_helper sah = new sysinfo_api_helper();
        sah.start();
        PipedReader pipeR = new PipedReader(sah.getPipedWriter());
        BufferedReader br = new BufferedReader(pipeR);
        assertEquals("------------------ Java Information ------------------",
                     br.readLine());
        br.close();
        pipeR.close();
    }
View Full Code Here


    public char[] buf = new char[10];

    public PReader(PipedWriter pw) {
      try {
        pr = new PipedReader(pw);
      } catch (IOException e) {
        System.out.println("Exception setting up reader: "
            + e.toString());
      }
    }
View Full Code Here

    /**
     * @tests java.io.PipedReader#PipedReader(java.io.PipedWriter)
     */
    public void test_ConstructorLjava_io_PipedWriter() throws IOException {
        preader = new PipedReader(new PipedWriter());
    }
View Full Code Here

    /**
     * @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);
View Full Code Here

     * @tests java.io.PipedReader#connect(java.io.PipedWriter)
     */
    public void test_connectLjava_io_PipedWriter() throws Exception {
        char[] c = null;

        preader = new PipedReader();
        t = new Thread(pwriter = new PWriter(), "");
        preader.connect(pwriter.pw);
        t.start();
        Thread.sleep(500); // Allow writer to start
        c = new char[11];
View Full Code Here

    /**
     * @tests java.io.PipedReader#read()
     */
    public void test_read() 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];
        for (int i = 0; i < c.length; i++) {
View Full Code Here

    /**
     * @tests java.io.PipedReader#read(char[], int, int)
     */
    public void test_read$CII() 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];
        int n = 0;
View Full Code Here

     * @tests java.io.PipedReader#read(char[], int, int)
     */
    public void test_read$CII_2() throws IOException {
        // Regression for HARMONY-387
        PipedWriter pw = new PipedWriter();
        PipedReader obj = null;
        try {
            obj = new PipedReader(pw);
            obj.read(new char[0], (int) 0, (int) -1);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException t) {
            assertEquals(
                    "IndexOutOfBoundsException rather than a subclass expected",
                    IndexOutOfBoundsException.class, t.getClass());
View Full Code Here

    /**
     * @tests java.io.PipedReader#read(char[], int, int)
     */
    public void test_read$CII_3() throws IOException {
        PipedWriter pw = new PipedWriter();
        PipedReader obj = null;
        try {
            obj = new PipedReader(pw);
            obj.read(new char[0], (int) -1, (int) 0);
            fail("IndexOutOfBoundsException expected");
        } catch (ArrayIndexOutOfBoundsException t) {
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException t) {
            // Expected
View Full Code Here

    /**
     * @tests java.io.PipedReader#read(char[], int, int)
     */
    public void test_read$CII_4() throws IOException {
        PipedWriter pw = new PipedWriter();
        PipedReader obj = null;
        try {
            obj = new PipedReader(pw);
            obj.read(new char[0], (int) -1, (int) -1);
            fail("IndexOutOfBoundsException expected");
        } catch (ArrayIndexOutOfBoundsException t) {
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException t) {
            // Expected
View Full Code Here

TOP

Related Classes of java.io.PipedReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.