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++;
}
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();
}
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());
}
}
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());
}
}
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());
}
}
Aggregations