Package com.csvreader

Examples of com.csvreader.CsvReader


    reader.close();
  }

  @Test
  public void test79() {
    CsvReader reader;
    reader = CsvReader.parse("");
    reader.close();
    try {
      reader.readRecord();
    } catch (Exception ex) {
      assertException(
          new IOException(
              "This instance of the CsvReader class has already been closed."),
          ex);
View Full Code Here


    }
  }

  @Test
  public void test81() throws Exception {
    CsvReader reader = CsvReader.parse(generateString('a', 100001));
    try {
      reader.readRecord();
    } catch (Exception ex) {
      assertException(
          new IOException(
              "Maximum column length of 100,000 exceeded in column 0 in record 0. Set the SafetySwitch property to false if you're expecting column lengths greater than 100,000 characters to avoid this error."),
          ex);
    }
    reader.close();
  }
View Full Code Here

      holder.append("a,");
    }

    holder.append("a");

    CsvReader reader = CsvReader.parse(holder.toString());
    try {
      reader.readRecord();
    } catch (Exception ex) {
      assertException(
          new IOException(
              "Maximum column count of 100,000 exceeded in record 0. Set the SafetySwitch property to false if you're expecting more than 100,000 columns per record to avoid this error."),
          ex);
    }
    reader.close();
  }
View Full Code Here

    reader.close();
  }

  @Test
  public void test83() throws Exception {
    CsvReader reader = CsvReader.parse(generateString('a', 100001));
    reader.setSafetySwitch(false);
    reader.readRecord();
    reader.close();
  }
View Full Code Here

      holder.append("a,");
    }

    holder.append("a");

    CsvReader reader = CsvReader.parse(holder.toString());
    reader.setSafetySwitch(false);
    reader.readRecord();
    reader.close();
  }
View Full Code Here

    reader.close();
  }

  @Test
  public void test85() throws Exception {
    CsvReader reader = CsvReader.parse(generateString('a', 100000));
    reader.readRecord();
    reader.close();
  }
View Full Code Here

      holder.append("a,");
    }

    holder.append("a");

    CsvReader reader = CsvReader.parse(holder.toString());
    reader.readRecord();
    reader.close();
  }
View Full Code Here

  public void test87() throws Exception {
    CsvWriter writer = new CsvWriter("temp.csv");
    writer.write("1");
    writer.close();

    CsvReader reader = new CsvReader("temp.csv");
    Assert.assertTrue(reader.readRecord());
    Assert.assertEquals("1", reader.get(0));
    Assert.assertEquals(1, reader.getColumnCount());
    Assert.assertEquals(0L, reader.getCurrentRecord());
    Assert.assertFalse(reader.readRecord());
    reader.close();

    new File("temp.csv").delete();
  }
View Full Code Here

  }

  @Test
  public void test88() throws Exception {
    try {
      CsvReader reader = new CsvReader((String) null, ',', Charset
          .forName("ISO-8859-1"));
    } catch (Exception ex) {
      assertException(new IllegalArgumentException(
          "Parameter fileName can not be null."), ex);
    }
View Full Code Here

  }

  @Test
  public void test89() throws Exception {
    try {
      CsvReader reader = new CsvReader("temp.csv", ',', null);
    } catch (Exception ex) {
      assertException(new IllegalArgumentException(
          "Parameter charset can not be null."), ex);
    }
  }
View Full Code Here

TOP

Related Classes of com.csvreader.CsvReader

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.