Examples of Support_StringReader


Examples of tests.support.Support_StringReader

   * @tests java.io.BufferedReader#readLine()
   */
  public void test_readLine() {
    // Test for method java.lang.String java.io.BufferedReader.readLine()
    try {
      br = new BufferedReader(new Support_StringReader(testString));
      String r = br.readLine();
      assertEquals("readLine returned incorrect string", "Test_All_Tests", r
          );
    } catch (java.io.IOException e) {
      fail("Exception during readLine test");
View Full Code Here

Examples of tests.support.Support_StringReader

   * @tests java.io.BufferedReader#ready()
   */
  public void test_ready() {
    // Test for method boolean java.io.BufferedReader.ready()
    try {
      br = new BufferedReader(new Support_StringReader(testString));
      assertTrue("ready returned false", br.ready());
    } catch (java.io.IOException e) {
      fail("Exception during ready test" + e.toString());
    }
  }
View Full Code Here

Examples of tests.support.Support_StringReader

   * @tests java.io.BufferedReader#reset()
   */
  public void test_reset() {
    // Test for method void java.io.BufferedReader.reset()
    try {
      br = new BufferedReader(new Support_StringReader(testString));
      br.skip(500);
      br.mark(900);
      br.skip(500);
      br.reset();
      char[] buf = new char[testString.length()];
      br.read(buf, 0, 500);
      assertTrue("Failed to reset properly", testString.substring(500,
          1000).equals(new String(buf, 0, 500)));
    } catch (java.io.IOException e) {
      fail("Exception during reset test");
    }
    try {
      br = new BufferedReader(new Support_StringReader(testString));
      br.skip(500);
      br.reset();
      fail("Reset succeeded on unmarked stream");
    } catch (IOException x) {
      return;
View Full Code Here

Examples of tests.support.Support_StringReader

   * @tests java.io.BufferedReader#skip(long)
   */
  public void test_skipJ() {
    // Test for method long java.io.BufferedReader.skip(long)
    try {
      br = new BufferedReader(new Support_StringReader(testString));
      br.skip(500);
      char[] buf = new char[testString.length()];
      br.read(buf, 0, 500);
      assertTrue("Failed to set skip properly", testString.substring(500,
          1000).equals(new String(buf, 0, 500)));
View Full Code Here

Examples of tests.support.Support_StringReader

    String s;
    pw.println("Random Chars");
    pw.write("Hello World");
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      s = br.readLine();
      assertTrue("Incorrect string written/read: " + s, s
          .equals("Random Chars"));
      s = br.readLine();
      assertTrue("Incorrect string written/read: " + s, s
View Full Code Here

Examples of tests.support.Support_StringReader

    String s;
    pw = new PrintWriter(bao, true);
    pw.println("Random Chars");
    pw.write("Hello World");
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      s = br.readLine();
      assertTrue("Incorrect string written/read: " + s, s
          .equals("Random Chars"));
      pw.flush();
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      s = br.readLine();
      assertTrue("Incorrect string written/read: " + s, s
          .equals("Random Chars"));
      s = br.readLine();
      assertTrue("Incorrect string written/read: " + s, s
View Full Code Here

Examples of tests.support.Support_StringReader

    char[] schars = new char[11];
    "Hello World".getChars(0, 11, schars, 0);
    pw.print(schars);
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
    assertTrue("Wrote incorrect char[] string: " + s, s
View Full Code Here

Examples of tests.support.Support_StringReader

    pw.println("Blarg");
    pw.println();
    pw.println("Bleep");
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      s = br.readLine();
      assertTrue("Wrote incorrect line: " + s, s.equals("Blarg"));
      s = br.readLine();
      assertTrue("Wrote incorrect line: " + s, s.equals(""));
      s = br.readLine();
View Full Code Here

Examples of tests.support.Support_StringReader

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

Examples of tests.support.Support_StringReader

    String s = null;
    pw.println("Random Chars");
    pw.println('c');
    pw.flush();
    try {
      br = new BufferedReader(new Support_StringReader(bao.toString()));
      s = br.readLine();
      s = br.readLine();
    } catch (IOException e) {
      fail("IOException during test : " + e.getMessage());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.