Search in sources :

Example 1 with Kopemedata

use of de.dagere.kopeme.generated.Kopemedata 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 Kopemedata

use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.

the class CopyFromFull method checkFileMerging.

public static void checkFileMerging(final File goal, final ExecutionData tests, final File source) throws JAXBException {
    Kopemedata kopemeData = XMLDataLoader.loadData(source);
    Testcases testcase = kopemeData.getTestcases();
    TestcaseType testcaseType = testcase.getTestcase().get(0);
    String clazz = testcase.getClazz();
    String method = testcaseType.getName();
    TestCase testcase2 = new TestCase(testcase);
    List<Chunk> chunks = testcaseType.getDatacollector().get(0).getChunk();
    if (!goal.exists()) {
        goal.mkdirs();
    }
    for (Chunk chunk : chunks) {
        checkChunkMerging(goal, tests, testcase2, chunk);
    }
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) TestcaseType(de.dagere.kopeme.generated.TestcaseType) Testcases(de.dagere.kopeme.generated.Kopemedata.Testcases) Kopemedata(de.dagere.kopeme.generated.Kopemedata) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)

Example 3 with Kopemedata

use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.

the class TestResultOrganizer method testXMLFileIsCorrect.

private void testXMLFileIsCorrect() throws JAXBException {
    File kopemefile = new File(getVersionMeasurementFolder(), searchedTest.getMethod() + "_0_" + VERSION_NAME + ".xml");
    Kopemedata data = XMLDataLoader.loadData(kopemefile);
    final Datacollector datacollector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
    final Fulldata fulldata = datacollector.getResult().get(0).getFulldata();
    Assert.assertNotNull(fulldata.getFileName());
    File fulldataFile = new File(getVersionMeasurementFolder(), fulldata.getFileName());
    Assert.assertTrue(fulldataFile.exists());
}
Also used : Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) Fulldata(de.dagere.kopeme.generated.Result.Fulldata)

Example 4 with Kopemedata

use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.

the class TestResultOrganizerParallel method testXMLFileIsCorrect.

private void testXMLFileIsCorrect() throws JAXBException {
    File kopemefile = new File(getVersionMeasurementFolder(TestResultOrganizer.VERSION_NAME, PARALLEL_VERSION), TestResultOrganizer.searchedTest.getMethod() + "_0_" + PARALLEL_VERSION + ".xml");
    Kopemedata data = XMLDataLoader.loadData(kopemefile);
    final Datacollector datacollector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
    final Fulldata fulldata = datacollector.getResult().get(0).getFulldata();
    Assert.assertNotNull(fulldata.getFileName());
    File fulldataFile = new File(getVersionMeasurementFolder(TestResultOrganizer.VERSION_NAME, PARALLEL_VERSION), fulldata.getFileName());
    Assert.assertTrue(fulldataFile.exists());
}
Also used : Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) Fulldata(de.dagere.kopeme.generated.Result.Fulldata)

Example 5 with Kopemedata

use of de.dagere.kopeme.generated.Kopemedata in project peass by DaGeRe.

the class TestResultOrganizerParams method testReading.

@Test
public void testReading() throws JAXBException, IOException {
    TestCase testcase = new TestCase("de.dagere.peass.ExampleBenchmarkClazz#calleeMethod");
    PeassFolders folders = mockFolders(testcase);
    for (int i = 0; i < 3; i++) {
        ResultOrganizer organizer = new ResultOrganizer(folders, VERSION, 15 + i, false, false, testcase, 10);
        organizer.saveResultFiles(VERSION, i);
        organizer.saveResultFiles(VERSION_OLD, i);
    }
    File expectedResultFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1).xml");
    File expectedResultFile2 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2).xml");
    Assert.assertTrue(expectedResultFile1.exists());
    Assert.assertTrue(expectedResultFile2.exists());
    Kopemedata data = XMLDataLoader.loadData(expectedResultFile1);
    List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk().get(0).getResult();
    MatcherAssert.assertThat(results, IsIterableWithSize.iterableWithSize(2));
    File expectedFulldataFile = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2)_0_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
    Kopemedata fulldata = XMLDataLoader.loadData(expectedFulldataFile);
    Assert.assertEquals(1, fulldata.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
    File expectedFulldataFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1)_2_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
    Kopemedata fulldata1 = XMLDataLoader.loadData(expectedFulldataFile1);
    Assert.assertEquals(1, fulldata1.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
}
Also used : ResultOrganizer(de.dagere.peass.measurement.organize.ResultOrganizer) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) PeassFolders(de.dagere.peass.folders.PeassFolders) Result(de.dagere.kopeme.generated.Result) Test(org.junit.jupiter.api.Test)

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