use of de.dagere.peass.ReadProperties in project peass by DaGeRe.
the class ReadAllProperties method getProperties.
static void getProperties(final RepoFolders folders, final String project) throws JAXBException, IOException, JsonParseException, JsonMappingException, JsonGenerationException {
final File viewFolder = new File(folders.getAllViewFolder(), "views_" + project);
final File executionFile = new File(folders.getDependencyFolder(), ResultsFolders.TRACE_SELECTION_PREFIX + project + ".json");
final ExecutionData changedTests = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
final File projectFolder = new File("../../projekte/" + project);
if (!projectFolder.exists()) {
GitUtils.downloadProject(changedTests.getUrl(), projectFolder);
}
if (!readAll) {
final File changeFile = new File(folders.getResultsFolder(), project + File.separator + project + ".json");
if (changeFile.exists()) {
final File resultFile = new File(folders.getPropertiesFolder(), project + File.separator + project + ".json");
if (!resultFile.getParentFile().exists()) {
resultFile.getParentFile().mkdir();
}
final ReadProperties reader = new ReadProperties(resultFile);
reader.readChangeProperties(changeFile, projectFolder, viewFolder, changedTests);
} else {
System.err.println("Error: " + changeFile.getAbsolutePath() + " does not exist");
}
} else {
ResultsFolders resultsFolders = new ResultsFolders(folders.getPropertiesFolder().getParentFile(), project);
new PropertyReader(resultsFolders, projectFolder, changedTests, new ExecutionConfig()).readAllTestsProperties();
}
}
Aggregations