Search in sources :

Example 1 with XMLDataLoader

use of de.dagere.kopeme.datastorage.XMLDataLoader 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);
                    }
                }
            }
        }
    }
}
Also used : TestcaseType(de.dagere.kopeme.generated.TestcaseType) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) Kopemedata(de.dagere.kopeme.generated.Kopemedata) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk) File(java.io.File) TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Example 2 with XMLDataLoader

use of de.dagere.kopeme.datastorage.XMLDataLoader in project peass by DaGeRe.

the class IsThereTimeReductionVM method checkFolder.

private static void checkFolder(final File contentFolder) throws JAXBException {
    for (final File xmlFile : contentFolder.listFiles()) {
        if (xmlFile.getName().endsWith(".xml")) {
            final XMLDataLoader loader = new XMLDataLoader(xmlFile);
            final Set<String> versions = new LinkedHashSet<>();
            for (Chunk chunk : loader.getFullData().getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk()) {
                final Map<String, List<Result>> data = new HashMap<>();
                String version = chunk.getResult().get(1).getVersion().getGitversion();
                String versionOld = chunk.getResult().get(0).getVersion().getGitversion();
                for (Result r : chunk.getResult()) {
                    List<Result> current = data.get(r.getVersion().getGitversion());
                    if (current == null) {
                        current = new LinkedList<>();
                        data.put(r.getVersion().getGitversion(), current);
                    }
                    current.add(r);
                    vms++;
                }
                testSpeedup(xmlFile, data, versionOld, version);
            }
        }
    }
}
Also used : LinkedHashSet(java.util.LinkedHashSet) HashMap(java.util.HashMap) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) List(java.util.List) LinkedList(java.util.LinkedList) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk) File(java.io.File) Result(de.dagere.kopeme.generated.Result)

Example 3 with XMLDataLoader

use of de.dagere.kopeme.datastorage.XMLDataLoader in project peass by DaGeRe.

the class TestSummaryFileSaving method testSummaryFileSaving.

@Test
public void testSummaryFileSaving() 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());
}
Also used : TimeDataCollector(de.dagere.kopeme.datacollection.TimeDataCollector) TestcaseType(de.dagere.kopeme.generated.TestcaseType) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 4 with XMLDataLoader

use of de.dagere.kopeme.datastorage.XMLDataLoader in project peass by DaGeRe.

the class TestMearementFileFinder method testClazzName.

public void testClazzName(String expectedName, MeasurementFileFinder finderOtherPackage) throws JAXBException {
    XMLDataLoader loader = new XMLDataLoader(finderOtherPackage.getMeasurementFile());
    Assert.assertEquals(loader.getFullData().getTestcases().getClazz(), expectedName);
}
Also used : XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader)

Example 5 with XMLDataLoader

use of de.dagere.kopeme.datastorage.XMLDataLoader in project peass by DaGeRe.

the class MultipleVMTestUtil method getStatistics.

public static DescriptiveStatistics getStatistics(final File resultFile) throws JAXBException {
    final XMLDataLoader fullDataLoader = new XMLDataLoader(resultFile);
    final Kopemedata fullResultData = fullDataLoader.getFullData();
    final Datacollector oneRunDatacollector = getTimeDataCollector(fullResultData);
    final DescriptiveStatistics st = new DescriptiveStatistics();
    for (final Result r : oneRunDatacollector.getResult()) {
        st.addValue(r.getValue());
    }
    return st;
}
Also used : DescriptiveStatistics(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics) Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) Kopemedata(de.dagere.kopeme.generated.Kopemedata) Result(de.dagere.kopeme.generated.Result)

Aggregations

XMLDataLoader (de.dagere.kopeme.datastorage.XMLDataLoader)16 Kopemedata (de.dagere.kopeme.generated.Kopemedata)13 File (java.io.File)11 TestcaseType (de.dagere.kopeme.generated.TestcaseType)7 Result (de.dagere.kopeme.generated.Result)4 Chunk (de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)4 TimeDataCollector (de.dagere.kopeme.datacollection.TimeDataCollector)2 Datacollector (de.dagere.kopeme.generated.TestcaseType.Datacollector)2 HashMap (java.util.HashMap)2 JAXBException (javax.xml.bind.JAXBException)2 WildcardFileFilter (org.apache.commons.io.filefilter.WildcardFileFilter)2 Test (org.junit.jupiter.api.Test)2 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)1 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)1 DescribedChunk (de.dagere.peass.measurement.statistics.data.DescribedChunk)1 TestData (de.dagere.peass.measurement.statistics.data.TestData)1 FilenameFilter (java.io.FilenameFilter)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 LinkedList (java.util.LinkedList)1