Search in sources :

Example 36 with Kopemedata

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");
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 37 with Kopemedata

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();
            }
        }
    }
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) KoPeMeTreeConverter(de.dagere.peass.visualization.KoPeMeTreeConverter) JAXBException(javax.xml.bind.JAXBException) IOException(java.io.IOException) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) WildcardFileFilter(io.jenkins.cli.shaded.org.apache.commons.io.filefilter.WildcardFileFilter) MeasurementVisualizationAction(de.dagere.peass.ci.MeasurementVisualizationAction)

Example 38 with Kopemedata

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;
}
Also used : Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) JAXBException(javax.xml.bind.JAXBException) Kopemedata(de.dagere.kopeme.generated.Kopemedata)

Aggregations

Kopemedata (de.dagere.kopeme.generated.Kopemedata)38 File (java.io.File)29 Result (de.dagere.kopeme.generated.Result)15 XMLDataLoader (de.dagere.kopeme.datastorage.XMLDataLoader)14 TestcaseType (de.dagere.kopeme.generated.TestcaseType)14 Test (org.junit.jupiter.api.Test)12 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)11 Datacollector (de.dagere.kopeme.generated.TestcaseType.Datacollector)10 Chunk (de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)8 JAXBException (javax.xml.bind.JAXBException)6 Fulldata (de.dagere.kopeme.generated.Result.Fulldata)4 PeassFolders (de.dagere.peass.folders.PeassFolders)4 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)3 WildcardFileFilter (org.apache.commons.io.filefilter.WildcardFileFilter)3 DescriptiveStatistics (org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)3 TimeDataCollector (de.dagere.kopeme.datacollection.TimeDataCollector)2 Testcases (de.dagere.kopeme.generated.Kopemedata.Testcases)2 JmhTestTransformer (de.dagere.peass.dependency.jmh.JmhTestTransformer)2 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)2 TestExecutor (de.dagere.peass.execution.utils.TestExecutor)2