Example #1
0
  @Test
  public void test_loading_sample_2_file_two_Xes() throws IOException {
    file = getFile("sample_2.csv");
    result = loader.loadFromFile(file, Integer.class);

    Assert.assertEquals(6, result.getRowCount());
    Assert.assertEquals(3, result.getColumnCount());
  }
Example #2
0
  @Test
  public void test_loading_sample_0_file_doubles() throws IOException {
    file = getFile("sample_0.csv");
    result = loader.loadFromFile(file, Double.class);

    Assert.assertEquals(6, result.getRowCount());
    Assert.assertEquals(2, result.getColumnCount());
  }
Example #3
0
  @Test
  public void test_loading_empty_file_should_pass() throws IOException {
    file = getFile("empty.csv");
    result = loader.loadFromFile(file, Integer.class);

    Assert.assertEquals(0, result.getRowCount());

    // two columns are default value
    Assert.assertEquals(2, result.getColumnCount());
  }
Example #4
0
  @Test
  public void test_loading_sample_0_file_integers() throws IOException {
    file = getFile("sample_0.csv");
    result = loader.loadFromFile(file, Integer.class);

    Assert.assertEquals(6, result.getRowCount());
    Assert.assertEquals(2, result.getColumnCount());

    for (Number[] a : result.getRows()) {
      System.out.println("Line:");
      for (Number n : a) {
        System.out.print(n);
        System.out.print(" ");
      }
      System.out.println("");
    }
  }
Example #5
0
 @Test(expected = FileNotFoundException.class)
 public void test_loading_non_exitsting_file() throws IOException {
   file = getFile("some_none_existing_file");
   loader.loadFromFile(file, Integer.class);
 }