use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class VersionSorter method getSelectedTests.
public static SelectedTests getSelectedTests(final File dependencyFile, final File executionFile, final File... additionalDependencyFiles) throws IOException, JsonParseException, JsonMappingException {
StaticTestSelection dependencies = null;
ExecutionData executionData = null;
if (dependencyFile != null) {
dependencies = Constants.OBJECTMAPPER.readValue(dependencyFile, StaticTestSelection.class);
return dependencies;
}
if (executionFile != null) {
executionData = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
return executionData;
}
if (dependencies == null) {
for (final File dependencytest : additionalDependencyFiles) {
dependencies = Constants.OBJECTMAPPER.readValue(dependencytest, StaticTestSelection.class);
return dependencies;
}
}
throw new RuntimeException("No dependencyfile provided");
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass-ci-plugin by jenkinsci.
the class RTSVisualizationCreator method readTraceBasedSelection.
private List<String> readTraceBasedSelection(final Run<?, ?> run) throws IOException, JsonParseException, JsonMappingException {
List<String> selectedTests = new LinkedList<>();
File traceTestSelectionFile = localWorkspace.getTraceTestSelectionFile();
if (traceTestSelectionFile.exists()) {
ExecutionData traceSelections = Constants.OBJECTMAPPER.readValue(traceTestSelectionFile, ExecutionData.class);
TestSet tests = traceSelections.getVersions().get(peassConfig.getMeasurementConfig().getExecutionConfig().getVersion());
if (tests != null) {
for (TestCase test : tests.getTests()) {
selectedTests.add(test.toString());
}
}
} else {
LOG.info("File {} was not found, RTS execution info might be incomplete", traceTestSelectionFile.getAbsoluteFile());
}
return selectedTests;
}
Aggregations