use of de.dagere.peass.dependencytests.helper.FakeVersionIterator 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());
}
Aggregations