Search in sources :

Example 16 with ExecutionConfig

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

the class TestPropertyReadHelper method testNullVersion.

@Test
public void testNullVersion() throws IOException {
    Change changeMock = Mockito.mock(Change.class);
    Mockito.when(changeMock.getMethod()).thenReturn("myTestMethod");
    ExecutionConfig config = new ExecutionConfig();
    config.setVersion("000001");
    File projectFolder = new File("target/current");
    Files.touch(new File(projectFolder, "pom.xml"));
    PropertyReadHelper helper = new PropertyReadHelper(config, new ChangedEntity("Test"), changeMock, projectFolder, null, null, null);
    ChangeProperty emptyProperty = helper.read();
    MatcherAssert.assertThat(emptyProperty, IsNull.notNullValue());
    Assert.assertEquals("myTestMethod", emptyProperty.getMethod());
}
Also used : PropertyReadHelper(de.dagere.peass.analysis.properties.PropertyReadHelper) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) ChangeProperty(de.dagere.peass.analysis.properties.ChangeProperty) Change(de.dagere.peass.analysis.changes.Change) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 17 with ExecutionConfig

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

the class TestKiekerEnvironmentPreparer method testAOPXMLGeneration.

@Test
public void testAOPXMLGeneration() throws IOException, InterruptedException {
    Set<String> includedMethodPatterns = new HashSet<String>();
    includedMethodPatterns.add("public void defaultpackage.NormalDependency.methodA(java.lang.String,int)");
    includedMethodPatterns.add("private int defaultpackage.NormalDependency.methodB()");
    List<File> modules = new LinkedList<File>();
    modules.add(DependencyTestConstants.CURRENT);
    KiekerConfig kiekerConfig = new KiekerConfig(true);
    kiekerConfig.setUseSourceInstrumentation(false);
    KiekerEnvironmentPreparer kiekerEnvironmentPreparer = new KiekerEnvironmentPreparer(includedMethodPatterns, new LinkedList<>(), 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) HashSet(java.util.HashSet) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 18 with ExecutionConfig

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

the class TestExecutor method loadClasses.

public void loadClasses() {
    existingClasses = new LinkedList<>();
    for (final File module : getModules().getModules()) {
        ExecutionConfig executionConfig = testTransformer.getConfig().getExecutionConfig();
        ClazzFileFinder finder = new ClazzFileFinder(executionConfig);
        final List<String> currentClasses = finder.getClasses(module);
        existingClasses.addAll(currentClasses);
    }
}
Also used : ClazzFileFinder(de.dagere.peass.dependency.ClazzFileFinder) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File)

Example 19 with ExecutionConfig

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

the class TestGetModules method testOtherSimple.

@Test
public void testOtherSimple() {
    File pomFile = new File("src/test/resources/maven-multimodule-pl-example/basic_state/pom.xml");
    ExecutionConfig config = new ExecutionConfig();
    ProjectModules modules = MavenPomUtil.getModules(pomFile, config);
    Assert.assertEquals(4, modules.getModules().size());
}
Also used : ProjectModules(de.dagere.peass.execution.utils.ProjectModules) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 20 with ExecutionConfig

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

the class TestGetModules method testWrongPl.

@Test
public void testWrongPl() {
    Assertions.assertThrows(RuntimeException.class, () -> {
        File pomFile = new File("src/test/resources/maven-multimodule-pl-example/basic_state/pom.xml");
        ExecutionConfig config = new ExecutionConfig();
        config.setPl("inner-module-1");
        ProjectModules modules = MavenPomUtil.getModules(pomFile, config);
    });
}
Also used : ProjectModules(de.dagere.peass.execution.utils.ProjectModules) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) 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