Search in sources :

Example 26 with VersionIterator

use of de.dagere.peass.vcs.VersionIterator in project peass by DaGeRe.

the class SuperclassDetectorIT method testSuperclassChange.

@Test
public void testSuperclassChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
    final File secondVersion = new File(VERSIONS_FOLDER, "superclass_changed");
    final Map<ChangedEntity, ClazzChangeData> changes = new TreeMap<>();
    changes.put(new ChangedEntity("defaultpackage.NormalSuperclass", ""), new ClazzChangeData("defaultpackage.NormalSuperclass", false));
    final ChangeManager changeManager = Mockito.mock(ChangeManager.class);
    Mockito.when(changeManager.getChanges(Mockito.any())).thenReturn(changes);
    final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
    final DependencyReader reader = new DependencyReader(DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, new PeassFolders(DependencyTestConstants.CURRENT), DependencyTestConstants.NULL_RESULTS_FOLDERS, null, fakeIterator, changeManager, new ExecutionConfig(5), new KiekerConfig(true), new EnvironmentVariables());
    reader.readInitialVersion();
    checkInitialDependencies(reader);
    fakeIterator.goToNextCommit();
    reader.analyseVersion(changeManager);
    checkFirstVersionDependencies(reader);
}
Also used : FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) TreeMap(java.util.TreeMap) PeassFolders(de.dagere.peass.folders.PeassFolders) ChangeManager(de.dagere.peass.dependency.ChangeManager) ClazzChangeData(de.dagere.peass.dependency.changesreading.ClazzChangeData) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) VersionIterator(de.dagere.peass.vcs.VersionIterator) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) Test(org.junit.jupiter.api.Test)

Example 27 with VersionIterator

use of de.dagere.peass.vcs.VersionIterator in project peass by DaGeRe.

the class DependencyParallelReader method processCommits.

void processCommits(final ResultsFolders currentOutFolders, final ExecutorService service, final PeassFolders foldersTemp, final List<GitCommit> currentCommits, final List<GitCommit> reserveCommits, final GitCommit minimumCommit) throws InterruptedException {
    LOG.debug("Start: {} End: {}", currentCommits.get(0), currentCommits.get(currentCommits.size() - 1));
    LOG.debug(currentCommits);
    final VersionIterator iterator = new VersionIteratorGit(foldersTemp.getProjectFolder(), currentCommits, null);
    FirstRunningVersionFinder finder = new FirstRunningVersionFinder(foldersTemp, nonRunning, iterator, executionConfig, env);
    final DependencyReader reader = new DependencyReader(dependencyConfig, foldersTemp, currentOutFolders, url, iterator, nonChanges, executionConfig, kiekerConfig, env);
    final VersionIteratorGit reserveIterator = new VersionIteratorGit(foldersTemp.getProjectFolder(), reserveCommits, null);
    final Runnable current = new OneReader(minimumCommit, reserveIterator, reader, finder);
    service.submit(current);
    Thread.sleep(5);
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) OneReader(de.dagere.peass.dependency.parallel.OneReader) VersionIterator(de.dagere.peass.vcs.VersionIterator)

Aggregations

VersionIterator (de.dagere.peass.vcs.VersionIterator)27 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)24 ChangeManager (de.dagere.peass.dependency.ChangeManager)23 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)23 Test (org.junit.jupiter.api.Test)22 File (java.io.File)15 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)10 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)9 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)7 TreeMap (java.util.TreeMap)7 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)5 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)5 PeassFolders (de.dagere.peass.folders.PeassFolders)5 KiekerConfig (de.dagere.peass.config.KiekerConfig)4 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)4 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)4 OneReader (de.dagere.peass.dependency.parallel.OneReader)2 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)2 VersionStaticSelection (de.dagere.peass.dependency.persistence.VersionStaticSelection)1 FirstRunningVersionFinder (de.dagere.peass.dependency.reader.FirstRunningVersionFinder)1