Search in sources :

Example 11 with ExecutionConfig

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

the class TestVersionDiff method testTestContainigPath.

@Test
public void testTestContainigPath() throws IOException {
    createFile(TOMCAT_EXAMPLE);
    createFile(NO_SOURCE_FOLDER);
    VersionDiff diff = createVersionDiff();
    ExecutionConfig config = new ExecutionConfig();
    config.getClazzFolders().clear();
    config.getClazzFolders().add("java");
    config.getTestClazzFolders().clear();
    config.getTestClazzFolders().add("test");
    diff.addChange(TOMCAT_EXAMPLE, config);
    diff.addChange(NO_SOURCE_FOLDER, config);
    MatcherAssert.assertThat(diff.getChangedClasses(), IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.CoyoteAdapter")));
    MatcherAssert.assertThat(diff.getChangedClasses(), Matchers.not(IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.Example2"))));
}
Also used : VersionDiff(de.dagere.peass.dependency.analysis.data.VersionDiff) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) Test(org.junit.jupiter.api.Test)

Example 12 with ExecutionConfig

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

the class TestNonIncludedTestRemover method testWithSetOnlyExclude.

@Test
public void testWithSetOnlyExclude() {
    Set<TestCase> tests = new HashSet<TestCase>();
    tests.add(new TestCase("TestA", "method1"));
    tests.add(new TestCase("TestA", "method2"));
    tests.add(new TestCase("TestB", "method3"));
    tests.add(new TestCase("TestC", null));
    tests.add(new TestCase("TestD", null));
    ExecutionConfig executionConfig = new ExecutionConfig(Arrays.asList(new String[] {}), "test");
    executionConfig.setExcludes(Arrays.asList(new String[] { "TestA#*" }));
    NonIncludedTestRemover.removeNotIncluded(tests, executionConfig);
    Assert.assertEquals(3, tests.size());
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 13 with ExecutionConfig

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

the class TestNonIncludedTestRemover method testWithTestSet.

@Test
public void testWithTestSet() {
    TestSet tests = new TestSet();
    tests.addTest(new TestCase("TestA", "method1"));
    tests.addTest(new TestCase("TestA", "method2"));
    tests.addTest(new TestCase("TestB", "method3"));
    tests.addTest(new TestCase("TestC", null));
    tests.addTest(new TestCase("TestD", null));
    NonIncludedTestRemover.removeNotIncluded(tests, new ExecutionConfig(Arrays.asList(new String[] { "TestA#method1", "TestC" }), "test"));
    Assert.assertEquals(2, tests.getTests().size());
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) Test(org.junit.jupiter.api.Test)

Example 14 with ExecutionConfig

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

the class TestExecutorCreation method testMavenExecutorCreation.

@Test
public void testMavenExecutorCreation() {
    ExecutionConfig config = new ExecutionConfig();
    TestTransformer testTransformer = ExecutorCreator.createTestTransformer(Mockito.mock(PeassFolders.class), config, new KiekerConfig(true));
    Assert.assertNotNull(testTransformer);
}
Also used : TestTransformer(de.dagere.peass.testtransformation.TestTransformer) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 15 with ExecutionConfig

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

the class TestPackageFinder method testDependencyModule.

@Test
public void testDependencyModule() {
    ExecutionConfig config = new ExecutionConfig();
    config.getClazzFolders().add("src/main/java");
    config.getClazzFolders().add("src/java");
    final List<String> lowestPackage = new ClazzFileFinder(config).getClasses(new File("."));
    System.out.println(lowestPackage);
    MatcherAssert.assertThat(lowestPackage, IsIterableContaining.hasItem("de.dagere.peass.RegressionTestSelectionStarter"));
    MatcherAssert.assertThat(lowestPackage, Matchers.not(IsIterableContaining.hasItem("de.dagere.peass.RegressionTestSelectionStarter.RegressionTestSelectionStarter")));
    MatcherAssert.assertThat(lowestPackage, IsIterableContaining.hasItem("de.dagere.peass.dependency.statistics.DependencyStatisticAnalyzer"));
    MatcherAssert.assertThat(lowestPackage, IsIterableContaining.hasItem("de.dagere.peass.dependency.statistics.DependencyStatistics"));
    MatcherAssert.assertThat(lowestPackage, IsIterableContaining.hasItem("de.dagere.peass.TestPackageFinder"));
}
Also used : ClazzFileFinder(de.dagere.peass.dependency.ClazzFileFinder) 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