use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.
the class RTLauncher method initSerializerEngines.
private void initSerializerEngines() {
this.engines = new ArrayList<>();
List<SerializerEngine> fileSerializerEngines = LauncherUtils.initFileSerializerEngines(LOGGER);
this.engines.addAll(fileSerializerEngines);
SerializerEngine mongoDBSerializerEngine = LauncherUtils.initMongoDBSerializerEngine(LOGGER);
if (mongoDBSerializerEngine != null) {
this.engines.add(mongoDBSerializerEngine);
}
}
use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.
the class WatchedBuildSerializer method serialize.
public void serialize(Build build) {
SerializedData data = new SerializedData(this.serializeAsList(build), this.serializeAsJson(build));
List<SerializedData> allData = new ArrayList<>();
allData.add(data);
for (SerializerEngine engine : this.getEngines()) {
engine.serialize(allData, this.getType());
}
}
use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.
the class ScannerSerializer4Bears method serialize.
public void serialize() {
SerializedData data = new SerializedData(this.serializeAsList(), this.serializeAsJson());
List<SerializedData> allData = new ArrayList<>();
allData.add(data);
for (SerializerEngine engine : this.getEngines()) {
engine.serialize(allData, this.getType());
}
}
use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.
the class LauncherUtils method initFileSerializerEngines.
public static List<SerializerEngine> initFileSerializerEngines(Logger logger) {
List<SerializerEngine> fileSerializerEngines = new ArrayList<>();
RepairnatorConfig config = RepairnatorConfig.getInstance();
if (config.getOutputPath() != null) {
logger.info("Initialize file serializer engines.");
String path = config.getOutputPath();
path += config.getBuildId() > 0 ? "/" + config.getBuildId() : "";
fileSerializerEngines.add(new CSVSerializerEngine(path));
fileSerializerEngines.add(new JSONFileSerializerEngine(path));
} else {
logger.info("File serializers won't be used.");
}
return fileSerializerEngines;
}
use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.
the class MetricsSerializer method serializeData.
@Override
public void serializeData(ProjectInspector inspector) {
Gson gson = new GsonBuilder().registerTypeAdapter(Metrics.class, new MetricsSerializerAdapter()).create();
JsonObject element = (JsonObject) gson.toJsonTree(inspector.getJobStatus().getMetrics());
element.addProperty("runId", RepairnatorConfig.getInstance().getRunId());
this.addDate(element, "reproductionDate", new Date());
element.addProperty("buggyBuildId", inspector.getBuggyBuild().getId());
element.addProperty("buildStatus", inspector.getBuildToBeInspected().getStatus().name());
if (inspector.getPatchedBuild() != null) {
element.addProperty("patchedBuildId", inspector.getPatchedBuild().getId());
}
element.addProperty("status", this.getPrettyPrintState(inspector));
List<SerializedData> dataList = new ArrayList<>();
dataList.add(new SerializedData(new ArrayList<>(), element));
for (SerializerEngine engine : this.getEngines()) {
engine.serialize(dataList, this.getType());
}
}
Aggregations