use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class MissingExecutionFinder method removeXMLExecutions.
private void removeXMLExecutions(final File folder) throws JAXBException {
for (final File measurementFile : folder.listFiles()) {
if (measurementFile.getName().endsWith(".xml")) {
LOG.info("File:" + measurementFile);
final Kopemedata data = new XMLDataLoader(measurementFile).getFullData();
for (final TestcaseType testcase : data.getTestcases().getTestcase()) {
final String testmethod = testcase.getName();
for (final Chunk c : testcase.getDatacollector().get(0).getChunk()) {
final String version = findVersion(c);
LOG.debug("Removing {}", version);
final TestSet versionsTests = tests.getVersions().get(version);
if (versionsTests != null) {
removeTestFromTestSet(data.getTestcases().getClazz(), testmethod, versionsTests);
}
}
}
}
}
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class CopyFromFull method checkFileMerging.
public static void checkFileMerging(final File goal, final ExecutionData tests, final File source) throws JAXBException {
Kopemedata kopemeData = XMLDataLoader.loadData(source);
Testcases testcase = kopemeData.getTestcases();
TestcaseType testcaseType = testcase.getTestcase().get(0);
String clazz = testcase.getClazz();
String method = testcaseType.getName();
TestCase testcase2 = new TestCase(testcase);
List<Chunk> chunks = testcaseType.getDatacollector().get(0).getChunk();
if (!goal.exists()) {
goal.mkdirs();
}
for (Chunk chunk : chunks) {
checkChunkMerging(goal, tests, testcase2, chunk);
}
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestResultOrganizer method testXMLFileIsCorrect.
private void testXMLFileIsCorrect() throws JAXBException {
File kopemefile = new File(getVersionMeasurementFolder(), searchedTest.getMethod() + "_0_" + VERSION_NAME + ".xml");
Kopemedata data = XMLDataLoader.loadData(kopemefile);
final Datacollector datacollector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
final Fulldata fulldata = datacollector.getResult().get(0).getFulldata();
Assert.assertNotNull(fulldata.getFileName());
File fulldataFile = new File(getVersionMeasurementFolder(), fulldata.getFileName());
Assert.assertTrue(fulldataFile.exists());
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestResultOrganizerParallel method testXMLFileIsCorrect.
private void testXMLFileIsCorrect() throws JAXBException {
File kopemefile = new File(getVersionMeasurementFolder(TestResultOrganizer.VERSION_NAME, PARALLEL_VERSION), TestResultOrganizer.searchedTest.getMethod() + "_0_" + PARALLEL_VERSION + ".xml");
Kopemedata data = XMLDataLoader.loadData(kopemefile);
final Datacollector datacollector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
final Fulldata fulldata = datacollector.getResult().get(0).getFulldata();
Assert.assertNotNull(fulldata.getFileName());
File fulldataFile = new File(getVersionMeasurementFolder(TestResultOrganizer.VERSION_NAME, PARALLEL_VERSION), fulldata.getFileName());
Assert.assertTrue(fulldataFile.exists());
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestResultOrganizerParams method testReading.
@Test
public void testReading() throws JAXBException, IOException {
TestCase testcase = new TestCase("de.dagere.peass.ExampleBenchmarkClazz#calleeMethod");
PeassFolders folders = mockFolders(testcase);
for (int i = 0; i < 3; i++) {
ResultOrganizer organizer = new ResultOrganizer(folders, VERSION, 15 + i, false, false, testcase, 10);
organizer.saveResultFiles(VERSION, i);
organizer.saveResultFiles(VERSION_OLD, i);
}
File expectedResultFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1).xml");
File expectedResultFile2 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2).xml");
Assert.assertTrue(expectedResultFile1.exists());
Assert.assertTrue(expectedResultFile2.exists());
Kopemedata data = XMLDataLoader.loadData(expectedResultFile1);
List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk().get(0).getResult();
MatcherAssert.assertThat(results, IsIterableWithSize.iterableWithSize(2));
File expectedFulldataFile = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2)_0_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
Kopemedata fulldata = XMLDataLoader.loadData(expectedFulldataFile);
Assert.assertEquals(1, fulldata.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
File expectedFulldataFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1)_2_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
Kopemedata fulldata1 = XMLDataLoader.loadData(expectedFulldataFile1);
Assert.assertEquals(1, fulldata1.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
}
Aggregations