out.close();
}
public void testBalanceCSVHeaders() throws IOException {
generateTestFile(true);
BalanceCSV norm = new BalanceCSV();
norm.analyze(INPUT_NAME, true, CSVFormat.ENGLISH);
norm.process(OUTPUT_NAME, 1, 2);
BufferedReader tr = new BufferedReader(new FileReader(OUTPUT_NAME));
Assert.assertEquals("\"a\",\"b\"", tr.readLine());
Assert.assertEquals("one,1", tr.readLine());
Assert.assertEquals("two,1", tr.readLine());
Assert.assertEquals("four,2", tr.readLine());
Assert.assertEquals("five,2", tr.readLine());
Assert.assertEquals("six,3", tr.readLine());
Assert.assertEquals(2, norm.getCounts().get("1").intValue());
Assert.assertEquals(2, norm.getCounts().get("2").intValue());
Assert.assertEquals(1, norm.getCounts().get("3").intValue());
tr.close();
INPUT_NAME.delete();
OUTPUT_NAME.delete();