Search in sources :

Example 1 with TestcaseType

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

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

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

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

the class MeasurementFileFinder method getDataCollector.

public static Datacollector getDataCollector(final String method, final List<TestcaseType> testcaseList) {
    Datacollector datacollector = null;
    for (final TestcaseType testcase : testcaseList) {
        if (testcase.getName().equals(method)) {
            datacollector = testcase.getDatacollector().get(0);
        }
    }
    if (datacollector == null) {
        final TestcaseType testcase = new TestcaseType();
        testcaseList.add(testcase);
        testcase.setName(method);
        datacollector = new Datacollector();
        testcase.getDatacollector().add(datacollector);
    }
    return datacollector;
}
Also used : Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) TestcaseType(de.dagere.kopeme.generated.TestcaseType)

Example 5 with TestcaseType

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

the class MultipleVMTestUtil method initKopemeData.

public static Kopemedata initKopemeData(final File summaryResultFile, final TestCase testcase) throws JAXBException {
    final XMLDataLoader fullDataLoader = new XMLDataLoader(summaryResultFile);
    final Kopemedata fullResultData = fullDataLoader.getFullData();
    if (fullResultData.getTestcases().getTestcase().size() == 0) {
        fullResultData.getTestcases().setClazz(testcase.getClazz());
        fullResultData.getTestcases().getTestcase().add(new TestcaseType());
        fullResultData.getTestcases().getTestcase().get(0).setName(testcase.getMethod());
    }
    return fullResultData;
}
Also used : TestcaseType(de.dagere.kopeme.generated.TestcaseType) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) Kopemedata(de.dagere.kopeme.generated.Kopemedata)

Aggregations

TestcaseType (de.dagere.kopeme.generated.TestcaseType)16 Kopemedata (de.dagere.kopeme.generated.Kopemedata)14 File (java.io.File)10 XMLDataLoader (de.dagere.kopeme.datastorage.XMLDataLoader)8 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)6 Result (de.dagere.kopeme.generated.Result)5 Test (org.junit.jupiter.api.Test)5 Chunk (de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)4 Datacollector (de.dagere.kopeme.generated.TestcaseType.Datacollector)3 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)3 PeassFolders (de.dagere.peass.folders.PeassFolders)3 TimeDataCollector (de.dagere.kopeme.datacollection.TimeDataCollector)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 List (java.util.List)2 JAXBException (javax.xml.bind.JAXBException)2 DescriptiveStatistics (org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)2 ParseException (com.github.javaparser.ParseException)1 Testcases (de.dagere.kopeme.generated.Kopemedata.Testcases)1