Search in sources :

Example 56 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class PropertyReader method readMethod.

private void readMethod(final File methodSourceFolder, final Map.Entry<String, TestSet> version, final Entry<TestCase, Set<String>> testclazz, final List<ChangeProperty> properties, final String testmethod) throws IOException {
    final Change testcaseChange = new Change();
    testcaseChange.setMethod(testmethod);
    final ChangedEntity entity = new ChangedEntity(testclazz.getKey().getClazz(), testclazz.getKey().getModule());
    // TODO eventually, we need to set change the version of the config here to  version.getKey(), version.getValue().getPredecessor(),
    ExecutionConfig copyConfig = new ExecutionConfig(config);
    copyConfig.setVersion(version.getKey());
    copyConfig.setVersionOld(version.getValue().getPredecessor());
    final PropertyReadHelper reader = new PropertyReadHelper(copyConfig, entity, testcaseChange, projectFolder, resultsFolders.getViewFolder(), methodSourceFolder, changedTests);
    final ChangeProperty currentProperty = reader.read();
    if (currentProperty != null) {
        properties.add(currentProperty);
    }
    count++;
}
Also used : ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) Change(de.dagere.peass.analysis.changes.Change) ExecutionConfig(de.dagere.peass.config.ExecutionConfig)

Example 57 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestKiekerEnvironmentPreparer method testFullAopXMLGeneration.

@Test
public void testFullAopXMLGeneration() throws IOException, InterruptedException {
    List<File> modules = new LinkedList<File>();
    modules.add(DependencyTestConstants.CURRENT);
    KiekerConfig kiekerConfig = new KiekerConfig(true);
    kiekerConfig.setUseSourceInstrumentation(false);
    KiekerEnvironmentPreparer kiekerEnvironmentPreparer = new KiekerEnvironmentPreparer(null, Arrays.asList("defaultpackage.NormalDependency"), new PeassFolders(DependencyTestConstants.CURRENT), new JUnitTestTransformer(DependencyTestConstants.CURRENT, new ExecutionConfig(10), kiekerConfig), modules);
    kiekerEnvironmentPreparer.prepareKieker();
    checkAopCorrectness();
}
Also used : KiekerEnvironmentPreparer(de.dagere.peass.execution.kieker.KiekerEnvironmentPreparer) JUnitTestTransformer(de.dagere.peass.testtransformation.JUnitTestTransformer) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) LinkedList(java.util.LinkedList) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 58 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestDependencyIteratorBuilder method testNightlyBuildWithoutRunningPrePredecessor.

@Test
public void testNightlyBuildWithoutRunningPrePredecessor() {
    try (MockedStatic<GitUtils> gitUtil = Mockito.mockStatic(GitUtils.class)) {
        gitUtil.when(() -> GitUtils.getName(Mockito.any(), Mockito.any())).thenReturn(VERSION_2);
        ExecutionConfig config = new ExecutionConfig();
        config.setVersionOld(null);
        config.setVersion("HEAD");
        StaticTestSelection dependencies = buildVersionDependencies(SIMPLE_PREDECESSOR);
        dependencies.getVersions().get(SIMPLE_PREDECESSOR).setRunning(false);
        DependencyIteratorBuilder builder = new DependencyIteratorBuilder(config, dependencies, new PeassFolders(TEMPORARY_FOLDER));
        VersionIteratorGit iterator = builder.getIterator();
        Assert.assertNull(iterator);
        Assert.assertEquals(VERSION_2, builder.getVersion());
        Assert.assertEquals(SIMPLE_PREDECESSOR, builder.getVersionOld());
    }
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) GitUtils(de.dagere.peass.vcs.GitUtils) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 59 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestDependencyIteratorBuilder method testNightlyBuildWithPrePredecessor.

@Test
public void testNightlyBuildWithPrePredecessor() {
    try (MockedStatic<GitUtils> gitUtil = Mockito.mockStatic(GitUtils.class)) {
        gitUtil.when(() -> GitUtils.getName(Mockito.any(), Mockito.any())).thenReturn(VERSION_2);
        ExecutionConfig config = new ExecutionConfig();
        config.setVersionOld(null);
        config.setVersion("HEAD");
        StaticTestSelection dependencies = buildVersionDependencies(SIMPLE_PREDECESSOR, VERSION_2);
        DependencyIteratorBuilder builder = new DependencyIteratorBuilder(config, dependencies, new PeassFolders(TEMPORARY_FOLDER));
        VersionIteratorGit iterator = builder.getIterator();
        Assert.assertNull(iterator);
        Assert.assertEquals(VERSION_2, builder.getVersion());
        Assert.assertEquals(SIMPLE_PREDECESSOR, builder.getVersionOld());
    }
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) GitUtils(de.dagere.peass.vcs.GitUtils) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 60 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestDependencyIteratorBuilder method testInitialRun.

@Test
public void testInitialRun() {
    try (MockedStatic<GitUtils> gitUtil = Mockito.mockStatic(GitUtils.class)) {
        gitUtil.when(() -> GitUtils.getName("HEAD", TEMPORARY_FOLDER)).thenReturn(VERSION_2);
        gitUtil.when(() -> GitUtils.getName("HEAD~1", TEMPORARY_FOLDER)).thenReturn(SIMPLE_PREDECESSOR);
        ExecutionConfig config = new ExecutionConfig();
        config.setVersionOld(null);
        config.setVersion("HEAD");
        VersionIteratorGit iterator = new DependencyIteratorBuilder(config, null, new PeassFolders(TEMPORARY_FOLDER)).getIterator();
        Assert.assertEquals(2, iterator.getSize());
        Assert.assertEquals(VERSION_2, iterator.getTag());
        Assert.assertEquals(SIMPLE_PREDECESSOR, iterator.getPredecessor());
    }
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) GitUtils(de.dagere.peass.vcs.GitUtils) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Aggregations

ExecutionConfig (de.dagere.peass.config.ExecutionConfig)74 Test (org.junit.jupiter.api.Test)49 File (java.io.File)40 PeassFolders (de.dagere.peass.folders.PeassFolders)29 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)23 KiekerConfig (de.dagere.peass.config.KiekerConfig)21 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)20 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)14 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)14 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)13 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)12 ProjectModules (de.dagere.peass.execution.utils.ProjectModules)12 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)11 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)11 GitUtils (de.dagere.peass.vcs.GitUtils)10 ResultsFolders (de.dagere.peass.folders.ResultsFolders)9 ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)7 VersionIterator (de.dagere.peass.vcs.VersionIterator)7 HashSet (java.util.HashSet)7 ChangeManager (de.dagere.peass.dependency.ChangeManager)6