use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.
the class TestCaseTest method testConstructionWithChunk.
@Test
public void testConstructionWithChunk() throws JAXBException {
File dataFile = new File("src/test/resources/testcaseTest/ExampleTest_test(JUNIT_PARAMETERIZED-0).xml");
Kopemedata kopemedata = XMLDataLoader.loadData(dataFile);
TestCase test = new TestCase(kopemedata.getTestcases());
Assert.assertEquals(test.getMethod(), "test");
Assert.assertEquals(test.getParams(), "JUNIT_PARAMETERIZED-0");
}
use of de.dagere.kopeme.generated.Kopemedata in project peass-ci-plugin by jenkinsci.
the class DefaultMeasurementVisualizer method visualizeMeasurements.
public void visualizeMeasurements() {
String longestPrefix = RCAVisualizer.getLongestPrefix(tests);
LOG.debug("Prefix: {} Keys: {}", longestPrefix, tests);
File detailResultsFolder = new File(dataFolder, "measurements");
File[] files = dataFolder.listFiles((FileFilter) new WildcardFileFilter("*.xml"));
LOG.debug("Searching in {} Files: {}", dataFolder, files != null ? files.length : "no files");
if (files != null) {
Arrays.sort(files);
for (File testcaseFile : files) {
try {
Kopemedata data = XMLDataLoader.loadData(testcaseFile);
TestCase testcase = new TestCase(data.getTestcases());
KoPeMeTreeConverter treeConverter = new KoPeMeTreeConverter(detailResultsFolder, version, testcase);
File testcaseVisualizationFile = generateJSFile(testcase, treeConverter);
LOG.debug("Adding action: " + testcase.toString());
String name = testcase.toString().replace("#", "_").substring(longestPrefix.length());
final String content = FileUtils.readFileToString(testcaseVisualizationFile, StandardCharsets.UTF_8);
run.addAction(new MeasurementVisualizationAction("measurement_" + name, content));
} catch (JAXBException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
use of de.dagere.kopeme.generated.Kopemedata in project peass-ci-plugin by jenkinsci.
the class CorrectRunChecker method checkIsRunning.
private boolean checkIsRunning(final int vmId, final File resultFileCurrent) {
boolean isRunning = false;
if (resultFileCurrent.exists()) {
try {
LOG.debug("Checking: {} - {} ", vmId, resultFileCurrent.getAbsolutePath());
Kopemedata data = XMLDataLoader.loadData(resultFileCurrent);
Datacollector datacollector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
if (datacollector.getResult().get(0) != null) {
isRunning = true;
LOG.debug("File and result are existing - success");
}
} catch (JAXBException e) {
e.printStackTrace();
}
} else {
LOG.debug("File {} missing", resultFileCurrent);
}
return isRunning;
}
Aggregations