Search in sources :

Example 1 with FirstRunningVersionFinder

use of de.dagere.peass.dependency.reader.FirstRunningVersionFinder 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)

Aggregations

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