use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class TestCreateMeasurementExecutionScript method testFromDependencies.
@Test
public void testFromDependencies() throws IOException {
ExecutionData executiondata = buildExecutionDataWithTests();
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (PrintStream ps = new PrintStream(baos)) {
RunCommandWriter writer = new RunCommandWriter(ps, "experiment-1", executiondata);
CreateMeasurementExecutionScript.generateExecuteCommands(executiondata, "experiment-1", writer);
}
String result = baos.toString();
System.out.println(result);
MatcherAssert.assertThat(result, Matchers.containsString("-test Test1#testMe"));
MatcherAssert.assertThat(result, Matchers.containsString("-test Test5#testMe"));
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass-ci-plugin by jenkinsci.
the class TestRTSVisualizationCreator method writeEmptyExecutionData.
private void writeEmptyExecutionData(final ResultsFolders localWorkspace) throws IOException, JsonGenerationException, JsonMappingException {
ExecutionData data = new ExecutionData();
Constants.OBJECTMAPPER.writeValue(localWorkspace.getTraceTestSelectionFile(), data);
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class GetChanges method call.
@Override
public Void call() throws Exception {
SelectedTests selectedTests = VersionSorter.getSelectedTests(staticSelectionFile, executionFile);
if (!out.exists()) {
out.mkdirs();
}
LOG.info("Errors: 1: {} 2: {}", statisticConfigMixin.getType1error(), statisticConfigMixin.getType2error());
ResultsFolders folders = new ResultsFolders(out, "out");
final ChangeReader reader = createReader(folders, selectedTests);
if (staticSelectionFile != null) {
StaticTestSelection dependencies = Constants.OBJECTMAPPER.readValue(staticSelectionFile, StaticTestSelection.class);
reader.setTests(dependencies.toExecutionData().getVersions());
}
if (executionFile != null) {
ExecutionData executions = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
reader.setTests(executions.getVersions());
}
for (final File dataFile : data) {
reader.readFile(dataFile);
}
return null;
}
use of de.dagere.peass.dependency.persistence.ExecutionData 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();
}
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class SourceReader method executeSourceReading.
public void executeSourceReading(final Set<TestCase> tests) {
ExecutionData executionData = new ExecutionData();
executionData.addEmptyVersion(version, versionOld);
if (versionOld != null) {
executionData.addEmptyVersion(versionOld, null);
}
for (TestCase test : tests) {
executionData.addCall(version, test);
}
LOG.info("Reading method sources for {} - {}", version, versionOld);
final PropertyReader propertyReader = new PropertyReader(resultsFolders, folders.getProjectFolder(), executionData, config);
propertyReader.readAllTestsProperties();
}
Aggregations