Search in sources :

Example 61 with TestSet

use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.

the class ExecutionData method addEmptyVersion.

public void addEmptyVersion(final String version, final String predecessor) {
    TestSet tests = new TestSet();
    tests.setPredecessor(predecessor);
    versions.put(version, tests);
}
Also used : TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Example 62 with TestSet

use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.

the class ExecutionData method versionContainsTest.

@JsonIgnore
public boolean versionContainsTest(final String version, final TestCase currentIterationTest) {
    final TestSet clazzExecutions = versions.get(version);
    if (clazzExecutions != null) {
        for (final Map.Entry<TestCase, Set<String>> clazz : clazzExecutions.entrySet()) {
            final TestCase testclazz = clazz.getKey();
            final Set<String> methods = clazz.getValue();
            if (testclazz.getClazz().equals(currentIterationTest.getClazz()) && methods.contains(currentIterationTest.getMethod())) {
                return true;
            }
        }
    }
    return false;
}
Also used : TestSet(de.dagere.peass.dependency.analysis.data.TestSet) Set(java.util.Set) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 63 with TestSet

use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.

the class StaticTestSelection method toExecutionData.

@JsonIgnore
public ExecutionData toExecutionData() {
    ExecutionData executionData = new ExecutionData();
    for (Entry<String, VersionStaticSelection> entry : versions.entrySet()) {
        TestSet tests = entry.getValue().getTests();
        executionData.getVersions().put(entry.getKey(), tests);
    }
    return executionData;
}
Also used : TestSet(de.dagere.peass.dependency.analysis.data.TestSet) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 64 with TestSet

use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.

the class TreeReader method executeMeasurements.

private void executeMeasurements(final TestCase testcase, final String version) throws IOException, XmlPullParserException, InterruptedException {
    executor.loadClasses();
    executeKoPeMeKiekerRun(new TestSet(testcase), version, folders.getTreeLogFolder());
}
Also used : TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Example 65 with TestSet

use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.

the class JUnitTestTransformer method buildTestMethodSet.

@Override
public TestSet buildTestMethodSet(final TestSet testsToUpdate, final List<File> modules) {
    final TestSet tests = new TestSet();
    determineVersions(modules);
    for (final TestCase clazzname : testsToUpdate.getClasses()) {
        final Set<String> currentClazzMethods = testsToUpdate.getMethods(clazzname);
        if (currentClazzMethods == null || currentClazzMethods.isEmpty()) {
            final File moduleFolder = new File(projectFolder, clazzname.getModule());
            final List<TestCase> methods = getTestMethodNames(moduleFolder, clazzname);
            for (final TestCase test : methods) {
                addTestIfIncluded(tests, test);
            }
        } else {
            for (final String method : currentClazzMethods) {
                TestCase test = new TestCase(clazzname.getClazz(), method, clazzname.getModule());
                addTestIfIncluded(tests, test);
            }
        }
    }
    return tests;
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) File(java.io.File) TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Aggregations

TestSet (de.dagere.peass.dependency.analysis.data.TestSet)71 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)41 File (java.io.File)19 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)16 Test (org.junit.jupiter.api.Test)15 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)12 VersionStaticSelection (de.dagere.peass.dependency.persistence.VersionStaticSelection)10 Set (java.util.Set)8 ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)7 Map (java.util.Map)7 ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)6 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)5 ChangeManager (de.dagere.peass.dependency.ChangeManager)5 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)5 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)5 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)5 PeassFolders (de.dagere.peass.folders.PeassFolders)5 VersionIterator (de.dagere.peass.vcs.VersionIterator)5 JmhTestTransformer (de.dagere.peass.dependency.jmh.JmhTestTransformer)4 LinkedHashMap (java.util.LinkedHashMap)4