use of org.evosuite.utils.DebuggingObjectOutputStream in project evosuite by EvoSuite.
the class TestSuiteSerialization method saveTests.
public static boolean saveTests(TestSuiteChromosome ts, File target) throws IllegalArgumentException {
File parent = target.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
try (ObjectOutputStream out = new DebuggingObjectOutputStream(new FileOutputStream(target))) {
for (TestChromosome tc : ts.getTestChromosomes()) {
out.writeObject(tc);
}
out.flush();
out.close();
} catch (IOException e) {
logger.error("Failed to open/handle " + target.getAbsolutePath() + " for writing: " + e.getMessage());
return false;
}
return true;
}
use of org.evosuite.utils.DebuggingObjectOutputStream in project evosuite by EvoSuite.
the class TestSuiteSerialization method saveTests.
public static boolean saveTests(List<TestSuiteChromosome> list, File target) throws IllegalArgumentException {
Inputs.checkNull(list, target);
File parent = target.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
try (ObjectOutputStream out = new DebuggingObjectOutputStream(new FileOutputStream(target))) {
for (TestSuiteChromosome ts : list) {
for (TestChromosome tc : ts.getTestChromosomes()) {
out.writeObject(tc);
}
}
out.flush();
out.close();
} catch (IOException e) {
logger.error("Failed to open/handle " + target.getAbsolutePath() + " for writing: " + e.getMessage());
return false;
}
return true;
}
use of org.evosuite.utils.DebuggingObjectOutputStream in project evosuite by EvoSuite.
the class ObjectPool method writePool.
public void writePool(String fileName) {
try {
ObjectOutputStream out = new DebuggingObjectOutputStream(new FileOutputStream(fileName));
out.writeObject(this);
out.close();
} catch (IOException e) {
logger.warn("Error while writing pool to file " + fileName + ": " + e);
}
}
Aggregations