Package tests.support

Examples of tests.support.Support_StringReader


    String s = null;
    pw.println("Random Chars");
    pw.println(new Bogus());
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
View Full Code Here


    String s = null;
    pw.println("Random Chars");
    pw.println("Hello World");
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
View Full Code Here

    String s = null;
    pw.println("Random Chars");
    pw.println(false);
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
View Full Code Here

    "Hello World".getChars(0, 11, schars, 0);
    pw.println("Random Chars");
    pw.write(schars);
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test: " + e.getMessage());
    }
View Full Code Here

    "Hello World".getChars(0, 11, schars, 0);
    pw.println("Random Chars");
    pw.write(schars, 6, 5);
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
View Full Code Here

    String s = null;
    pw.println("Random Chars");
    pw.write("Hello World");
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
View Full Code Here

    String s = null;
    pw.println("Random Chars");
    pw.write("Hello World", 6, 5);
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
View Full Code Here

   * @tests java.io.BufferedReader#close()
   */
  public void test_close() {
    // Test for method void java.io.BufferedReader.close()
    try {
      br = new BufferedReader(new Support_StringReader(testString));
      br.close();
      br.read();
      fail("Read on closed stream");
    } catch (IOException x) {
      return;
View Full Code Here

   * @tests java.io.BufferedReader#mark(int)
   */
  public void test_markI() throws IOException {
    // Test for method void java.io.BufferedReader.mark(int)
    char[] buf = null;
    br = new BufferedReader(new Support_StringReader(testString));
    br.skip(500);
    br.mark(1000);
    br.skip(250);
    br.reset();
    buf = new char[testString.length()];
    br.read(buf, 0, 500);
    assertTrue("Failed to set mark properly", testString.substring(500,
        1000).equals(new String(buf, 0, 500)));

    try {
      br = new BufferedReader(new Support_StringReader(testString), 800);
      br.skip(500);
      br.mark(250);
      br.read(buf, 0, 1000);
      br.reset();
      fail("Failed to invalidate mark properly");
    } catch (IOException x) {
        // Expected
    }

    char[] chars = new char[256];
    for (int i = 0; i < 256; i++)
      chars[i] = (char) i;
    Reader in = new BufferedReader(new Support_StringReader(new String(
        chars)), 12);

    in.skip(6);
    in.mark(14);
    in.read(new char[14], 0, 14);
    in.reset();
    assertTrue("Wrong chars", in.read() == (char) 6
        && in.read() == (char) 7);

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
    in.mark(8);
    in.skip(7);
    in.reset();
    assertTrue("Wrong chars 2", in.read() == (char) 6
View Full Code Here

  /**
   * @tests java.io.BufferedReader#markSupported()
   */
  public void test_markSupported() {
    // Test for method boolean java.io.BufferedReader.markSupported()
    br = new BufferedReader(new Support_StringReader(testString));
    assertTrue("markSupported returned false", br.markSupported());
  }
View Full Code Here

TOP

Related Classes of tests.support.Support_StringReader

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.