Search in sources :

Example 1 with OneReader

use of de.dagere.peass.dependency.parallel.OneReader in project peass by DaGeRe.

the class TestVersionSplitting method readDummyDependencies.

private void readDummyDependencies(final List<StaticTestSelection> dependencies, final int i, final List<GitCommit> currentCommits, final List<GitCommit> reserveCommits, final GitCommit minimumCommit) throws IOException {
    File dummyFolder = new File(TestConstants.CURRENT_FOLDER, "part_" + i);
    dummyFolder.mkdir();
    File pom = new File(dummyFolder, "pom.xml");
    try (BufferedWriter newBufferedWriter = Files.newBufferedWriter(pom.toPath())) {
        newBufferedWriter.write("<project></project>");
    }
    final VersionIterator fakeIterator = new FakeVersionIterator(dummyFolder, currentCommits);
    final ChangeManager changeManager = Mockito.mock(ChangeManager.class);
    Mockito.when(changeManager.getChanges(Mockito.any())).thenReturn(null);
    FirstRunningVersionFinder finder = new FirstRunningVersionFinder(null, null, null, null, null) {

        @Override
        public boolean searchFirstRunningCommit() {
            return true;
        }
    };
    DummyReader dummy = new DummyReader(dummyFolder, fakeIterator, changeManager);
    System.out.println(minimumCommit.getTag());
    final VersionIterator reserveIterator = new FakeVersionIterator(dummyFolder, reserveCommits);
    OneReader reader = new OneReader(minimumCommit, reserveIterator, dummy, finder);
    reader.run();
    dependencies.add(dummy.getDependencies());
}
Also used : ChangeManager(de.dagere.peass.dependency.ChangeManager) FirstRunningVersionFinder(de.dagere.peass.dependency.reader.FirstRunningVersionFinder) OneReader(de.dagere.peass.dependency.parallel.OneReader) FakeVersionIterator(de.dagere.peass.dependencytests.helper.FakeVersionIterator) VersionIterator(de.dagere.peass.vcs.VersionIterator) FakeVersionIterator(de.dagere.peass.dependencytests.helper.FakeVersionIterator) File(java.io.File) BufferedWriter(java.io.BufferedWriter)

Example 2 with OneReader

use of de.dagere.peass.dependency.parallel.OneReader 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

OneReader (de.dagere.peass.dependency.parallel.OneReader)2 VersionIterator (de.dagere.peass.vcs.VersionIterator)2 ChangeManager (de.dagere.peass.dependency.ChangeManager)1 FirstRunningVersionFinder (de.dagere.peass.dependency.reader.FirstRunningVersionFinder)1 FakeVersionIterator (de.dagere.peass.dependencytests.helper.FakeVersionIterator)1 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)1 BufferedWriter (java.io.BufferedWriter)1 File (java.io.File)1