use of de.dagere.peass.dependencytests.helper.FakeFileIterator in project peass by DaGeRe.
the class DependencyDetectorITGradle method testNormalChangeAndroid.
@Test
public void testNormalChangeAndroid() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
init(BASIC_STATE_ANDROID);
final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(CHANGE_ANDROID));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
use of de.dagere.peass.dependencytests.helper.FakeFileIterator in project peass by DaGeRe.
the class DependencyDetectorIncludesTest method executeWithInclude.
private DependencyReader executeWithInclude(final String includeName, final File secondVersion, final ChangeManager changeManager) throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
ExecutionConfig config = new ExecutionConfig(5);
config.getIncludes().add(includeName);
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator, config, DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, DependencyTestConstants.NULL_RESULTS_FOLDERS);
return reader;
}
use of de.dagere.peass.dependencytests.helper.FakeFileIterator in project peass by DaGeRe.
the class DependencyDetectorJUnit5IT method testNormalChange.
@Test
public void testNormalChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(NORMAL_CHANGE));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(Constants.OBJECTMAPPER.writeValueAsString(reader.getDependencies()));
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
use of de.dagere.peass.dependencytests.helper.FakeFileIterator in project peass by DaGeRe.
the class DependencyDetectorMultimoduleIT method testTwoChanges.
@Test
public void testTwoChanges() throws IOException, XmlPullParserException, InterruptedException, ParseException, ViewNotFoundException {
final File thirdVersion = new File(VERSIONS_FOLDER, "another_change");
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(thirdVersion));
ChangeManager changeManager = mockChangeManager();
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());
final boolean success = reader.readInitialVersion();
Assert.assertTrue(success);
StaticTestSelection dependencies = reader.getDependencies();
checkInitialVersion(dependencies);
fakeIterator.goToNextCommit();
reader.analyseVersion(changeManager);
testFirstChange(dependencies);
testSecondChange(dependencies);
}
use of de.dagere.peass.dependencytests.helper.FakeFileIterator in project peass by DaGeRe.
the class DependencyDetectorNoUpdateIT method testNormalChange.
@Test
public void testNormalChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final File secondVersion = new File(DependencyTestConstants.VERSIONS_FOLDER, "normal_change");
final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(reader.getDependencies());
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
Aggregations