Search in sources :

Example 1 with ReadProperties

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();
    }
}
Also used : ReadProperties(de.dagere.peass.ReadProperties) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) ResultsFolders(de.dagere.peass.folders.ResultsFolders) PropertyReader(de.dagere.peass.analysis.properties.PropertyReader) File(java.io.File) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Aggregations

ReadProperties (de.dagere.peass.ReadProperties)1 PropertyReader (de.dagere.peass.analysis.properties.PropertyReader)1 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)1 ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)1 ResultsFolders (de.dagere.peass.folders.ResultsFolders)1 File (java.io.File)1