use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class IsChange method call.
@Override
public Integer call() throws Exception {
LOG.debug("Checking: {}", dataFolder);
final File xmlFile = dataFolder.listFiles((FilenameFilter) new WildcardFileFilter("*.xml"))[0];
final Kopemedata data = new XMLDataLoader(xmlFile).getFullData();
final Chunk chunk = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk().get(0);
final String[] versions = KoPeMeDataHelper.getVersions(chunk);
LOG.debug(versions[1]);
final DescribedChunk describedChunk = new DescribedChunk(chunk, versions[0], versions[1]);
final boolean change = describedChunk.getStatistic(statisticConfigMixin.getStasticsConfig()).isChange();
LOG.info("Change: {}", change);
// TODO Auto-generated method stub
return change ? 1 : 0;
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class Cleaner method handleChunk.
private void handleChunk(final Entry<String, EvaluationPair> entry, TestCase testcase, final Chunk currentChunk) {
try {
final MeasurementFileFinder finder = new MeasurementFileFinder(cleanFolder, testcase);
final File measurementFile = finder.getMeasurementFile();
final Kopemedata oneResultData = finder.getOneResultData();
Datacollector datacollector = finder.getDataCollector();
if (checkChunk(currentChunk)) {
datacollector.getChunk().add(currentChunk);
XMLDataStorer.storeData(measurementFile, oneResultData);
correct++;
} else {
printFailureInfo(entry, currentChunk, measurementFile);
}
} catch (final JAXBException e) {
e.printStackTrace();
}
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class DataReader method readMeasurementFile.
private static void readMeasurementFile(final Map<String, TestData> currentMeasurement, final File versionOfPair, final File versionCurrent, final File measurementFile) {
try {
final Kopemedata resultData = new XMLDataLoader(measurementFile).getFullData();
final String testclazz = resultData.getTestcases().getClazz();
TestCase testcase = new TestCase(resultData.getTestcases());
TestData testData = currentMeasurement.get(testcase.getMethodWithParams());
if (testData == null) {
final File originFile = measurementFile.getParentFile().getParentFile().getParentFile().getParentFile().getParentFile().getParentFile().getParentFile();
testData = new TestData(testcase, originFile);
currentMeasurement.put(testcase.getMethodWithParams(), testData);
}
String predecessor = null;
final File[] versionFiles = versionOfPair.listFiles();
for (final File version : versionFiles) {
if (!version.getName().equals(versionOfPair.getName())) {
predecessor = version.getName();
}
}
if (predecessor != null) {
testData.addMeasurement(versionOfPair.getName(), versionCurrent.getName(), predecessor, resultData);
} else {
LOG.error("No predecessor data for {} {} {} {}", versionCurrent.getName(), predecessor, testclazz, testcase.getMethodWithParams());
}
} catch (final JAXBException e) {
LOG.error("An exception occured during reading the measurement results");
e.printStackTrace();
}
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestSummaryFileSaving method testSummaryFileSavingExternalFile.
@Test
public void testSummaryFileSavingExternalFile() throws JAXBException {
DummyKoPeMeDataCreator.initDummyTestfile(testFolder, TestResult.BOUNDARY_SAVE_FILE * 2, testcase);
final XMLDataLoader loader = new XMLDataLoader(oneResultFile);
loader.readFulldataValues();
Kopemedata oneRunFullData = loader.getFullData();
TestcaseType oneRunData = oneRunFullData.getTestcases().getTestcase().get(0);
final File resultFile = new File(testFolder, "result.xml");
MultipleVMTestUtil.saveSummaryData(resultFile, oneResultFile, oneRunData.getDatacollector().get(0).getResult().get(0), testcase, "1", 0, TimeDataCollector.class.getName());
Assert.assertTrue(resultFile.exists());
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestResultConversion method testIterations.
@Test
public void testIterations() throws JAXBException {
File jmhFile = new File(CONVERSION_FOLDER, "test.json");
Set<File> resultFiles = convert(jmhFile);
MatcherAssert.assertThat(resultFiles, Matchers.hasSize(1));
File resultFile = resultFiles.iterator().next();
Kopemedata data = XMLDataLoader.loadData(resultFile);
List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult();
MatcherAssert.assertThat(results, Matchers.hasSize(2));
Result result = results.get(0);
Assert.assertEquals(10, result.getIterations());
Assert.assertEquals(0, result.getWarmup());
System.out.println(result.getRepetitions());
}
Aggregations