use of org.kanonizo.framework.objects.TestSuite in project kanonizo by kanonizo.
the class Mutation method parseKillMap.
private static void parseKillMap(File kill, TestSuite testSuite) {
CSVParser parser = null;
try {
parser = new CSVParser(new FileReader(kill), CSVFormat.DEFAULT);
for (CSVRecord record : parser.getRecords()) {
if (record.getRecordNumber() == 0) {
continue;
}
int testCase = Integer.parseInt(record.get(0));
int mutantKilled = Integer.parseInt(record.get(1));
TestCase test = testSuite.getOriginalOrdering().get(testCase - 1);
if (!killMap.containsKey(test)) {
killMap.put(test, new ArrayList<Mutant>());
}
killMap.get(test).addAll(getMutants(mutant -> mutant.getMutantId() == mutantKilled));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
parser.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Aggregations