Esempio n. 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());
  }
Esempio n. 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());
  }
Esempio n. 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());
  }
Esempio n. 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("");
    }
  }