use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestResultConversion method testDefaultConversion.
@Test
public void testDefaultConversion() throws JAXBException {
File jmhFile = new File(CONVERSION_FOLDER, "testMethod.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(1));
Result result = results.get(0);
Assert.assertEquals(result.getValue(), 1101075.0, 0.01);
Assert.assertEquals(result.getFulldata().getValue().get(0).getValue(), 1101075);
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestResultConversion method testThroughputConversion.
@Test
public void testThroughputConversion() throws JAXBException {
File jmhFile = new File(CONVERSION_FOLDER, "testMethod_throughput.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(5));
Result result = results.get(0);
Assert.assertEquals(result.getValue(), 1064297.5, 0.01);
Assert.assertEquals(result.getFulldata().getValue().get(0).getValue(), 1063790.0, 0.01);
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestResultConversion method testOriginalJmhConversionParams.
@Test
public void testOriginalJmhConversionParams() throws JAXBException {
File jmhFile = new File(CONVERSION_FOLDER, "example-with-params.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(3));
Result result = results.get(0);
Assert.assertEquals(result.getParams().getParam().get(0).getKey(), "TEST_PARAM");
Assert.assertEquals(result.getParams().getParam().get(0).getValue(), "val1");
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class ExternalJmhDataConverter method createChunks.
private static void createChunks(final Set<File> resultFiles, final String currentVersion) throws JAXBException {
for (File resultFile : resultFiles) {
LOG.info("Handling " + resultFile);
Kopemedata data = XMLDataLoader.loadData(resultFile);
Datacollector datacollector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
Set<String> allParams = getParams(datacollector);
for (String params : allParams) {
Chunk addedChunk = new Chunk();
datacollector.getResult().forEach(result -> {
if (params != null && ParamNameHelper.paramsToString(result.getParams()).equals(params)) {
addedChunk.getResult().add(result);
result.setVersion(new Versioninfo());
result.getVersion().setGitversion(currentVersion);
}
});
datacollector.getChunk().add(addedChunk);
}
datacollector.getResult().clear();
XMLDataStorer.storeData(resultFile, data);
}
}
use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class MeasurementFileFinder method loadData.
public Kopemedata loadData(final File file) throws JAXBException {
final XMLDataLoader xdl2 = new XMLDataLoader(file);
final Kopemedata oneResultData2 = xdl2.getFullData();
return oneResultData2;
}
Aggregations