use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class TestDependencyIteratorBuilder method testNightlyBuildWithoutPrePredecessor.
@Test
public void testNightlyBuildWithoutPrePredecessor() {
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();
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(null, builder.getVersionOld());
}
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class TestVersionDiff method testJavaContainigPath.
@Test
public void testJavaContainigPath() throws IOException {
createFile(JAVA_PATH_FILE);
createFile(NO_SOURCE_FOLDER);
VersionDiff diff = createVersionDiff();
ExecutionConfig config = new ExecutionConfig();
config.getClazzFolders().clear();
config.getClazzFolders().add("java");
diff.addChange(JAVA_PATH_FILE, config);
diff.addChange(NO_SOURCE_FOLDER, config);
MatcherAssert.assertThat(diff.getChangedClasses(), IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.Example")));
MatcherAssert.assertThat(diff.getChangedClasses(), Matchers.not(IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.Example2"))));
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class TestVersionDiff method testRegularMavenPath.
@Test
public void testRegularMavenPath() throws IOException {
createFile(MAVEN_PATH_FILE);
createFile(NO_SOURCE_FOLDER);
VersionDiff diff = createVersionDiff();
ExecutionConfig config = new ExecutionConfig();
diff.addChange(MAVEN_PATH_FILE, config);
diff.addChange(NO_SOURCE_FOLDER, config);
MatcherAssert.assertThat(diff.getChangedClasses(), IsIterableContaining.hasItem(new ChangedEntity("de.dagere.peass.Example")));
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class TestNonIncludedTestRemover method testWithModulesRegular.
@Test
public void testWithModulesRegular() {
Set<TestCase> tests = new HashSet<TestCase>();
tests.add(new TestCase("TestA", "method1", "moduleA"));
tests.add(new TestCase("TestB", "method1", "moduleB"));
tests.add(new TestCase("TestC", "method1", "moduleC"));
NonIncludedTestRemover.removeNotIncluded(tests, new ExecutionConfig(Arrays.asList(new String[] { "moduleA§TestA#method1", "TestC" }), "test"));
System.out.println(tests);
Assert.assertEquals(1, tests.size());
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class TestNonIncludedTestRemover method testWithModulesSameNameButDifferentModule.
@Test
public void testWithModulesSameNameButDifferentModule() {
Set<TestCase> tests = new HashSet<TestCase>();
tests.add(new TestCase("TestA", "method1", "moduleA"));
tests.add(new TestCase("TestB", "method1", "moduleB"));
tests.add(new TestCase("TestA", "method1", "moduleC"));
NonIncludedTestRemover.removeNotIncluded(tests, new ExecutionConfig(Arrays.asList(new String[] { "moduleA§TestA#method1", "TestC" }), "test"));
System.out.println(tests);
Assert.assertEquals(1, tests.size());
}
Aggregations